diff --git a/.github/workflows/depscheck.yaml b/.github/workflows/depscheck.yaml index b0666e9304188..8a4faf1ab8435 100644 --- a/.github/workflows/depscheck.yaml +++ b/.github/workflows/depscheck.yaml @@ -1,5 +1,7 @@ --- name: Vendor Dependencies Check +permissions: + contents: read on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/gencheck.yaml b/.github/workflows/gencheck.yaml index c7119449ef7da..005ecded4068c 100644 --- a/.github/workflows/gencheck.yaml +++ b/.github/workflows/gencheck.yaml @@ -1,5 +1,7 @@ --- name: Generation Check +permissions: + contents: read on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/golint.yaml b/.github/workflows/golint.yaml index 5dd06d52c0d19..873be8a3b8a83 100644 --- a/.github/workflows/golint.yaml +++ b/.github/workflows/golint.yaml @@ -1,5 +1,7 @@ --- name: GoLang Linting +permissions: + contents: read on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/gradually-deprecated.yaml b/.github/workflows/gradually-deprecated.yaml index 51c3abe97f8f3..caa4a0924babe 100644 --- a/.github/workflows/gradually-deprecated.yaml +++ b/.github/workflows/gradually-deprecated.yaml @@ -1,5 +1,7 @@ --- name: Check for new usages of deprecated functionality +permissions: + contents: read on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/issue-opened.yaml b/.github/workflows/issue-opened.yaml index c3a4c065d878a..98d9143fbae78 100644 --- a/.github/workflows/issue-opened.yaml +++ b/.github/workflows/issue-opened.yaml @@ -1,5 +1,8 @@ name: Issue Opened Triage +permissions: + issues: write + on: issues: types: [opened] diff --git a/.github/workflows/lock.yaml b/.github/workflows/lock.yaml index ed67648c78872..4e162901f70cb 100644 --- a/.github/workflows/lock.yaml +++ b/.github/workflows/lock.yaml @@ -6,6 +6,9 @@ on: jobs: lock: + permissions: + issues: write + pull-requests: write runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v2 diff --git a/.github/workflows/pull-request-new-commit.yaml b/.github/workflows/pull-request-new-commit.yaml index a9e993c0353ba..7042b90f2a90c 100644 --- a/.github/workflows/pull-request-new-commit.yaml +++ b/.github/workflows/pull-request-new-commit.yaml @@ -1,8 +1,11 @@ --- name: Pull Request New Commit +permissions: + pull-requests: write + on: - pull_request: + pull_request_target: types: [synchronize] jobs: @@ -12,4 +15,4 @@ jobs: - uses: actions-ecosystem/action-remove-labels@v1 with: github_token: "${{ secrets.GITHUB_TOKEN }}" - labels: waiting-response \ No newline at end of file + labels: waiting-response diff --git a/.github/workflows/pull-request-reviewed-workflow.yaml b/.github/workflows/pull-request-reviewed-workflow.yaml new file mode 100644 index 0000000000000..64f9da723f541 --- /dev/null +++ b/.github/workflows/pull-request-reviewed-workflow.yaml @@ -0,0 +1,48 @@ +--- +name: "Pull Request Reviewed Workflow" + +on: + workflow_run: + workflows: + - "Pull Request Reviewed" + types: + - completed + +permissions: + pull-requests: write + +jobs: + add-or-remove-waiting-response: + runs-on: ubuntu-latest + outputs: + ghrepo: ${{ steps.env_vars.outputs.ghrepo }} + ghowner: ${{ steps.env_vars.outputs.ghowner }} + prnumber: ${{ steps.env_vars.outputs.prnumber }} + action: ${{ steps.env_vars.outputs.action }} + steps: + - name: Get Artifact + id: get_artifact + continue-on-error: true + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: pull-request-reviewed.yaml + + - name: env_vars + id: env_vars + if: steps.get_artifact.outcome == 'success' + run: | + echo "::set-output name=ghrepo::$(cat artifact/ghrepo.txt)" + echo "::set-output name=ghowner::$(cat artifact/ghowner.txt)" + echo "::set-output name=prnumber::$(cat artifact/prnumber.txt)" + echo "::set-output name=action::$(cat artifact/action.txt)" + + - name: add waiting-reponse + if: steps.get_artifact.outcome == 'success' && steps.env_vars.outputs.action == 'add-waiting-response' + run: | + curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos${{ steps.env_vars.outputs.ghowner }}/${{ steps.env_vars.outputs.ghrepo }}/issues/${{ steps.env_vars.outputs.prnumber }}/labels" -d '{"labels":["waiting-response"]}' + + - name: remove waiting-reponse + if: steps.get_artifact.outcome == 'success' && steps.env_vars.outputs.action == 'remove-waiting-response' + run: | + curl -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos${{ steps.env_vars.outputs.ghowner }}/${{ steps.env_vars.outputs.ghrepo }}/issues/${{ steps.env_vars.outputs.prnumber }}/labels/waiting-response" diff --git a/.github/workflows/pull-request-reviewed.yaml b/.github/workflows/pull-request-reviewed.yaml index 0598a737c0b7b..691170a65157d 100644 --- a/.github/workflows/pull-request-reviewed.yaml +++ b/.github/workflows/pull-request-reviewed.yaml @@ -6,21 +6,31 @@ on: types: [submitted] permissions: - pull-requests: write + pull-requests: read jobs: - add-waiting-response: - if: github.event.review.state != 'approved' && github.actor != github.event.pull_request.user.login + add-or-remove-waiting-response: runs-on: ubuntu-latest steps: - - shell: bash + - name: "Set Artifacts for add-waiting-response" + if: github.event.review.state != 'approved' && github.actor != github.event.pull_request.user.login + shell: bash run: | - curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos${{ github.owner }}/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" -d '{"labels":["waiting-response"]}' - remove-waiting-response: - if: github.actor == github.event.pull_request.user.login - runs-on: ubuntu-latest - steps: - - uses: actions-ecosystem/action-remove-labels@v1 + mkdir -p wr_actions + echo ${{ github.owner }} > wr_actions/ghowner.txt + echo ${{ github.repository }} > wr_actions/ghrepo.txt + echo ${{ github.event.pull_request.number }} > wr_actions/prnumber.txt + echo "add-waiting-response" > wr_actions/action.txt + - name: "Set Artifacts for remove-waiting-response" + if: github.actor == github.event.pull_request.user.login + shell: bash + run: | + mkdir -p wr_actions + echo ${{ github.owner }} > wr_actions/ghowner.txt + echo ${{ github.repository }} > wr_actions/ghrepo.txt + echo ${{ github.event.pull_request.number }} > wr_actions/prnumber.txt + echo "remove-waiting-response" > wr_actions/action.txt + - uses: actions/upload-artifact@v3 with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - labels: waiting-response + name: artifact + path: wr_actions diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 9c58e3d541c82..bc8541c25aae9 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,5 +1,8 @@ name: "Pull Request Triage" +permissions: + pull-requests: write + on: [pull_request_target] jobs: diff --git a/.github/workflows/teamcity-test.yaml b/.github/workflows/teamcity-test.yaml index 6724f390dc50b..1e691f7525b90 100644 --- a/.github/workflows/teamcity-test.yaml +++ b/.github/workflows/teamcity-test.yaml @@ -1,5 +1,9 @@ --- name: TeamCity Config Test + +permissions: + contents: read + on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/tflint.yaml b/.github/workflows/tflint.yaml index 74e6a65f43651..a958f2babfa8f 100644 --- a/.github/workflows/tflint.yaml +++ b/.github/workflows/tflint.yaml @@ -1,5 +1,9 @@ --- name: Terraform Schema Linting + +permissions: + contents: read + on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/thirty-two-bit.yaml b/.github/workflows/thirty-two-bit.yaml index f9454c6ccb3ec..e0ddd0fdc45a8 100644 --- a/.github/workflows/thirty-two-bit.yaml +++ b/.github/workflows/thirty-two-bit.yaml @@ -1,5 +1,9 @@ --- name: 32 Bit Build + +permissions: + pull-requests: read + on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 69116e6920f29..c295f5f1bef11 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -1,5 +1,9 @@ --- name: Unit Tests + +permissions: + pull-requests: read + on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/validate-examples.yaml b/.github/workflows/validate-examples.yaml index 23e3a238d075d..28a586d6a6a94 100644 --- a/.github/workflows/validate-examples.yaml +++ b/.github/workflows/validate-examples.yaml @@ -1,5 +1,9 @@ --- name: Validate Examples + +permissions: + pull-requests: read + on: pull_request: types: ['opened', 'synchronize'] diff --git a/.github/workflows/website-lint.yaml b/.github/workflows/website-lint.yaml index 954a754cb5d95..48339db39c0f1 100644 --- a/.github/workflows/website-lint.yaml +++ b/.github/workflows/website-lint.yaml @@ -1,5 +1,9 @@ --- name: Website Linting + +permissions: + pull-requests: read + on: pull_request: types: ['opened', 'synchronize'] diff --git a/CHANGELOG.md b/CHANGELOG.md index 08d7a55483283..c30e1f63cc272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,44 @@ ## 3.19.0 (Unreleased) +FEATURES: + +* **New Rersource**: `azurerm_eventhub_namespace_schema_group` [GH-17635] +* **New Data Source**: `azurerm_dns_a_record` [GH-17477] +* **New Data Source**: `azurerm_dns_aaaa_record` [GH-17477] +* **New Data Source**: `azurerm_dns_caa_record` [GH-17477] +* **New Data Source**: `azurerm_dns_cname_record` [GH-17477] +* **New Data Source**: `azurerm_dns_mx_record` [GH-17477] +* **New Data Source**: `azurerm_dns_ns_record` [GH-17477] +* **New Data Source**: `azurerm_dns_ptr_record` [GH-17477] +* **New Data Source**: `azurerm_dns_soa_record` [GH-17477] +* **New Data Source**: `azurerm_dns_srv_record` [GH-17477] +* **New Data Source**: `azurerm_dns_txt_record` [GH-17477] + ENHANCEMENTS: +* Dependencies: bump `go-azure-helpers` to `v0.39.0` [GH-17996] +* Dependencies: bump `go-azure-sdk` to `v0.20220815.1092453` [GH-7998] +* updating `dedicated_host_*` to use `hashicorp/go-azure-sdk` [GH-17616] * Data Source: `azurerm_images` - now uses a logical id [GH-17766] +* Data Source: `azurerm_management_group` - now exports the `management_group_ids`, `all_management_group_ids`, and `all_subscription_ids` attributes [GH-16208] +* `azurerm_active_directory_domain_service` - support for the `kerberos_armoring_enabled` and `kerberos_rc4_encryption_enabled` properties [GH-17853] +* `azurerm_automation_account` - support for the `private_endpoint_connection` property [GH-17934] +* `azurerm_automation_account` - support for the `encryption` block and `local_authentication_enabled` property [GH-17454] +* `azurerm_batch_pool` - support for identity referencees in container registries [GH-17416] +* `azurerm_data_factory_integration_runtime_azure_ssis` - support for the `express_vnet_injection` property [GH-17756] +* `azurerm_firewall_policy_resource` - support for the `private_ranges` and `allow_sql_redirect` properties [GH-17842] * `azurerm_key_vault` - support for the `public_network_access_enabled` property [GH-17552] +* `azurerm_linux_virtual_machine` - now supports delete Eviction policies [GH-17226] +* `azurerm_linux_virtual_machine_scale_set` - now supports delete Eviction policies [GH-17226] * `azurerm_mssql_elastic_pool` - support for the `maintenance_configuration_name` property [GH-17790] +* `azurerm_mssql_server` - support `Disabled` for the `minimum_tls_version` property [GH-16595] +* `azurerm_shared_image` - support for the `architecture` property [GH-17250] +* `azurerm_storage_account` - support for the `default_to_oauth_authentication` property [GH-17116] +* `azurerm_shared_image_version` - support for `blob_uri` and `storage_account_id` [GH-17768] +* `azurerm_windows_virtual_machine` - now supports delete Eviction policies [GH-17226] +* `azurerm_windows_virtual_machine_scale_set` - now supports delete Eviction policies [GH-17226] +* +Allow Delete eviction policy on Azure VMs #17226 BUG FIXES: diff --git a/go.mod b/go.mod index ab5a369f88e2b..1cb67959156fd 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/gofrs/uuid v4.0.0+incompatible github.com/google/go-cmp v0.5.8 github.com/google/uuid v1.1.2 - github.com/hashicorp/go-azure-helpers v0.37.0 - github.com/hashicorp/go-azure-sdk v0.20220809.1122626 + github.com/hashicorp/go-azure-helpers v0.39.0 + github.com/hashicorp/go-azure-sdk v0.20220815.1092453 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.6.0 diff --git a/go.sum b/go.sum index 4a273c2b844cb..0715758de659d 100644 --- a/go.sum +++ b/go.sum @@ -214,10 +214,10 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= -github.com/hashicorp/go-azure-helpers v0.37.0 h1:6UOoQ9esE4MJ4wHJr21qU81IJQ9zsXQ9FbANYUbeE4U= -github.com/hashicorp/go-azure-helpers v0.37.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw= -github.com/hashicorp/go-azure-sdk v0.20220809.1122626 h1:HEl1iGprDRxZyqsIrfCYKZhDHF2rt4djYy2pyi/glmM= -github.com/hashicorp/go-azure-sdk v0.20220809.1122626/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo= +github.com/hashicorp/go-azure-helpers v0.39.0 h1:gwA0bM5y72/zN5qRuqFue6qgTVP3+gRSlX6k8KCmkGo= +github.com/hashicorp/go-azure-helpers v0.39.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw= +github.com/hashicorp/go-azure-sdk v0.20220815.1092453 h1:MfhuaqchMELBWNWmkJWnQHDF9wRQVf2VyL1gwaR90aI= +github.com/hashicorp/go-azure-sdk v0.20220815.1092453/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 611f97cdf7e74..17323b9ce3870 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -76,7 +76,15 @@ func TestResourcesSupportCustomTimeouts(t *testing.T) { if resource.Timeouts.Read == nil { t.Fatalf("Resource %q doesn't define a Read timeout", resourceName) } else if *resource.Timeouts.Read > 5*time.Minute { - t.Fatalf("Read timeouts shouldn't be more than 5 minutes, this indicates a bug which needs to be fixed") + exceptionResources := map[string]bool{ + // The key vault item resources have longer read timeout for mitigating issue: https://github.com/hashicorp/terraform-provider-azurerm/issues/11059. + "azurerm_key_vault_key": true, + "azurerm_key_vault_secret": true, + "azurerm_key_vault_certificate": true, + } + if !exceptionResources[resourceName] { + t.Fatalf("Read timeouts shouldn't be more than 5 minutes, this indicates a bug which needs to be fixed") + } } // Optional diff --git a/internal/services/applicationinsights/application_insights_workbook_resource.go b/internal/services/applicationinsights/application_insights_workbook_resource.go index d24f128923ac8..51fbb666fc4be 100644 --- a/internal/services/applicationinsights/application_insights_workbook_resource.go +++ b/internal/services/applicationinsights/application_insights_workbook_resource.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights" + workbooks "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -43,7 +43,7 @@ func (r ApplicationInsightsWorkbookResource) ModelObject() interface{} { } func (r ApplicationInsightsWorkbookResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return applicationinsights.ValidateWorkbookID + return workbooks.ValidateWorkbookID } func (r ApplicationInsightsWorkbookResource) Arguments() map[string]*pluginsdk.Schema { @@ -133,8 +133,8 @@ func (r ApplicationInsightsWorkbookResource) Create() sdk.ResourceFunc { client := metadata.Client.AppInsights.WorkbookClient subscriptionId := metadata.Client.Account.SubscriptionId - id := applicationinsights.NewWorkbookID(subscriptionId, model.ResourceGroupName, model.Name) - existing, err := client.WorkbooksGet(ctx, id, applicationinsights.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) + id := workbooks.NewWorkbookID(subscriptionId, model.ResourceGroupName, model.Name) + existing, err := client.WorkbooksGet(ctx, id, workbooks.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) if err != nil && !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for existing %s: %+v", id, err) } @@ -148,12 +148,12 @@ func (r ApplicationInsightsWorkbookResource) Create() sdk.ResourceFunc { return fmt.Errorf("expanding `identity`: %+v", err) } - kindValue := applicationinsights.WorkbookSharedTypeKindShared - properties := &applicationinsights.Workbook{ + kindValue := workbooks.WorkbookSharedTypeKindShared + properties := &workbooks.Workbook{ Identity: identityValue, Kind: &kindValue, Location: utils.String(location.Normalize(model.Location)), - Properties: &applicationinsights.WorkbookProperties{ + Properties: &workbooks.WorkbookProperties{ Category: model.Category, DisplayName: model.DisplayName, SerializedData: model.DataJson, @@ -171,7 +171,7 @@ func (r ApplicationInsightsWorkbookResource) Create() sdk.ResourceFunc { properties.Properties.StorageUri = &model.StorageContainerId } - if _, err := client.WorkbooksCreateOrUpdate(ctx, id, *properties, applicationinsights.WorkbooksCreateOrUpdateOperationOptions{SourceId: &model.SourceId}); err != nil { + if _, err := client.WorkbooksCreateOrUpdate(ctx, id, *properties, workbooks.WorkbooksCreateOrUpdateOperationOptions{SourceId: &model.SourceId}); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } @@ -187,7 +187,7 @@ func (r ApplicationInsightsWorkbookResource) Update() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.AppInsights.WorkbookClient - id, err := applicationinsights.ParseWorkbookID(metadata.ResourceData.Id()) + id, err := workbooks.ParseWorkbookID(metadata.ResourceData.Id()) if err != nil { return err } @@ -197,7 +197,7 @@ func (r ApplicationInsightsWorkbookResource) Update() sdk.ResourceFunc { return fmt.Errorf("decoding: %+v", err) } - resp, err := client.WorkbooksGet(ctx, *id, applicationinsights.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) + resp, err := client.WorkbooksGet(ctx, *id, workbooks.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) if err != nil { return fmt.Errorf("retrieving %s: %+v", *id, err) } @@ -227,7 +227,7 @@ func (r ApplicationInsightsWorkbookResource) Update() sdk.ResourceFunc { properties.Tags = &model.Tags } - if _, err := client.WorkbooksCreateOrUpdate(ctx, *id, *properties, applicationinsights.WorkbooksCreateOrUpdateOperationOptions{SourceId: &model.SourceId}); err != nil { + if _, err := client.WorkbooksCreateOrUpdate(ctx, *id, *properties, workbooks.WorkbooksCreateOrUpdateOperationOptions{SourceId: &model.SourceId}); err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } @@ -242,12 +242,12 @@ func (r ApplicationInsightsWorkbookResource) Read() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.AppInsights.WorkbookClient - id, err := applicationinsights.ParseWorkbookID(metadata.ResourceData.Id()) + id, err := workbooks.ParseWorkbookID(metadata.ResourceData.Id()) if err != nil { return err } - resp, err := client.WorkbooksGet(ctx, *id, applicationinsights.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) + resp, err := client.WorkbooksGet(ctx, *id, workbooks.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) if err != nil { if response.WasNotFound(resp.HttpResponse) { return metadata.MarkAsGone(id) @@ -316,7 +316,7 @@ func (r ApplicationInsightsWorkbookResource) Delete() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.AppInsights.WorkbookClient - id, err := applicationinsights.ParseWorkbookID(metadata.ResourceData.Id()) + id, err := workbooks.ParseWorkbookID(metadata.ResourceData.Id()) if err != nil { return err } diff --git a/internal/services/applicationinsights/application_insights_workbook_resource_test.go b/internal/services/applicationinsights/application_insights_workbook_resource_test.go index 7bd34b181abc8..dab1fdc98ea3d 100644 --- a/internal/services/applicationinsights/application_insights_workbook_resource_test.go +++ b/internal/services/applicationinsights/application_insights_workbook_resource_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights" + workbooks "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -92,13 +92,13 @@ func TestAccApplicationInsightsWorkbook_hiddenTitleInTags(t *testing.T) { } func (r ApplicationInsightsWorkbookResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := applicationinsights.ParseWorkbookID(state.ID) + id, err := workbooks.ParseWorkbookID(state.ID) if err != nil { return nil, err } client := clients.AppInsights.WorkbookClient - resp, err := client.WorkbooksGet(ctx, *id, applicationinsights.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) + resp, err := client.WorkbooksGet(ctx, *id, workbooks.WorkbooksGetOperationOptions{CanFetchContent: utils.Bool(true)}) if err != nil { if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil diff --git a/internal/services/applicationinsights/application_insights_workbook_template_resource.go b/internal/services/applicationinsights/application_insights_workbook_template_resource.go index d984bd50a1cc8..881d0254e2cb0 100644 --- a/internal/services/applicationinsights/application_insights_workbook_template_resource.go +++ b/internal/services/applicationinsights/application_insights_workbook_template_resource.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights" + workbooktemplates "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -49,7 +49,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) ModelObject() interface{} { } func (r ApplicationInsightsWorkbookTemplateResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return applicationinsights.ValidateWorkbookTemplateID + return workbooktemplates.ValidateWorkbookTemplateID } func (r ApplicationInsightsWorkbookTemplateResource) Arguments() map[string]*pluginsdk.Schema { @@ -150,7 +150,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Create() sdk.ResourceFunc { client := metadata.Client.AppInsights.WorkbookTemplateClient subscriptionId := metadata.Client.Account.SubscriptionId - id := applicationinsights.NewWorkbookTemplateID(subscriptionId, model.ResourceGroupName, model.Name) + id := workbooktemplates.NewWorkbookTemplateID(subscriptionId, model.ResourceGroupName, model.Name) existing, err := client.WorkbookTemplatesGet(ctx, id) if err != nil && !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for existing %s: %+v", id, err) @@ -166,9 +166,9 @@ func (r ApplicationInsightsWorkbookTemplateResource) Create() sdk.ResourceFunc { return err } - properties := &applicationinsights.WorkbookTemplate{ + properties := &workbooktemplates.WorkbookTemplate{ Location: location.Normalize(model.Location), - Properties: &applicationinsights.WorkbookTemplateProperties{ + Properties: &workbooktemplates.WorkbookTemplateProperties{ Priority: &model.Priority, TemplateData: templateDataValue, }, @@ -181,7 +181,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Create() sdk.ResourceFunc { } if model.Localized != "" { - var localizedValue map[string][]applicationinsights.WorkbookTemplateLocalizedGallery + var localizedValue map[string][]workbooktemplates.WorkbookTemplateLocalizedGallery if err := json.Unmarshal([]byte(model.Localized), &localizedValue); err != nil { return err } @@ -214,7 +214,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Update() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.AppInsights.WorkbookTemplateClient - id, err := applicationinsights.ParseWorkbookTemplateID(metadata.ResourceData.Id()) + id, err := workbooktemplates.ParseWorkbookTemplateID(metadata.ResourceData.Id()) if err != nil { return err } @@ -264,7 +264,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Update() sdk.ResourceFunc { } if metadata.ResourceData.HasChange("localized") { - var localizedValue map[string][]applicationinsights.WorkbookTemplateLocalizedGallery + var localizedValue map[string][]workbooktemplates.WorkbookTemplateLocalizedGallery if err := json.Unmarshal([]byte(model.Localized), &localizedValue); err != nil { return err } @@ -291,7 +291,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Read() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.AppInsights.WorkbookTemplateClient - id, err := applicationinsights.ParseWorkbookTemplateID(metadata.ResourceData.Id()) + id, err := workbooktemplates.ParseWorkbookTemplateID(metadata.ResourceData.Id()) if err != nil { return err } @@ -366,7 +366,7 @@ func (r ApplicationInsightsWorkbookTemplateResource) Delete() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.AppInsights.WorkbookTemplateClient - id, err := applicationinsights.ParseWorkbookTemplateID(metadata.ResourceData.Id()) + id, err := workbooktemplates.ParseWorkbookTemplateID(metadata.ResourceData.Id()) if err != nil { return err } @@ -380,10 +380,10 @@ func (r ApplicationInsightsWorkbookTemplateResource) Delete() sdk.ResourceFunc { } } -func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel) (*[]applicationinsights.WorkbookTemplateGallery, error) { - var outputList []applicationinsights.WorkbookTemplateGallery +func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel) (*[]workbooktemplates.WorkbookTemplateGallery, error) { + var outputList []workbooktemplates.WorkbookTemplateGallery for _, input := range inputList { - output := applicationinsights.WorkbookTemplateGallery{ + output := workbooktemplates.WorkbookTemplateGallery{ Category: utils.String(input.Category), Name: utils.String(input.Name), Order: utils.Int64(input.Order), @@ -397,7 +397,7 @@ func expandWorkbookTemplateGalleryModel(inputList []WorkbookTemplateGalleryModel return &outputList, nil } -func flattenWorkbookTemplateGalleryModel(inputList *[]applicationinsights.WorkbookTemplateGallery) ([]WorkbookTemplateGalleryModel, error) { +func flattenWorkbookTemplateGalleryModel(inputList *[]workbooktemplates.WorkbookTemplateGallery) ([]WorkbookTemplateGalleryModel, error) { var outputList []WorkbookTemplateGalleryModel if inputList == nil { return outputList, nil diff --git a/internal/services/applicationinsights/application_insights_workbook_template_resource_test.go b/internal/services/applicationinsights/application_insights_workbook_template_resource_test.go index 64fef725c218a..610f9aec96c47 100644 --- a/internal/services/applicationinsights/application_insights_workbook_template_resource_test.go +++ b/internal/services/applicationinsights/application_insights_workbook_template_resource_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights" + workbooktemplates "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -80,7 +80,7 @@ func TestAccApplicationInsightsWorkbookTemplate_update(t *testing.T) { } func (r ApplicationInsightsWorkbookTemplateResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := applicationinsights.ParseWorkbookTemplateID(state.ID) + id, err := workbooktemplates.ParseWorkbookTemplateID(state.ID) if err != nil { return nil, err } diff --git a/internal/services/applicationinsights/client/client.go b/internal/services/applicationinsights/client/client.go index e0f0e2fb5fc5d..0746f0d7e629f 100644 --- a/internal/services/applicationinsights/client/client.go +++ b/internal/services/applicationinsights/client/client.go @@ -2,8 +2,8 @@ package client import ( "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights" - workbookTemplate "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights" - workbook "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights" + workbooktemplates "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis" + workbooks "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis" "github.com/hashicorp/terraform-provider-azurerm/internal/common" "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights/azuresdkhacks" ) @@ -15,8 +15,8 @@ type Client struct { WebTestsClient *azuresdkhacks.WebTestsClient BillingClient *insights.ComponentCurrentBillingFeaturesClient SmartDetectionRuleClient *insights.ProactiveDetectionConfigurationsClient - WorkbookClient *workbook.ApplicationInsightsClient - WorkbookTemplateClient *workbookTemplate.ApplicationInsightsClient + WorkbookClient *workbooks.WorkbooksAPIsClient + WorkbookTemplateClient *workbooktemplates.WorkbookTemplatesAPIsClient } func NewClient(o *common.ClientOptions) *Client { @@ -39,10 +39,10 @@ func NewClient(o *common.ClientOptions) *Client { smartDetectionRuleClient := insights.NewProactiveDetectionConfigurationsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&smartDetectionRuleClient.Client, o.ResourceManagerAuthorizer) - workbookClient := workbook.NewApplicationInsightsClientWithBaseURI(o.ResourceManagerEndpoint) + workbookClient := workbooks.NewWorkbooksAPIsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&workbookClient.Client, o.ResourceManagerAuthorizer) - workbookTemplateClient := workbookTemplate.NewApplicationInsightsClientWithBaseURI(o.ResourceManagerEndpoint) + workbookTemplateClient := workbooktemplates.NewWorkbookTemplatesAPIsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&workbookTemplateClient.Client, o.ResourceManagerAuthorizer) return &Client{ diff --git a/internal/services/appservice/linux_function_app_data_source.go b/internal/services/appservice/linux_function_app_data_source.go index 5e9ca2939045a..5bc87d017455e 100644 --- a/internal/services/appservice/linux_function_app_data_source.go +++ b/internal/services/appservice/linux_function_app_data_source.go @@ -315,6 +315,16 @@ func (d LinuxFunctionAppDataSource) Read() sdk.ResourceFunc { DefaultHostname: utils.NormalizeNilableString(functionApp.DefaultHostName), } + if v := props.OutboundIPAddresses; v != nil { + state.OutboundIPAddresses = *v + state.OutboundIPAddressList = strings.Split(*v, ",") + } + + if v := props.PossibleOutboundIPAddresses; v != nil { + state.PossibleOutboundIPAddresses = *v + state.PossibleOutboundIPAddressList = strings.Split(*v, ",") + } + configResp, err := client.GetConfiguration(ctx, id.ResourceGroup, id.SiteName) if err != nil { return fmt.Errorf("making Read request on AzureRM Function App Configuration %q: %+v", id.SiteName, err) diff --git a/internal/services/appservice/linux_function_app_data_source_test.go b/internal/services/appservice/linux_function_app_data_source_test.go index aa29c992a8419..6a751da770630 100644 --- a/internal/services/appservice/linux_function_app_data_source_test.go +++ b/internal/services/appservice/linux_function_app_data_source_test.go @@ -2,6 +2,7 @@ package appservice_test import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -14,11 +15,17 @@ func TestAccLinuxFunctionAppDataSource_standardComplete(t *testing.T) { data := acceptance.BuildTestData(t, "data.azurerm_linux_function_app", "test") d := LinuxFunctionAppDataSource{} + ipListRegex := regexp.MustCompile(`(([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(,){0,1})+`) + data.DataSourceTest(t, []acceptance.TestStep{ { Config: d.standardComplete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).Key("location").HasValue(data.Locations.Primary), + check.That(data.ResourceName).Key("outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("outbound_ip_address_list.#").Exists(), + check.That(data.ResourceName).Key("possible_outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("possible_outbound_ip_address_list.#").Exists(), check.That(data.ResourceName).Key("default_hostname").HasValue(fmt.Sprintf("acctest-lfa-%d.azurewebsites.net", data.RandomInteger)), ), }, diff --git a/internal/services/appservice/linux_function_app_resource.go b/internal/services/appservice/linux_function_app_resource.go index 3712827bc6259..68e2e452ce18d 100644 --- a/internal/services/appservice/linux_function_app_resource.go +++ b/internal/services/appservice/linux_function_app_resource.go @@ -607,6 +607,16 @@ func (r LinuxFunctionAppResource) Read() sdk.ResourceFunc { DefaultHostname: utils.NormalizeNilableString(props.DefaultHostName), } + if v := props.OutboundIPAddresses; v != nil { + state.OutboundIPAddresses = *v + state.OutboundIPAddressList = strings.Split(*v, ",") + } + + if v := props.PossibleOutboundIPAddresses; v != nil { + state.PossibleOutboundIPAddresses = *v + state.PossibleOutboundIPAddressList = strings.Split(*v, ",") + } + configResp, err := client.GetConfiguration(ctx, id.ResourceGroup, id.SiteName) if err != nil { return fmt.Errorf("making Read request on AzureRM Function App Configuration %q: %+v", id.SiteName, err) diff --git a/internal/services/appservice/linux_function_app_resource_test.go b/internal/services/appservice/linux_function_app_resource_test.go index 34c72836d84d2..4a88e25615f5e 100644 --- a/internal/services/appservice/linux_function_app_resource_test.go +++ b/internal/services/appservice/linux_function_app_resource_test.go @@ -1265,6 +1265,30 @@ func TestAccLinuxFunctionApp_vNetIntegrationUpdate(t *testing.T) { }) } +// Outputs + +func TestAccLinuxFunctionApp_basicOutputs(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_linux_function_app", "test") + r := LinuxFunctionAppResource{} + + ipListRegex := regexp.MustCompile(`(([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(,){0,1})+`) + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data, SkuStandardPlan), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("outbound_ip_address_list.#").Exists(), + check.That(data.ResourceName).Key("possible_outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("possible_outbound_ip_address_list.#").Exists(), + check.That(data.ResourceName).Key("default_hostname").MatchesRegex(regexp.MustCompile(`(.)+`)), + ), + }, + data.ImportStep(), + }) +} + // Configs func (r LinuxFunctionAppResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { diff --git a/internal/services/appservice/windows_function_app_data_source.go b/internal/services/appservice/windows_function_app_data_source.go index 0b0d7cfa6a4eb..88eaf7125e64e 100644 --- a/internal/services/appservice/windows_function_app_data_source.go +++ b/internal/services/appservice/windows_function_app_data_source.go @@ -265,6 +265,16 @@ func (d WindowsFunctionAppDataSource) Read() sdk.ResourceFunc { functionApp.DefaultHostname = utils.NormalizeNilableString(props.DefaultHostName) functionApp.VirtualNetworkSubnetId = utils.NormalizeNilableString(props.VirtualNetworkSubnetID) + if v := props.OutboundIPAddresses; v != nil { + functionApp.OutboundIPAddresses = *v + functionApp.OutboundIPAddressList = strings.Split(*v, ",") + } + + if v := props.PossibleOutboundIPAddresses; v != nil { + functionApp.PossibleOutboundIPAddresses = *v + functionApp.PossibleOutboundIPAddressList = strings.Split(*v, ",") + } + appSettingsResp, err := client.ListApplicationSettings(ctx, id.ResourceGroup, id.SiteName) if err != nil { return fmt.Errorf("reading App Settings for Windows %s: %+v", id, err) diff --git a/internal/services/appservice/windows_function_app_data_source_test.go b/internal/services/appservice/windows_function_app_data_source_test.go index b8ab54af01158..c14b492143a87 100644 --- a/internal/services/appservice/windows_function_app_data_source_test.go +++ b/internal/services/appservice/windows_function_app_data_source_test.go @@ -2,6 +2,7 @@ package appservice_test import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -14,11 +15,17 @@ func TestAccWindowsFunctionAppDataSource_complete(t *testing.T) { data := acceptance.BuildTestData(t, "data.azurerm_windows_function_app", "test") d := WindowsFunctionAppDataSource{} + ipListRegex := regexp.MustCompile(`(([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(,){0,1})+`) + data.DataSourceTest(t, []acceptance.TestStep{ { Config: d.complete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).Key("location").HasValue(data.Locations.Primary), + check.That(data.ResourceName).Key("outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("outbound_ip_address_list.#").Exists(), + check.That(data.ResourceName).Key("possible_outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("possible_outbound_ip_address_list.#").Exists(), check.That(data.ResourceName).Key("default_hostname").HasValue(fmt.Sprintf("acctest-wfa-%d.azurewebsites.net", data.RandomInteger)), ), }, diff --git a/internal/services/appservice/windows_function_app_resource.go b/internal/services/appservice/windows_function_app_resource.go index c6134969b78b6..8cae6da6f7607 100644 --- a/internal/services/appservice/windows_function_app_resource.go +++ b/internal/services/appservice/windows_function_app_resource.go @@ -605,6 +605,16 @@ func (r WindowsFunctionAppResource) Read() sdk.ResourceFunc { DefaultHostname: utils.NormalizeNilableString(props.DefaultHostName), } + if v := props.OutboundIPAddresses; v != nil { + state.OutboundIPAddresses = *v + state.OutboundIPAddressList = strings.Split(*v, ",") + } + + if v := props.PossibleOutboundIPAddresses; v != nil { + state.PossibleOutboundIPAddresses = *v + state.PossibleOutboundIPAddressList = strings.Split(*v, ",") + } + configResp, err := client.GetConfiguration(ctx, id.ResourceGroup, id.SiteName) if err != nil { return fmt.Errorf("making Read request on AzureRM Function App Configuration %q: %+v", id.SiteName, err) diff --git a/internal/services/appservice/windows_function_app_resource_test.go b/internal/services/appservice/windows_function_app_resource_test.go index 89e172bac3893..f43a3f60cdfe9 100644 --- a/internal/services/appservice/windows_function_app_resource_test.go +++ b/internal/services/appservice/windows_function_app_resource_test.go @@ -3,6 +3,7 @@ package appservice_test import ( "context" "fmt" + "regexp" "strings" "testing" @@ -1116,6 +1117,30 @@ func TestAccWindowsFunctionApp_vNetIntegrationUpdate(t *testing.T) { }) } +// Outputs + +func TestAccWindowsFunctionApp_basicOutputs(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test") + r := WindowsFunctionAppResource{} + + ipListRegex := regexp.MustCompile(`(([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(,){0,1})+`) + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data, SkuStandardPlan), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("outbound_ip_address_list.#").Exists(), + check.That(data.ResourceName).Key("possible_outbound_ip_addresses").MatchesRegex(ipListRegex), + check.That(data.ResourceName).Key("possible_outbound_ip_address_list.#").Exists(), + check.That(data.ResourceName).Key("default_hostname").MatchesRegex(regexp.MustCompile(`(.)+`)), + ), + }, + data.ImportStep(), + }) +} + // Exists func (r WindowsFunctionAppResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { diff --git a/internal/services/automation/automation_account_data_source.go b/internal/services/automation/automation_account_data_source.go index 3b696456ddb1d..6e5ef6c19e2f0 100644 --- a/internal/services/automation/automation_account_data_source.go +++ b/internal/services/automation/automation_account_data_source.go @@ -41,6 +41,22 @@ func dataSourceAutomationAccount() *pluginsdk.Resource { Type: pluginsdk.TypeString, Computed: true, }, + "private_endpoint_connection": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, }, } } @@ -76,5 +92,21 @@ func dataSourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{} d.Set("secondary_key", iresp.Keys.Secondary) } d.Set("endpoint", iresp.Endpoint) + if resp.Model != nil && resp.Model.Properties != nil { + d.Set("private_endpoint_connection", flattenPrivateEndpointConnections(resp.Model.Properties.PrivateEndpointConnections)) + } return nil } + +func flattenPrivateEndpointConnections(conns *[]automationaccount.PrivateEndpointConnection) (res []interface{}) { + if conns == nil || len(*conns) == 0 { + return + } + for _, con := range *conns { + res = append(res, map[string]interface{}{ + "id": con.Id, + "name": con.Name, + }) + } + return res +} diff --git a/internal/services/automation/automation_account_resource.go b/internal/services/automation/automation_account_resource.go index 7f300f2f5a4ef..21483628e3555 100644 --- a/internal/services/automation/automation_account_resource.go +++ b/internal/services/automation/automation_account_resource.go @@ -6,13 +6,17 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate" + keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse" + keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -58,6 +62,43 @@ func resourceAutomationAccount() *pluginsdk.Resource { "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), + "encryption": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*schema.Schema{ + "user_assigned_identity_id": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: commonids.ValidateUserAssignedIdentityID, + }, + + "key_source": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice( + automationaccount.PossibleValuesForEncryptionKeySourceType(), + false, + ), + }, + + "key_vault_key_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: keyVaultValidate.NestedItemIdWithOptionalVersion, + }, + }, + }, + }, + + "local_authentication_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: true, + }, + "tags": tags.Schema(), "dsc_server_endpoint": { @@ -79,6 +120,22 @@ func resourceAutomationAccount() *pluginsdk.Resource { Optional: true, Default: true, }, + "private_endpoint_connection": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, }, } } @@ -114,6 +171,17 @@ func resourceAutomationAccountCreate(d *pluginsdk.ResourceData, meta interface{} }, Location: utils.String(location.Normalize(d.Get("location").(string))), } + + if localAuth := d.Get("local_authentication_enabled").(bool); localAuth == false { + parameters.Properties.DisableLocalAuth = utils.Bool(true) + } + if encryption := d.Get("encryption").([]interface{}); len(encryption) > 0 { + enc, err := expandEncryption(encryption[0].(map[string]interface{})) + if err != nil { + return fmt.Errorf("expanding `encryption`: %v", err) + } + parameters.Properties.Encryption = enc + } // for create account do not set identity property (even TypeNone is not allowed), or api will response error if identityVal.Type != identity.TypeNone { parameters.Identity = identityVal @@ -154,6 +222,18 @@ func resourceAutomationAccountUpdate(d *pluginsdk.ResourceData, meta interface{} Identity: identity, } + if localAuth := d.Get("local_authentication_enabled").(bool); localAuth == false { + parameters.Properties.DisableLocalAuth = utils.Bool(true) + } + + if encryption := d.Get("encryption").([]interface{}); len(encryption) > 0 { + enc, err := expandEncryption(encryption[0].(map[string]interface{})) + if err != nil { + return fmt.Errorf("expanding `encryption`: %v", err) + } + parameters.Properties.Encryption = enc + } + if tagsVal := expandTags(d.Get("tags").(map[string]interface{})); tagsVal != nil { parameters.Tags = &tagsVal } @@ -217,6 +297,16 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) } d.Set("sku_name", skuName) + localAuthEnabled := true + if val := prop.DisableLocalAuth; val != nil && *val == true { + localAuthEnabled = false + } + d.Set("local_authentication_enabled", localAuthEnabled) + + if err := d.Set("encryption", flattenEncryption(prop.Encryption)); err != nil { + return fmt.Errorf("setting `encryption`: %+v", err) + } + d.Set("dsc_server_endpoint", keysResp.Endpoint) if keys := keysResp.Keys; keys != nil { d.Set("dsc_primary_access_key", keys.Primary) @@ -231,6 +321,10 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) return fmt.Errorf("setting `identity`: %+v", err) } + if resp.Model != nil && resp.Model.Properties != nil { + d.Set("private_endpoint_connection", flattenPrivateEndpointConnections(resp.Model.Properties.PrivateEndpointConnections)) + } + if resp.Model.Tags != nil { return flattenAndSetTags(d, *resp.Model.Tags) } @@ -258,3 +352,51 @@ func resourceAutomationAccountDelete(d *pluginsdk.ResourceData, meta interface{} return nil } + +func expandEncryption(encMap map[string]interface{}) (*automationaccount.EncryptionProperties, error) { + var id interface{} + id, ok := encMap["user_assigned_identity_id"].(string) + if !ok { + return nil, fmt.Errorf("read encryption user identity id error") + } + prop := &automationaccount.EncryptionProperties{ + Identity: &automationaccount.EncryptionPropertiesIdentity{ + UserAssignedIdentity: &id, + }, + } + if val, ok := encMap["key_source"].(string); ok && val != "" { + prop.KeySource = (*automationaccount.EncryptionKeySourceType)(&val) + } + if keyIdStr := encMap["key_vault_key_id"].(string); keyIdStr != "" { + keyId, err := keyVaultParse.ParseOptionallyVersionedNestedItemID(keyIdStr) + if err != nil { + return nil, err + } + prop.KeyVaultProperties = &automationaccount.KeyVaultProperties{ + KeyName: utils.String(keyId.Name), + KeyVersion: utils.String(keyId.Version), + KeyvaultUri: utils.String(keyId.KeyVaultBaseUrl), + } + } + return prop, nil +} + +func flattenEncryption(encryption *automationaccount.EncryptionProperties) (res []interface{}) { + if encryption == nil { + return + } + item := map[string]interface{}{} + if encryption.KeySource != nil { + item["key_source"] = (string)(*encryption.KeySource) + } + if encryption.Identity != nil && encryption.Identity.UserAssignedIdentity != nil { + item["user_assigned_identity_id"] = (*encryption.Identity.UserAssignedIdentity).(string) + } + if keyProp := encryption.KeyVaultProperties; keyProp != nil { + keyVaultKeyId, err := keyVaultParse.NewNestedItemID(*keyProp.KeyvaultUri, "keys", *keyProp.KeyName, *keyProp.KeyVersion) + if err == nil { + item["key_vault_key_id"] = keyVaultKeyId.ID() + } + } + return []interface{}{item} +} diff --git a/internal/services/automation/automation_account_resource_test.go b/internal/services/automation/automation_account_resource_test.go index 7a71212ace810..bbf395aefcebc 100644 --- a/internal/services/automation/automation_account_resource_test.go +++ b/internal/services/automation/automation_account_resource_test.go @@ -70,6 +70,24 @@ func TestAccAutomationAccount_complete(t *testing.T) { }) } +func TestAccAutomationAccount_encryption(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_automation_account", "test") + r := AutomationAccountResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.encryption(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("sku_name").HasValue("Basic"), + check.That(data.ResourceName).Key("local_authentication_enabled").HasValue("false"), + check.That(data.ResourceName).Key("encryption.0.key_source").HasValue("Microsoft.Keyvault"), + ), + }, + data.ImportStep(), + }) +} + func TestAccAutomationAccount_identityUpdate(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_automation_account", "test") r := AutomationAccountResource{} @@ -257,6 +275,123 @@ resource "azurerm_automation_account" "test" { `, data.RandomInteger, data.Locations.Primary) } +func (AutomationAccountResource) encryption(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features { + key_vault { + purge_soft_delete_on_destroy = false + purge_soft_deleted_keys_on_destroy = false + } + } +} + +data "azurerm_client_config" "current" { +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-auto-%[1]d" + location = "%[2]s" +} + +resource "azurerm_user_assigned_identity" "test" { + name = "acctestUAI-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_key_vault" "test" { + name = "vault%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + tenant_id = data.azurerm_client_config.current.tenant_id + sku_name = "standard" + soft_delete_retention_days = 7 + purge_protection_enabled = true + + access_policy { + tenant_id = data.azurerm_client_config.current.tenant_id + object_id = data.azurerm_client_config.current.object_id + + certificate_permissions = [ + "ManageContacts", + ] + + key_permissions = [ + "Create", + "Get", + "List", + "Delete", + "Purge", + ] + + secret_permissions = [ + "Set", + ] + } + + access_policy { + tenant_id = azurerm_user_assigned_identity.test.tenant_id + object_id = azurerm_user_assigned_identity.test.principal_id + + certificate_permissions = [] + + key_permissions = [ + "Get", + "Recover", + "WrapKey", + "UnwrapKey", + ] + + secret_permissions = [] + } +} + +data "azurerm_key_vault" "test" { + name = azurerm_key_vault.test.name + resource_group_name = azurerm_key_vault.test.resource_group_name +} + +resource "azurerm_key_vault_key" "test" { + name = "acckvkey-%[1]d" + key_vault_id = azurerm_key_vault.test.id + key_type = "RSA" + key_size = 2048 + + key_opts = [ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ] +} + +resource "azurerm_automation_account" "test" { + name = "acctest-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "Basic" + + identity { + type = "UserAssigned" + identity_ids = [ + azurerm_user_assigned_identity.test.id + ] + } + + local_authentication_enabled = false + + encryption { + key_source = "Microsoft.Keyvault" + user_assigned_identity_id = azurerm_user_assigned_identity.test.id + key_vault_key_id = azurerm_key_vault_key.test.id + } +} +`, data.RandomInteger, data.Locations.Primary) +} + func (AutomationAccountResource) userAssignedIdentity(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/batch/batch_pool.go b/internal/services/batch/batch_pool.go index 85faf6ee25e11..f4b9784d5973a 100644 --- a/internal/services/batch/batch_pool.go +++ b/internal/services/batch/batch_pool.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -252,15 +253,13 @@ func flattenBatchPoolContainerRegistry(d *pluginsdk.ResourceData, armContainerRe } if userName := armContainerRegistry.UserName; userName != nil { result["user_name"] = *userName + // Locate the password only if user_name is defined + result["password"] = findBatchPoolContainerRegistryPassword(d, result["registry_server"].(string), result["user_name"].(string)) } - - // If we didn't specify a registry server and user name, just return what we have now rather than trying to locate the password - if len(result) != 2 { - return result + if identity := armContainerRegistry.IdentityReference; identity != nil { + result["user_assigned_identity_id"] = identity.ResourceID } - result["password"] = findBatchPoolContainerRegistryPassword(d, result["registry_server"].(string), result["user_name"].(string)) - return result } @@ -363,11 +362,23 @@ func expandBatchPoolContainerRegistry(ref map[string]interface{}) (*batch.Contai return nil, fmt.Errorf("Error: container registry reference should be defined") } - containerRegistry := batch.ContainerRegistry{ - RegistryServer: utils.String(ref["registry_server"].(string)), - UserName: utils.String(ref["user_name"].(string)), - Password: utils.String(ref["password"].(string)), + containerRegistry := batch.ContainerRegistry{} + + if v := ref["registry_server"]; v != nil && v != "" { + containerRegistry.RegistryServer = pointer.FromString(v.(string)) + } + if v := ref["user_name"]; v != nil && v != "" { + containerRegistry.UserName = pointer.FromString(v.(string)) } + if v := ref["password"]; v != nil && v != "" { + containerRegistry.Password = pointer.FromString(v.(string)) + } + if v := ref["user_assigned_identity_id"]; v != nil && v != "" { + containerRegistry.IdentityReference = &batch.ComputeNodeIdentityReference{ + ResourceID: pointer.FromString(v.(string)), + } + } + return &containerRegistry, nil } diff --git a/internal/services/batch/batch_pool_data_source.go b/internal/services/batch/batch_pool_data_source.go index 35f859e26c07a..a72e7eba48515 100644 --- a/internal/services/batch/batch_pool_data_source.go +++ b/internal/services/batch/batch_pool_data_source.go @@ -144,6 +144,10 @@ func dataSourceBatchPool() *pluginsdk.Resource { Type: pluginsdk.TypeString, Computed: true, }, + "user_assigned_identity_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, "user_name": { Type: pluginsdk.TypeString, Computed: true, diff --git a/internal/services/batch/batch_pool_resource.go b/internal/services/batch/batch_pool_resource.go index 3094dabea0190..fe71ed78677c4 100644 --- a/internal/services/batch/batch_pool_resource.go +++ b/internal/services/batch/batch_pool_resource.go @@ -10,6 +10,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -159,15 +160,22 @@ func resourceBatchPool() *pluginsdk.Resource { ForceNew: true, ValidateFunc: validation.StringIsNotEmpty, }, + "user_assigned_identity_id": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: commonids.ValidateUserAssignedIdentityID, + Description: "The User Assigned Identity to use for Container Registry access.", + }, "user_name": { Type: pluginsdk.TypeString, - Required: true, + Optional: true, ForceNew: true, ValidateFunc: validation.StringIsNotEmpty, }, "password": { Type: pluginsdk.TypeString, - Required: true, + Optional: true, ForceNew: true, Sensitive: true, ValidateFunc: validation.StringIsNotEmpty, diff --git a/internal/services/batch/batch_pool_resource_test.go b/internal/services/batch/batch_pool_resource_test.go index 07b51ccd63f11..e899c43885eda 100644 --- a/internal/services/batch/batch_pool_resource_test.go +++ b/internal/services/batch/batch_pool_resource_test.go @@ -334,13 +334,13 @@ func TestAccBatchPool_validateResourceFileWithoutSource(t *testing.T) { }) } -func TestAccBatchPool_container(t *testing.T) { +func TestAccBatchPool_containerWithUser(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_batch_pool", "test") r := BatchPoolResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.containerConfiguration(data), + Config: r.containerConfigurationWithRegistryUser(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("container_configuration.0.type").HasValue("DockerCompatible"), @@ -349,6 +349,7 @@ func TestAccBatchPool_container(t *testing.T) { check.That(data.ResourceName).Key("container_configuration.0.container_registries.0.registry_server").HasValue("myContainerRegistry.azurecr.io"), check.That(data.ResourceName).Key("container_configuration.0.container_registries.0.user_name").HasValue("myUserName"), check.That(data.ResourceName).Key("container_configuration.0.container_registries.0.password").HasValue("myPassword"), + check.That(data.ResourceName).Key("container_configuration.0.container_registries.0.user_assigned_identity_id").IsEmpty(), ), }, data.ImportStep( @@ -358,6 +359,29 @@ func TestAccBatchPool_container(t *testing.T) { }) } +func TestAccBatchPool_containerWithUAMI(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_batch_pool", "test") + r := BatchPoolResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.containerConfigurationWithRegistryUAMI(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("container_configuration.0.type").HasValue("DockerCompatible"), + check.That(data.ResourceName).Key("container_configuration.0.container_image_names.#").HasValue("1"), + check.That(data.ResourceName).Key("container_configuration.0.container_registries.#").HasValue("1"), + check.That(data.ResourceName).Key("container_configuration.0.container_registries.0.registry_server").HasValue("myContainerRegistry.azurecr.io"), + check.That(data.ResourceName).Key("container_configuration.0.container_registries.0.user_name").IsEmpty(), + check.That(data.ResourceName).Key("container_configuration.0.container_registries.0.user_assigned_identity_id").IsSet(), + ), + }, + data.ImportStep( + "stop_pending_resize_operation", + ), + }) +} + func TestAccBatchPool_validateResourceFileWithMultipleSources(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_batch_pool", "test") r := BatchPoolResource{} @@ -1268,7 +1292,7 @@ resource "azurerm_batch_pool" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomString) } -func (BatchPoolResource) containerConfiguration(data acceptance.TestData) string { +func (BatchPoolResource) containerConfigurationWithRegistryUser(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -1323,6 +1347,73 @@ resource "azurerm_batch_pool" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomString, data.RandomString) } +func (BatchPoolResource) containerConfigurationWithRegistryUAMI(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "testaccbatch%d" + location = "%s" +} + +resource "azurerm_user_assigned_identity" "test" { + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + name = "testaccuami%d" +} + +resource "azurerm_container_registry" "test" { + name = "testregistry%s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + sku = "Basic" + + identity { + type = "UserAssigned" + identity_ids = [ + azurerm_user_assigned_identity.test.id + ] + } +} + +resource "azurerm_batch_account" "test" { + name = "testaccbatch%s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} + +resource "azurerm_batch_pool" "test" { + name = "testaccpool%s" + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_batch_account.test.name + node_agent_sku_id = "batch.node.ubuntu 20.04" + vm_size = "Standard_A1" + + fixed_scale { + target_dedicated_nodes = 1 + } + + storage_image_reference { + publisher = "microsoft-azure-batch" + offer = "ubuntu-server-container" + sku = "20-04-lts" + version = "latest" + } + + container_configuration { + type = "DockerCompatible" + container_image_names = ["centos7"] + container_registries { + registry_server = "myContainerRegistry.azurecr.io" + user_assigned_identity_id = azurerm_user_assigned_identity.test.id + } + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomString, data.RandomString) +} + func (BatchPoolResource) customImageConfiguration(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/compute/client/client.go b/internal/services/compute/client/client.go index 074e7e24e6632..d3cf4358d2d0d 100644 --- a/internal/services/compute/client/client.go +++ b/internal/services/compute/client/client.go @@ -4,6 +4,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute" "github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/sshpublickeys" "github.com/hashicorp/terraform-provider-azurerm/internal/common" @@ -13,8 +15,8 @@ type Client struct { AvailabilitySetsClient *availabilitysets.AvailabilitySetsClient CapacityReservationsClient *compute.CapacityReservationsClient CapacityReservationGroupsClient *compute.CapacityReservationGroupsClient - DedicatedHostsClient *compute.DedicatedHostsClient - DedicatedHostGroupsClient *compute.DedicatedHostGroupsClient + DedicatedHostsClient *dedicatedhosts.DedicatedHostsClient + DedicatedHostGroupsClient *dedicatedhostgroups.DedicatedHostGroupsClient DisksClient *compute.DisksClient DiskAccessClient *compute.DiskAccessesClient DiskEncryptionSetsClient *compute.DiskEncryptionSetsClient @@ -49,10 +51,10 @@ func NewClient(o *common.ClientOptions) *Client { capacityReservationGroupsClient := compute.NewCapacityReservationGroupsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&capacityReservationGroupsClient.Client, o.ResourceManagerAuthorizer) - dedicatedHostsClient := compute.NewDedicatedHostsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + dedicatedHostsClient := dedicatedhosts.NewDedicatedHostsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&dedicatedHostsClient.Client, o.ResourceManagerAuthorizer) - dedicatedHostGroupsClient := compute.NewDedicatedHostGroupsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + dedicatedHostGroupsClient := dedicatedhostgroups.NewDedicatedHostGroupsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&dedicatedHostGroupsClient.Client, o.ResourceManagerAuthorizer) disksClient := compute.NewDisksClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) diff --git a/internal/services/compute/dedicated_host_data_source.go b/internal/services/compute/dedicated_host_data_source.go index 6b2f2ff5c865f..04b8ec950f04b 100644 --- a/internal/services/compute/dedicated_host_data_source.go +++ b/internal/services/compute/dedicated_host_data_source.go @@ -4,15 +4,15 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) func dataSourceDedicatedHost() *pluginsdk.Resource { @@ -40,7 +40,7 @@ func dataSourceDedicatedHost() *pluginsdk.Resource { "location": commonschema.LocationComputed(), - "tags": tags.SchemaDataSource(), + "tags": commonschema.TagsDataSource(), }, } } @@ -51,22 +51,29 @@ func dataSourceDedicatedHostRead(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewDedicatedHostID(subscriptionId, d.Get("resource_group_name").(string), d.Get("dedicated_host_group_name").(string), d.Get("name").(string)) + id := dedicatedhosts.NewHostID(subscriptionId, d.Get("resource_group_name").(string), d.Get("dedicated_host_group_name").(string), d.Get("name").(string)) - resp, err := client.Get(ctx, id.ResourceGroup, id.HostGroupName, id.HostName, "") + resp, err := client.Get(ctx, id, dedicatedhosts.DefaultGetOperationOptions()) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return fmt.Errorf("%s was not found", id) } + return fmt.Errorf("reading %s: %+v", id, err) } d.SetId(id.ID()) d.Set("name", id.HostName) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("resource_group_name", id.ResourceGroupName) d.Set("dedicated_host_group_name", id.HostGroupName) - d.Set("location", location.NormalizeNilable(resp.Location)) + if model := resp.Model; model != nil { + d.Set("location", location.Normalize(model.Location)) + + if err := tags.FlattenAndSet(d, model.Tags); err != nil { + return err + } + } - return tags.FlattenAndSet(d, resp.Tags) + return nil } diff --git a/internal/services/compute/dedicated_host_group_data_source.go b/internal/services/compute/dedicated_host_group_data_source.go index 322429c23bf08..0446ea8c1a9f7 100644 --- a/internal/services/compute/dedicated_host_group_data_source.go +++ b/internal/services/compute/dedicated_host_group_data_source.go @@ -5,16 +5,16 @@ import ( "regexp" "time" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) func dataSourceDedicatedHostGroup() *pluginsdk.Resource { @@ -59,10 +59,10 @@ func dataSourceDedicatedHostGroupRead(d *pluginsdk.ResourceData, meta interface{ ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewDedicatedHostGroupID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - resp, err := client.Get(ctx, id.ResourceGroup, id.HostGroupName, "") + id := dedicatedhostgroups.NewHostGroupID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + resp, err := client.Get(ctx, id, dedicatedhostgroups.DefaultGetOperationOptions()) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return fmt.Errorf("%s was not found", id) } return fmt.Errorf("reading %s: %+v", id, err) @@ -71,20 +71,21 @@ func dataSourceDedicatedHostGroupRead(d *pluginsdk.ResourceData, meta interface{ d.SetId(id.ID()) d.Set("name", id.HostGroupName) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("resource_group_name", id.ResourceGroupName) - d.Set("location", location.NormalizeNilable(resp.Location)) - d.Set("zones", zones.Flatten(resp.Zones)) + if model := resp.Model; model != nil { + d.Set("location", location.Normalize(model.Location)) + d.Set("zones", zones.Flatten(model.Zones)) - if props := resp.DedicatedHostGroupProperties; props != nil { - d.Set("automatic_placement_enabled", props.SupportAutomaticPlacement) + if props := model.Properties; props != nil { + d.Set("automatic_placement_enabled", props.SupportAutomaticPlacement) + d.Set("platform_fault_domain_count", props.PlatformFaultDomainCount) + } - platformFaultDomainCount := 0 - if props.PlatformFaultDomainCount != nil { - platformFaultDomainCount = int(*props.PlatformFaultDomainCount) + if err := tags.FlattenAndSet(d, model.Tags); err != nil { + return err } - d.Set("platform_fault_domain_count", platformFaultDomainCount) } - return tags.FlattenAndSet(d, resp.Tags) + return nil } diff --git a/internal/services/compute/dedicated_host_group_resource.go b/internal/services/compute/dedicated_host_group_resource.go index 06de97bed5f0c..f8eba877674fa 100644 --- a/internal/services/compute/dedicated_host_group_resource.go +++ b/internal/services/compute/dedicated_host_group_resource.go @@ -5,15 +5,14 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -28,7 +27,7 @@ func resourceDedicatedHostGroup() *pluginsdk.Resource { Delete: resourceDedicatedHostGroupDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.HostGroupID(id) + _, err := dedicatedhostgroups.ParseHostGroupID(id) return err }), @@ -47,11 +46,9 @@ func resourceDedicatedHostGroup() *pluginsdk.Resource { ValidateFunc: validate.DedicatedHostGroupName(), }, - "location": azure.SchemaLocation(), + "resource_group_name": commonschema.ResourceGroupName(), - // There's a bug in the Azure API where this is returned in upper-case - // BUG: https://github.com/Azure/azure-rest-api-specs/issues/8068 - "resource_group_name": azure.SchemaResourceGroupNameDiffSuppress(), + "location": commonschema.Location(), "platform_fault_domain_count": { Type: pluginsdk.TypeInt, @@ -68,7 +65,7 @@ func resourceDedicatedHostGroup() *pluginsdk.Resource { }, "zone": commonschema.ZoneSingleOptionalForceNew(), - "tags": tags.Schema(), + "tags": commonschema.Tags(), }, } } @@ -79,48 +76,45 @@ func resourceDedicatedHostGroupCreate(d *pluginsdk.ResourceData, meta interface{ ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewHostGroupID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - + id := dedicatedhostgroups.NewHostGroupID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.Name, "") + existing, err := client.Get(ctx, id, dedicatedhostgroups.DefaultGetOperationOptions()) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_dedicated_host_group", id.ID()) } } - location := azure.NormalizeLocation(d.Get("location").(string)) platformFaultDomainCount := d.Get("platform_fault_domain_count").(int) t := d.Get("tags").(map[string]interface{}) - parameters := compute.DedicatedHostGroup{ - Location: utils.String(location), - DedicatedHostGroupProperties: &compute.DedicatedHostGroupProperties{ - PlatformFaultDomainCount: utils.Int32(int32(platformFaultDomainCount)), + payload := dedicatedhostgroups.DedicatedHostGroup{ + Location: location.Normalize(d.Get("location").(string)), + Properties: &dedicatedhostgroups.DedicatedHostGroupProperties{ + PlatformFaultDomainCount: int64(platformFaultDomainCount), }, Tags: tags.Expand(t), } if zone, ok := d.GetOk("zone"); ok { - parameters.Zones = &[]string{ + payload.Zones = &[]string{ zone.(string), } } if v, ok := d.GetOk("automatic_placement_enabled"); ok { - parameters.DedicatedHostGroupProperties.SupportAutomaticPlacement = utils.Bool(v.(bool)) + payload.Properties.SupportAutomaticPlacement = utils.Bool(v.(bool)) } - if _, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.Name, parameters); err != nil { + if _, err := client.CreateOrUpdate(ctx, id, payload); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } d.SetId(id.ID()) - return resourceDedicatedHostGroupRead(d, meta) } @@ -129,44 +123,45 @@ func resourceDedicatedHostGroupRead(d *pluginsdk.ResourceData, meta interface{}) ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.HostGroupID(d.Id()) + id, err := dedicatedhostgroups.ParseHostGroupID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.Name, "") + resp, err := client.Get(ctx, *id, dedicatedhostgroups.DefaultGetOperationOptions()) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - log.Printf("[INFO] Dedicated Host Group %q does not exist - removing from state", d.Id()) + if response.WasNotFound(resp.HttpResponse) { + log.Printf("[INFO] %q was not found - removing from state", *id) d.SetId("") return nil } - return fmt.Errorf("reading Dedicated Host Group %q (: %+v", id.String(), err) + return fmt.Errorf("retrieving %s: %+v", *id, err) } - d.Set("name", id.Name) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("name", id.HostGroupName) + d.Set("resource_group_name", id.ResourceGroupName) - d.Set("location", location.NormalizeNilable(resp.Location)) + if model := resp.Model; model != nil { + d.Set("location", location.Normalize(model.Location)) - zone := "" - if resp.Zones != nil && len(*resp.Zones) > 0 { - z := *resp.Zones - zone = z[0] - } - d.Set("zone", zone) + zone := "" + if model.Zones != nil && len(*model.Zones) > 0 { + z := *model.Zones + zone = z[0] + } + d.Set("zone", zone) - if props := resp.DedicatedHostGroupProperties; props != nil { - platformFaultDomainCount := 0 - if props.PlatformFaultDomainCount != nil { - platformFaultDomainCount = int(*props.PlatformFaultDomainCount) + if props := model.Properties; props != nil { + d.Set("platform_fault_domain_count", props.PlatformFaultDomainCount) + d.Set("automatic_placement_enabled", props.SupportAutomaticPlacement) } - d.Set("platform_fault_domain_count", platformFaultDomainCount) - d.Set("automatic_placement_enabled", props.SupportAutomaticPlacement) + if err := tags.FlattenAndSet(d, model.Tags); err != nil { + return err + } } - return tags.FlattenAndSet(d, resp.Tags) + return nil } func resourceDedicatedHostGroupUpdate(d *pluginsdk.ResourceData, meta interface{}) error { @@ -174,16 +169,17 @@ func resourceDedicatedHostGroupUpdate(d *pluginsdk.ResourceData, meta interface{ ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - name := d.Get("name").(string) - resourceGroupName := d.Get("resource_group_name").(string) - t := d.Get("tags").(map[string]interface{}) + id, err := dedicatedhostgroups.ParseHostGroupID(d.Id()) + if err != nil { + return err + } - parameters := compute.DedicatedHostGroupUpdate{ - Tags: tags.Expand(t), + payload := dedicatedhostgroups.DedicatedHostGroupUpdate{ + Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - if _, err := client.Update(ctx, resourceGroupName, name, parameters); err != nil { - return fmt.Errorf("updating Dedicated Host Group %q (Resource Group %q): %+v", name, resourceGroupName, err) + if _, err := client.Update(ctx, *id, payload); err != nil { + return fmt.Errorf("updating %s: %+v", *id, err) } return resourceDedicatedHostGroupRead(d, meta) @@ -194,13 +190,13 @@ func resourceDedicatedHostGroupDelete(d *pluginsdk.ResourceData, meta interface{ ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.HostGroupID(d.Id()) + id, err := dedicatedhostgroups.ParseHostGroupID(d.Id()) if err != nil { return err } - if _, err := client.Delete(ctx, id.ResourceGroup, id.Name); err != nil { - return fmt.Errorf("deleting Dedicated Host Group %q : %+v", id.String(), err) + if _, err := client.Delete(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) } return nil diff --git a/internal/services/compute/dedicated_host_group_resource_test.go b/internal/services/compute/dedicated_host_group_resource_test.go index 1abe0a0aac071..0fac0d29f4ed9 100644 --- a/internal/services/compute/dedicated_host_group_resource_test.go +++ b/internal/services/compute/dedicated_host_group_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -78,17 +79,17 @@ func TestAccDedicatedHostGroup_complete(t *testing.T) { } func (r DedicatedHostGroupResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.HostGroupID(state.ID) + id, err := dedicatedhostgroups.ParseHostGroupID(state.ID) if err != nil { return nil, err } - resp, err := clients.Compute.DedicatedHostGroupsClient.Get(ctx, id.ResourceGroup, id.Name, "") + resp, err := clients.Compute.DedicatedHostGroupsClient.Get(ctx, *id, dedicatedhostgroups.DefaultGetOperationOptions()) if err != nil { return nil, fmt.Errorf("retrieving Compute Dedicated Host Group %q", id) } - return utils.Bool(resp.ID != nil), nil + return utils.Bool(resp.Model != nil), nil } func (DedicatedHostGroupResource) basic(data acceptance.TestData) string { diff --git a/internal/services/compute/dedicated_host_resource.go b/internal/services/compute/dedicated_host_resource.go index 41dc03fec72a5..2dc6307bf4d97 100644 --- a/internal/services/compute/dedicated_host_resource.go +++ b/internal/services/compute/dedicated_host_resource.go @@ -6,14 +6,15 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -28,7 +29,7 @@ func resourceDedicatedHost() *pluginsdk.Resource { Delete: resourceDedicatedHostDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.DedicatedHostID(id) + _, err := dedicatedhosts.ParseHostID(id) return err }), @@ -47,15 +48,15 @@ func resourceDedicatedHost() *pluginsdk.Resource { ValidateFunc: validate.DedicatedHostName(), }, - "location": azure.SchemaLocation(), - "dedicated_host_group_id": { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validate.DedicatedHostGroupID, + ValidateFunc: dedicatedhostgroups.ValidateHostGroupID, }, + "location": commonschema.Location(), + "sku_name": { Type: pluginsdk.TypeString, ForceNew: true, @@ -124,14 +125,15 @@ func resourceDedicatedHost() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(compute.DedicatedHostLicenseTypesNone), - string(compute.DedicatedHostLicenseTypesWindowsServerHybrid), - string(compute.DedicatedHostLicenseTypesWindowsServerPerpetual), + // TODO: remove `None` in 4.0 in favour of this field being set to an empty string (since it's optional) + string(dedicatedhosts.DedicatedHostLicenseTypesNone), + string(dedicatedhosts.DedicatedHostLicenseTypesWindowsServerHybrid), + string(dedicatedhosts.DedicatedHostLicenseTypesWindowsServerPerpetual), }, false), - Default: string(compute.DedicatedHostLicenseTypesNone), + Default: string(dedicatedhosts.DedicatedHostLicenseTypesNone), }, - "tags": tags.Schema(), + "tags": commonschema.Tags(), }, } } @@ -141,102 +143,90 @@ func resourceDedicatedHostCreate(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - hostGroupId, err := parse.DedicatedHostGroupID(d.Get("dedicated_host_group_id").(string)) + hostGroupId, err := dedicatedhostgroups.ParseHostGroupID(d.Get("dedicated_host_group_id").(string)) if err != nil { return err } - id := parse.NewDedicatedHostID(hostGroupId.SubscriptionId, hostGroupId.ResourceGroup, hostGroupId.HostGroupName, d.Get("name").(string)) + id := dedicatedhosts.NewHostID(hostGroupId.SubscriptionId, hostGroupId.ResourceGroupName, hostGroupId.HostGroupName, d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.HostGroupName, id.HostName, "") + existing, err := client.Get(ctx, id, dedicatedhosts.DefaultGetOperationOptions()) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_dedicated_host", id.ID()) } } - parameters := compute.DedicatedHost{ - Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))), - DedicatedHostProperties: &compute.DedicatedHostProperties{ + licenseType := dedicatedhosts.DedicatedHostLicenseTypes(d.Get("license_type").(string)) + payload := dedicatedhosts.DedicatedHost{ + Location: location.Normalize(d.Get("location").(string)), + Properties: &dedicatedhosts.DedicatedHostProperties{ AutoReplaceOnFailure: utils.Bool(d.Get("auto_replace_on_failure").(bool)), - LicenseType: compute.DedicatedHostLicenseTypes(d.Get("license_type").(string)), - PlatformFaultDomain: utils.Int32(int32(d.Get("platform_fault_domain").(int))), + LicenseType: &licenseType, + PlatformFaultDomain: utils.Int64(int64(d.Get("platform_fault_domain").(int))), }, - Sku: &compute.Sku{ + Sku: dedicatedhosts.Sku{ Name: utils.String(d.Get("sku_name").(string)), }, Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.HostGroupName, id.HostName, parameters) - if err != nil { + if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for creation of %s: %+v", id, err) - } d.SetId(id.ID()) return resourceDedicatedHostRead(d, meta) } func resourceDedicatedHostRead(d *pluginsdk.ResourceData, meta interface{}) error { - groupsClient := meta.(*clients.Client).Compute.DedicatedHostGroupsClient hostsClient := meta.(*clients.Client).Compute.DedicatedHostsClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.DedicatedHostID(d.Id()) + id, err := dedicatedhosts.ParseHostID(d.Id()) if err != nil { return err } - hostGroupId := parse.NewDedicatedHostGroupID(id.SubscriptionId, id.ResourceGroup, id.HostGroupName) - group, err := groupsClient.Get(ctx, hostGroupId.ResourceGroup, hostGroupId.HostGroupName, "") + resp, err := hostsClient.Get(ctx, *id, dedicatedhosts.DefaultGetOperationOptions()) if err != nil { - if utils.ResponseWasNotFound(group.Response) { - log.Printf("[INFO] Parent %s does not exist - removing from state", hostGroupId) + if response.WasNotFound(resp.HttpResponse) { + log.Printf("[INFO] %s was not found - removing from state", *id) d.SetId("") return nil } - return fmt.Errorf("retrieving %s: %+v", hostGroupId, err) - } - - resp, err := hostsClient.Get(ctx, id.ResourceGroup, id.HostGroupName, id.HostName, "") - if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - log.Printf("[INFO] Dedicated Host %q does not exist - removing from state", d.Id()) - d.SetId("") - return nil - } - - return fmt.Errorf("retrieving Dedicated Host %q (Host Group Name %q / Resource Group %q): %+v", id.HostName, id.HostGroupName, id.ResourceGroup, err) + return fmt.Errorf("retrieving %s: %+v", *id, err) } d.Set("name", id.HostName) - d.Set("dedicated_host_group_id", hostGroupId.ID()) + d.Set("dedicated_host_group_id", dedicatedhostgroups.NewHostGroupID(id.SubscriptionId, id.ResourceGroupName, id.HostGroupName).ID()) + + if model := resp.Model; model != nil { + d.Set("location", location.Normalize(model.Location)) + d.Set("sku_name", model.Sku.Name) + if props := model.Properties; props != nil { + d.Set("auto_replace_on_failure", props.AutoReplaceOnFailure) + d.Set("license_type", props.LicenseType) + + platformFaultDomain := 0 + if props.PlatformFaultDomain != nil { + platformFaultDomain = int(*props.PlatformFaultDomain) + } + d.Set("platform_fault_domain", platformFaultDomain) + } - if location := resp.Location; location != nil { - d.Set("location", azure.NormalizeLocation(*location)) - } - d.Set("sku_name", resp.Sku.Name) - if props := resp.DedicatedHostProperties; props != nil { - d.Set("auto_replace_on_failure", props.AutoReplaceOnFailure) - d.Set("license_type", props.LicenseType) - - platformFaultDomain := 0 - if props.PlatformFaultDomain != nil { - platformFaultDomain = int(*props.PlatformFaultDomain) + if err := tags.FlattenAndSet(d, model.Tags); err != nil { + return err } - d.Set("platform_fault_domain", platformFaultDomain) } - return tags.FlattenAndSet(d, resp.Tags) + return nil } func resourceDedicatedHostUpdate(d *pluginsdk.ResourceData, meta interface{}) error { @@ -244,25 +234,30 @@ func resourceDedicatedHostUpdate(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.DedicatedHostID(d.Id()) + id, err := dedicatedhosts.ParseHostID(d.Id()) if err != nil { return err } - parameters := compute.DedicatedHostUpdate{ - DedicatedHostProperties: &compute.DedicatedHostProperties{ - AutoReplaceOnFailure: utils.Bool(d.Get("auto_replace_on_failure").(bool)), - LicenseType: compute.DedicatedHostLicenseTypes(d.Get("license_type").(string)), - }, - Tags: tags.Expand(d.Get("tags").(map[string]interface{})), + payload := dedicatedhosts.DedicatedHostUpdate{} + + if d.HasChanges("auto_replace_on_failure", "license_type") { + payload.Properties = &dedicatedhosts.DedicatedHostProperties{} + if d.HasChange("auto_replace_on_failure") { + payload.Properties.AutoReplaceOnFailure = utils.Bool(d.Get("auto_replace_on_failure").(bool)) + } + if d.HasChange("license_type") { + licenseType := dedicatedhosts.DedicatedHostLicenseTypes(d.Get("license_type").(string)) + payload.Properties.LicenseType = &licenseType + } } - future, err := client.Update(ctx, id.ResourceGroup, id.HostGroupName, id.HostName, parameters) - if err != nil { - return fmt.Errorf("updating %s: %+v", *id, err) + if d.HasChange("tags") { + payload.Tags = tags.Expand(d.Get("tags").(map[string]interface{})) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for update of %s: %+v", *id, err) + + if err := client.UpdateThenPoll(ctx, *id, payload); err != nil { + return fmt.Errorf("updating %s: %+v", *id, err) } return resourceDedicatedHostRead(d, meta) @@ -273,22 +268,15 @@ func resourceDedicatedHostDelete(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.DedicatedHostID(d.Id()) + id, err := dedicatedhosts.ParseHostID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.HostGroupName, id.HostName) - if err != nil { + if err := client.DeleteThenPoll(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - if !response.WasNotFound(future.Response()) { - return fmt.Errorf("waiting for deletion of %s: %+v", *id, err) - } - } - // API has bug, which appears to be eventually consistent. Tracked by this issue: https://github.com/Azure/azure-rest-api-specs/issues/8137 log.Printf("[DEBUG] Waiting for %s to be fully deleted..", *id) stateConf := &pluginsdk.StateChangeConf{ @@ -307,11 +295,11 @@ func resourceDedicatedHostDelete(d *pluginsdk.ResourceData, meta interface{}) er return nil } -func dedicatedHostDeletedRefreshFunc(ctx context.Context, client *compute.DedicatedHostsClient, id parse.DedicatedHostId) pluginsdk.StateRefreshFunc { +func dedicatedHostDeletedRefreshFunc(ctx context.Context, client *dedicatedhosts.DedicatedHostsClient, id dedicatedhosts.HostId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { - res, err := client.Get(ctx, id.ResourceGroup, id.HostGroupName, id.HostName, "") + res, err := client.Get(ctx, id, dedicatedhosts.DefaultGetOperationOptions()) if err != nil { - if utils.ResponseWasNotFound(res.Response) { + if response.WasNotFound(res.HttpResponse) { return "NotFound", "NotFound", nil } diff --git a/internal/services/compute/dedicated_host_resource_test.go b/internal/services/compute/dedicated_host_resource_test.go index ddc6d6b2f0913..09b33e7e0a84f 100644 --- a/internal/services/compute/dedicated_host_resource_test.go +++ b/internal/services/compute/dedicated_host_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -166,17 +167,17 @@ func TestAccDedicatedHost_requiresImport(t *testing.T) { } func (t DedicatedHostResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.DedicatedHostID(state.ID) + id, err := dedicatedhosts.ParseHostID(state.ID) if err != nil { return nil, err } - resp, err := clients.Compute.DedicatedHostsClient.Get(ctx, id.ResourceGroup, id.HostGroupName, id.HostName, "") + resp, err := clients.Compute.DedicatedHostsClient.Get(ctx, *id, dedicatedhosts.DefaultGetOperationOptions()) if err != nil { return nil, fmt.Errorf("retrieving Compute Dedicated Host %q", id.String()) } - return utils.Bool(resp.ID != nil), nil + return utils.Bool(resp.Model != nil), nil } func (r DedicatedHostResource) basic(data acceptance.TestData) string { diff --git a/internal/services/compute/linux_virtual_machine_resource.go b/internal/services/compute/linux_virtual_machine_resource.go index e84df966ae16f..6fb2e691f4359 100644 --- a/internal/services/compute/linux_virtual_machine_resource.go +++ b/internal/services/compute/linux_virtual_machine_resource.go @@ -12,6 +12,8 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -151,7 +153,7 @@ func resourceLinuxVirtualMachine() *pluginsdk.Resource { "dedicated_host_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: computeValidate.DedicatedHostID, + ValidateFunc: dedicatedhosts.ValidateHostID, // the Compute/VM API is broken and returns the Resource Group name in UPPERCASE :shrug: // tracked by https://github.com/Azure/azure-rest-api-specs/issues/19424 DiffSuppressFunc: suppress.CaseDifference, @@ -163,7 +165,7 @@ func resourceLinuxVirtualMachine() *pluginsdk.Resource { "dedicated_host_group_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: computeValidate.DedicatedHostGroupID, + ValidateFunc: dedicatedhostgroups.ValidateHostGroupID, // the Compute/VM API is broken and returns the Resource Group name in UPPERCASE // tracked by https://github.com/Azure/azure-rest-api-specs/issues/19424 DiffSuppressFunc: suppress.CaseDifference, @@ -192,8 +194,8 @@ func resourceLinuxVirtualMachine() *pluginsdk.Resource { Optional: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - // NOTE: whilst Delete is an option here, it's only applicable for VMSS string(compute.VirtualMachineEvictionPolicyTypesDeallocate), + string(compute.VirtualMachineEvictionPolicyTypesDelete), }, false), }, diff --git a/internal/services/compute/linux_virtual_machine_resource_disk_os_test.go b/internal/services/compute/linux_virtual_machine_resource_disk_os_test.go index 185a41ceffef7..ccfbc0940ef53 100644 --- a/internal/services/compute/linux_virtual_machine_resource_disk_os_test.go +++ b/internal/services/compute/linux_virtual_machine_resource_disk_os_test.go @@ -156,6 +156,21 @@ func TestAccLinuxVirtualMachine_diskOSEphemeralDefault(t *testing.T) { }) } +func TestAccLinuxVirtualMachine_diskOSDiskEphemeralSpot(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine", "test") + r := LinuxVirtualMachineResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.diskOSEphemeralSpot(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("admin_password"), + }) +} + func TestAccLinuxVirtualMachine_diskOSEphemeralResourceDisk(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine", "test") r := LinuxVirtualMachineResource{} @@ -738,6 +753,46 @@ resource "azurerm_linux_virtual_machine" "test" { `, r.template(data), data.RandomInteger) } +func (r LinuxVirtualMachineResource) diskOSEphemeralSpot(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2s_v2" + admin_username = "adminuser" + priority = "Spot" + eviction_policy = "Delete" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = local.first_public_key + } + + os_disk { + caching = "ReadOnly" + storage_account_type = "Standard_LRS" + + diff_disk_settings { + option = "Local" + } + } + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "16.04-LTS" + version = "latest" + } +} +`, r.template(data), data.RandomInteger) +} + func (r LinuxVirtualMachineResource) diskOSEphemeralResourceDisk(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/parse/dedicated_host.go b/internal/services/compute/parse/dedicated_host.go deleted file mode 100644 index f9c7816b810bc..0000000000000 --- a/internal/services/compute/parse/dedicated_host.go +++ /dev/null @@ -1,75 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type DedicatedHostId struct { - SubscriptionId string - ResourceGroup string - HostGroupName string - HostName string -} - -func NewDedicatedHostID(subscriptionId, resourceGroup, hostGroupName, hostName string) DedicatedHostId { - return DedicatedHostId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - HostGroupName: hostGroupName, - HostName: hostName, - } -} - -func (id DedicatedHostId) String() string { - segments := []string{ - fmt.Sprintf("Host Name %q", id.HostName), - fmt.Sprintf("Host Group Name %q", id.HostGroupName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Dedicated Host", segmentsStr) -} - -func (id DedicatedHostId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/hostGroups/%s/hosts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.HostGroupName, id.HostName) -} - -// DedicatedHostID parses a DedicatedHost ID into an DedicatedHostId struct -func DedicatedHostID(input string) (*DedicatedHostId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := DedicatedHostId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.HostGroupName, err = id.PopSegment("hostGroups"); err != nil { - return nil, err - } - if resourceId.HostName, err = id.PopSegment("hosts"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/compute/parse/dedicated_host_group_test.go b/internal/services/compute/parse/dedicated_host_group_test.go deleted file mode 100644 index 0888e81b04777..0000000000000 --- a/internal/services/compute/parse/dedicated_host_group_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = DedicatedHostGroupId{} - -func TestDedicatedHostGroupIDFormatter(t *testing.T) { - actual := NewDedicatedHostGroupID("12345678-1234-9876-4563-123456789012", "resGroup1", "hostGroup1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestDedicatedHostGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DedicatedHostGroupId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/", - Error: true, - }, - - { - // missing value for HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1", - Expected: &DedicatedHostGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - HostGroupName: "hostGroup1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.COMPUTE/HOSTGROUPS/HOSTGROUP1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := DedicatedHostGroupID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.HostGroupName != v.Expected.HostGroupName { - t.Fatalf("Expected %q but got %q for HostGroupName", v.Expected.HostGroupName, actual.HostGroupName) - } - } -} diff --git a/internal/services/compute/parse/dedicated_host_test.go b/internal/services/compute/parse/dedicated_host_test.go deleted file mode 100644 index 13475856972c2..0000000000000 --- a/internal/services/compute/parse/dedicated_host_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = DedicatedHostId{} - -func TestDedicatedHostIDFormatter(t *testing.T) { - actual := NewDedicatedHostID("12345678-1234-9876-4563-123456789012", "resGroup1", "hostGroup1", "host1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/hosts/host1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestDedicatedHostID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DedicatedHostId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/", - Error: true, - }, - - { - // missing value for HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/", - Error: true, - }, - - { - // missing HostName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/", - Error: true, - }, - - { - // missing value for HostName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/hosts/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/hosts/host1", - Expected: &DedicatedHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - HostGroupName: "hostGroup1", - HostName: "host1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.COMPUTE/HOSTGROUPS/HOSTGROUP1/HOSTS/HOST1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := DedicatedHostID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.HostGroupName != v.Expected.HostGroupName { - t.Fatalf("Expected %q but got %q for HostGroupName", v.Expected.HostGroupName, actual.HostGroupName) - } - if actual.HostName != v.Expected.HostName { - t.Fatalf("Expected %q but got %q for HostName", v.Expected.HostName, actual.HostName) - } - } -} diff --git a/internal/services/compute/resourceids.go b/internal/services/compute/resourceids.go index 313b8fd3177c8..b73834a598d25 100644 --- a/internal/services/compute/resourceids.go +++ b/internal/services/compute/resourceids.go @@ -2,8 +2,6 @@ package compute //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=CapacityReservationGroup -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/capacityReservationGroups/capacityReservationGroup1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=CapacityReservation -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/capacityReservationGroups/capacityReservationGroup1/capacityReservations/capacityReservation1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=DedicatedHostGroup -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=DedicatedHost -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/hosts/host1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=DiskEncryptionSet -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/diskEncryptionSets/set1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=GalleryApplication -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/galleries/gallery1/applications/galleryApplication1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=GalleryApplicationVersion -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/galleries/gallery1/applications/galleryApplication1/versions/galleryApplicationVersion1 diff --git a/internal/services/compute/shared_image_data_source.go b/internal/services/compute/shared_image_data_source.go index 2dbf49fe82010..c211c418f2910 100644 --- a/internal/services/compute/shared_image_data_source.go +++ b/internal/services/compute/shared_image_data_source.go @@ -41,6 +41,11 @@ func dataSourceSharedImage() *pluginsdk.Resource { "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + "architecture": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "os_type": { Type: pluginsdk.TypeString, Computed: true, @@ -131,6 +136,7 @@ func dataSourceSharedImageRead(d *pluginsdk.ResourceData, meta interface{}) erro d.Set("description", props.Description) d.Set("eula", props.Eula) d.Set("os_type", string(props.OsType)) + d.Set("architecture", string(props.Architecture)) d.Set("specialized", props.OsState == compute.OperatingSystemStateTypesSpecialized) d.Set("hyper_v_generation", string(props.HyperVGeneration)) d.Set("privacy_statement_uri", props.PrivacyStatementURI) diff --git a/internal/services/compute/shared_image_resource.go b/internal/services/compute/shared_image_resource.go index 3142e04da68d3..12211d5cf0432 100644 --- a/internal/services/compute/shared_image_resource.go +++ b/internal/services/compute/shared_image_resource.go @@ -60,6 +60,17 @@ func resourceSharedImage() *pluginsdk.Resource { "resource_group_name": azure.SchemaResourceGroupName(), + "architecture": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(compute.ArchitectureTypesX64), + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(compute.ArchitectureTypesX64), + string(compute.ArchitectureTypesArm64), + }, false), + }, + "os_type": { Type: pluginsdk.TypeString, Required: true, @@ -280,6 +291,7 @@ func resourceSharedImageCreateUpdate(d *pluginsdk.ResourceData, meta interface{} Identifier: expandGalleryImageIdentifier(d), PrivacyStatementURI: utils.String(d.Get("privacy_statement_uri").(string)), ReleaseNoteURI: utils.String(d.Get("release_note_uri").(string)), + Architecture: compute.Architecture(d.Get("architecture").(string)), OsType: compute.OperatingSystemTypes(d.Get("os_type").(string)), HyperVGeneration: compute.HyperVGeneration(d.Get("hyper_v_generation").(string)), PurchasePlan: expandGalleryImagePurchasePlan(d.Get("purchase_plan").([]interface{})), @@ -395,6 +407,7 @@ func resourceSharedImageRead(d *pluginsdk.ResourceData, meta interface{}) error d.Set("min_recommended_memory_in_gb", minRecommendedMemoryInGB) d.Set("os_type", string(props.OsType)) + d.Set("architecture", string(props.Architecture)) d.Set("specialized", props.OsState == compute.OperatingSystemStateTypesSpecialized) d.Set("hyper_v_generation", string(props.HyperVGeneration)) d.Set("privacy_statement_uri", props.PrivacyStatementURI) diff --git a/internal/services/compute/shared_image_resource_test.go b/internal/services/compute/shared_image_resource_test.go index 02baa96a135fb..28c4cc910c11a 100644 --- a/internal/services/compute/shared_image_resource_test.go +++ b/internal/services/compute/shared_image_resource_test.go @@ -47,6 +47,22 @@ func TestAccSharedImage_basic_hyperVGeneration_V2(t *testing.T) { }) } +func TestAccSharedImage_basic_Arm(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_shared_image", "test") + r := SharedImageResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basicWithArch(data, "Arm64"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("description").HasValue(""), + check.That(data.ResourceName).Key("architecture").HasValue("Arm64"), + ), + }, + data.ImportStep(), + }) +} + func TestAccSharedImage_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_shared_image", "test") r := SharedImageResource{} @@ -343,6 +359,45 @@ resource "azurerm_shared_image" "test" { `, hyperVGen, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } +func (SharedImageResource) basicWithArch(data acceptance.TestData, arch string) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +variable "architecture" { + default = "%s" +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_shared_image_gallery" "test" { + name = "acctestsig%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} + +resource "azurerm_shared_image" "test" { + name = "acctestimg%d" + gallery_name = azurerm_shared_image_gallery.test.name + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + architecture = var.architecture != "" ? var.architecture : null + os_type = "Linux" + hyper_v_generation = "V2" + + identifier { + publisher = "AccTesPublisher%d" + offer = "AccTesOffer%d" + sku = "AccTesSku%d" + } +} +`, arch, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} + func (SharedImageResource) specialized(data acceptance.TestData, hyperVGen string) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/compute/shared_image_version_resource.go b/internal/services/compute/shared_image_version_resource.go index edd06bf961cab..361f6dbbb1fca 100644 --- a/internal/services/compute/shared_image_version_resource.go +++ b/internal/services/compute/shared_image_version_resource.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" + storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" @@ -111,6 +112,23 @@ func resourceSharedImageVersion() *pluginsdk.Resource { }, }, + "blob_uri": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.IsURLWithScheme([]string{"http", "https"}), + RequiredWith: []string{"storage_account_id"}, + ExactlyOneOf: []string{"blob_uri", "os_disk_snapshot_id", "managed_image_id"}, + }, + + "storage_account_id": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + RequiredWith: []string{"blob_uri"}, + ValidateFunc: storageValidate.StorageAccountID, + }, + "end_of_life_date": { Type: pluginsdk.TypeString, Optional: true, @@ -122,7 +140,7 @@ func resourceSharedImageVersion() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ExactlyOneOf: []string{"os_disk_snapshot_id", "managed_image_id"}, + ExactlyOneOf: []string{"blob_uri", "os_disk_snapshot_id", "managed_image_id"}, // TODO -- add a validation function when snapshot has its own validation function }, @@ -134,7 +152,7 @@ func resourceSharedImageVersion() *pluginsdk.Resource { validate.ImageID, validate.VirtualMachineID, ), - ExactlyOneOf: []string{"os_disk_snapshot_id", "managed_image_id"}, + ExactlyOneOf: []string{"blob_uri", "os_disk_snapshot_id", "managed_image_id"}, }, "replication_mode": { @@ -225,6 +243,15 @@ func resourceSharedImageVersionCreateUpdate(d *pluginsdk.ResourceData, meta inte } } + if v, ok := d.GetOk("blob_uri"); ok { + version.GalleryImageVersionProperties.StorageProfile.OsDiskImage = &compute.GalleryOSDiskImage{ + Source: &compute.GalleryArtifactVersionSource{ + ID: utils.String(d.Get("storage_account_id").(string)), + URI: utils.String(v.(string)), + }, + } + } + future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.GalleryName, id.ImageName, id.VersionName, version) if err != nil { return fmt.Errorf("creating %s: %+v", id, err) @@ -292,11 +319,24 @@ func resourceSharedImageVersionRead(d *pluginsdk.ResourceData, meta interface{}) d.Set("managed_image_id", source.ID) } + blobURI := "" + if profile.OsDiskImage != nil && profile.OsDiskImage.Source != nil && profile.OsDiskImage.Source.URI != nil { + blobURI = *profile.OsDiskImage.Source.URI + } + d.Set("blob_uri", blobURI) + osDiskSnapShotID := "" + storageAccountID := "" if profile.OsDiskImage != nil && profile.OsDiskImage.Source != nil && profile.OsDiskImage.Source.ID != nil { - osDiskSnapShotID = *profile.OsDiskImage.Source.ID + sourceID := *profile.OsDiskImage.Source.ID + if blobURI == "" { + osDiskSnapShotID = sourceID + } else { + storageAccountID = sourceID + } } d.Set("os_disk_snapshot_id", osDiskSnapShotID) + d.Set("storage_account_id", storageAccountID) } } diff --git a/internal/services/compute/shared_image_version_resource_test.go b/internal/services/compute/shared_image_version_resource_test.go index d06b1e2a899c5..3dab9c7286f10 100644 --- a/internal/services/compute/shared_image_version_resource_test.go +++ b/internal/services/compute/shared_image_version_resource_test.go @@ -102,6 +102,21 @@ func TestAccSharedImageVersion_storageAccountTypeZrs(t *testing.T) { }) } +func TestAccSharedImageVersion_blobURI(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_shared_image_version", "test") + r := SharedImageVersionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.imageVersionBlobURI(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func TestAccSharedImageVersion_specializedImageVersionBySnapshot(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_shared_image_version", "test") r := SharedImageVersionResource{} @@ -330,6 +345,49 @@ resource "azurerm_shared_image_version" "test" { `, template) } +func (r SharedImageVersionResource) imageVersionBlobURI(data acceptance.TestData) string { + template := r.setup(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_shared_image_gallery" "test" { + name = "acctestsig%[2]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} + +resource "azurerm_shared_image" "test" { + name = "acctestimg%[2]d" + gallery_name = azurerm_shared_image_gallery.test.name + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + os_type = "Linux" + + identifier { + publisher = "AccTesPublisher%[2]d" + offer = "AccTesOffer%[2]d" + sku = "AccTesSku%[2]d" + } +} + +resource "azurerm_shared_image_version" "test" { + name = "0.0.1" + gallery_name = azurerm_shared_image_gallery.test.name + image_name = azurerm_shared_image.test.name + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + blob_uri = azurerm_virtual_machine.testsource.storage_os_disk[0].vhd_uri + storage_account_id = azurerm_storage_account.test.id + + target_region { + name = azurerm_resource_group.test.location + regional_replica_count = 1 + } +} +`, template, data.RandomInteger) +} + func (r SharedImageVersionResource) provisionSpecialized(data acceptance.TestData) string { template := ImageResource{}.setupManagedDisks(data) return fmt.Sprintf(` diff --git a/internal/services/compute/validate/dedicated_host_group_id.go b/internal/services/compute/validate/dedicated_host_group_id.go deleted file mode 100644 index 94f6c944dcca8..0000000000000 --- a/internal/services/compute/validate/dedicated_host_group_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" -) - -func DedicatedHostGroupID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.DedicatedHostGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/compute/validate/dedicated_host_group_id_test.go b/internal/services/compute/validate/dedicated_host_group_id_test.go deleted file mode 100644 index 2c2af34a70c0e..0000000000000 --- a/internal/services/compute/validate/dedicated_host_group_id_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestDedicatedHostGroupID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/", - Valid: false, - }, - - { - // missing value for HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.COMPUTE/HOSTGROUPS/HOSTGROUP1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := DedicatedHostGroupID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/compute/validate/dedicated_host_id.go b/internal/services/compute/validate/dedicated_host_id.go deleted file mode 100644 index 2aaf7be23fd53..0000000000000 --- a/internal/services/compute/validate/dedicated_host_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" -) - -func DedicatedHostID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.DedicatedHostID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/compute/validate/dedicated_host_id_test.go b/internal/services/compute/validate/dedicated_host_id_test.go deleted file mode 100644 index 359fdd9f7cadb..0000000000000 --- a/internal/services/compute/validate/dedicated_host_id_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestDedicatedHostID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/", - Valid: false, - }, - - { - // missing value for HostGroupName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/", - Valid: false, - }, - - { - // missing HostName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/", - Valid: false, - }, - - { - // missing value for HostName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/hosts/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/hostGroup1/hosts/host1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.COMPUTE/HOSTGROUPS/HOSTGROUP1/HOSTS/HOST1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := DedicatedHostID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/compute/windows_virtual_machine_resource.go b/internal/services/compute/windows_virtual_machine_resource.go index 80d99e387c074..1bdd33e700eef 100644 --- a/internal/services/compute/windows_virtual_machine_resource.go +++ b/internal/services/compute/windows_virtual_machine_resource.go @@ -12,6 +12,8 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -152,7 +154,7 @@ func resourceWindowsVirtualMachine() *pluginsdk.Resource { "dedicated_host_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: computeValidate.DedicatedHostID, + ValidateFunc: dedicatedhosts.ValidateHostID, // the Compute/VM API is broken and returns the Resource Group name in UPPERCASE :shrug: // tracked by https://github.com/Azure/azure-rest-api-specs/issues/19424 DiffSuppressFunc: suppress.CaseDifference, @@ -164,7 +166,7 @@ func resourceWindowsVirtualMachine() *pluginsdk.Resource { "dedicated_host_group_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: computeValidate.DedicatedHostGroupID, + ValidateFunc: dedicatedhostgroups.ValidateHostGroupID, // the Compute/VM API is broken and returns the Resource Group name in UPPERCASE // tracked by https://github.com/Azure/azure-rest-api-specs/issues/19424 DiffSuppressFunc: suppress.CaseDifference, @@ -194,8 +196,8 @@ func resourceWindowsVirtualMachine() *pluginsdk.Resource { Optional: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - // NOTE: whilst Delete is an option here, it's only applicable for VMSS string(compute.VirtualMachineEvictionPolicyTypesDeallocate), + string(compute.VirtualMachineEvictionPolicyTypesDelete), }, false), }, diff --git a/internal/services/compute/windows_virtual_machine_resource_disk_os_test.go b/internal/services/compute/windows_virtual_machine_resource_disk_os_test.go index 16261a27a83c1..8fa9c294d283c 100644 --- a/internal/services/compute/windows_virtual_machine_resource_disk_os_test.go +++ b/internal/services/compute/windows_virtual_machine_resource_disk_os_test.go @@ -156,6 +156,21 @@ func TestAccWindowsVirtualMachine_diskOSEphemeralDefault(t *testing.T) { }) } +func TestAccWindowsVirtualMachine_diskOSEphemeralSpot(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_virtual_machine", "test") + r := WindowsVirtualMachineResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.diskOSEphemeralSpot(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("admin_password"), + }) +} + func TestAccWindowsVirtualMachine_diskOSEphemeralResourceDisk(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_windows_virtual_machine", "test") r := WindowsVirtualMachineResource{} @@ -709,6 +724,43 @@ resource "azurerm_windows_virtual_machine" "test" { `, r.template(data)) } +func (r WindowsVirtualMachineResource) diskOSEphemeralSpot(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_windows_virtual_machine" "test" { + name = local.vm_name + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + # Message="OS disk of Ephemeral VM with size greater than 32 GB is not allowed for VM size Standard_F2s_v2" + size = "Standard_DS3_v2" + admin_username = "adminuser" + admin_password = "P@$$w0rd1234!" + priority = "Spot" + eviction_policy = "Delete" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + os_disk { + caching = "ReadOnly" + storage_account_type = "Standard_LRS" + + diff_disk_settings { + option = "Local" + } + } + + source_image_reference { + publisher = "MicrosoftWindowsServer" + offer = "WindowsServer" + sku = "2016-Datacenter" + version = "latest" + } +} +`, r.template(data)) +} + func (r WindowsVirtualMachineResource) diskOSEphemeralResourceDisk(data acceptance.TestData) string { return fmt.Sprintf(` %s diff --git a/internal/services/costmanagement/client/client.go b/internal/services/costmanagement/client/client.go index 7aad7f59b1743..a72e8e4735ebb 100644 --- a/internal/services/costmanagement/client/client.go +++ b/internal/services/costmanagement/client/client.go @@ -1,16 +1,16 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement" + "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - ExportClient *costmanagement.ExportsClient + ExportClient *exports.ExportsClient } func NewClient(o *common.ClientOptions) *Client { - ExportClient := costmanagement.NewExportsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + ExportClient := exports.NewExportsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&ExportClient.Client, o.ResourceManagerAuthorizer) return &Client{ diff --git a/internal/services/costmanagement/export_base_resource.go b/internal/services/costmanagement/export_base_resource.go index cb8ea970ab31e..5595512d9900e 100644 --- a/internal/services/costmanagement/export_base_resource.go +++ b/internal/services/costmanagement/export_base_resource.go @@ -5,11 +5,10 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement" - "github.com/Azure/go-autorest/autorest/date" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/costmanagement/parse" storageParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/parse" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -31,10 +30,10 @@ func (br costManagementExportBaseResource) arguments(fields map[string]*pluginsd Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(costmanagement.RecurrenceTypeDaily), - string(costmanagement.RecurrenceTypeWeekly), - string(costmanagement.RecurrenceTypeMonthly), - string(costmanagement.RecurrenceTypeAnnually), + string(exports.RecurrenceTypeDaily), + string(exports.RecurrenceTypeWeekly), + string(exports.RecurrenceTypeMonthly), + string(exports.RecurrenceTypeAnnually), }, false), }, @@ -82,9 +81,9 @@ func (br costManagementExportBaseResource) arguments(fields map[string]*pluginsd Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(costmanagement.ExportTypeActualCost), - string(costmanagement.ExportTypeAmortizedCost), - string(costmanagement.ExportTypeUsage), + string(exports.ExportTypeActualCost), + string(exports.ExportTypeAmortizedCost), + string(exports.ExportTypeUsage), }, false), }, @@ -92,12 +91,12 @@ func (br costManagementExportBaseResource) arguments(fields map[string]*pluginsd Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(costmanagement.Custom), - string(costmanagement.BillingMonthToDate), - string(costmanagement.TheLastBillingMonth), - string(costmanagement.TheLastMonth), - string(costmanagement.WeekToDate), - string(costmanagement.MonthToDate), + string(exports.TimeframeTypeCustom), + string(exports.TimeframeTypeBillingMonthToDate), + string(exports.TimeframeTypeTheLastBillingMonth), + string(exports.TimeframeTypeTheLastMonth), + string(exports.TimeframeTypeWeekToDate), + string(exports.TimeframeTypeMonthToDate), }, false), }, }, @@ -121,15 +120,16 @@ func (br costManagementExportBaseResource) createFunc(resourceName, scopeFieldNa Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.CostManagement.ExportClient - id := parse.NewCostManagementExportId(metadata.ResourceData.Get(scopeFieldName).(string), metadata.ResourceData.Get("name").(string)) - existing, err := client.Get(ctx, id.Scope, id.Name, "") + id := exports.NewScopedExportID(metadata.ResourceData.Get(scopeFieldName).(string), metadata.ResourceData.Get("name").(string)) + var opts exports.GetOperationOptions + existing, err := client.Get(ctx, id, opts) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError(resourceName, id.ID()) } @@ -149,46 +149,48 @@ func (br costManagementExportBaseResource) readFunc(scopeFieldName string) sdk.R Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.CostManagement.ExportClient - id, err := parse.CostManagementExportID(metadata.ResourceData.Id()) + id, err := exports.ParseScopedExportID(metadata.ResourceData.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.Scope, id.Name, "") + var opts exports.GetOperationOptions + resp, err := client.Get(ctx, *id, opts) if err != nil { - if !utils.ResponseWasNotFound(resp.Response) { + if !response.WasNotFound(resp.HttpResponse) { return metadata.MarkAsGone(id) } return fmt.Errorf("reading %s: %+v", *id, err) } - metadata.ResourceData.Set("name", id.Name) + metadata.ResourceData.Set("name", id.ExportName) //lintignore:R001 metadata.ResourceData.Set(scopeFieldName, id.Scope) - if schedule := resp.Schedule; schedule != nil { - if recurrencePeriod := schedule.RecurrencePeriod; recurrencePeriod != nil { - metadata.ResourceData.Set("recurrence_period_start_date", recurrencePeriod.From.Format(time.RFC3339)) - metadata.ResourceData.Set("recurrence_period_end_date", recurrencePeriod.To.Format(time.RFC3339)) + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + if schedule := props.Schedule; schedule != nil { + if recurrencePeriod := schedule.RecurrencePeriod; recurrencePeriod != nil { + metadata.ResourceData.Set("recurrence_period_start_date", recurrencePeriod.From) + metadata.ResourceData.Set("recurrence_period_end_date", recurrencePeriod.To) + } + status := *schedule.Status == exports.StatusTypeActive + + metadata.ResourceData.Set("active", status) + metadata.ResourceData.Set("recurrence_type", schedule.Recurrence) + } + + exportDeliveryInfo, err := flattenExportDataStorageLocation(&props.DeliveryInfo) + if err != nil { + return fmt.Errorf("flattening `export_data_storage_location`: %+v", err) + } + if err := metadata.ResourceData.Set("export_data_storage_location", exportDeliveryInfo); err != nil { + return fmt.Errorf("setting `export_data_storage_location`: %+v", err) + } + if err := metadata.ResourceData.Set("export_data_options", flattenExportDefinition(&props.Definition)); err != nil { + return fmt.Errorf("setting `export_data_options`: %+v", err) + } } - - status := schedule.Status == costmanagement.Active - - metadata.ResourceData.Set("active", status) - metadata.ResourceData.Set("recurrence_type", schedule.Recurrence) - } - - exportDeliveryInfo, err := flattenExportDataStorageLocation(resp.DeliveryInfo) - if err != nil { - return fmt.Errorf("flattening `export_data_storage_location`: %+v", err) - } - - if err := metadata.ResourceData.Set("export_data_storage_location", exportDeliveryInfo); err != nil { - return fmt.Errorf("setting `export_data_storage_location`: %+v", err) - } - - if err := metadata.ResourceData.Set("export_data_options", flattenExportDefinition(resp.Definition)); err != nil { - return fmt.Errorf("setting `export_data_options`: %+v", err) } return nil @@ -202,12 +204,12 @@ func (br costManagementExportBaseResource) deleteFunc() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.CostManagement.ExportClient - id, err := parse.CostManagementExportID(metadata.ResourceData.Id()) + id, err := exports.ParseScopedExportID(metadata.ResourceData.Id()) if err != nil { return err } - if _, err = client.Delete(ctx, id.Scope, id.Name); err != nil { + if _, err = client.Delete(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } @@ -222,20 +224,25 @@ func (br costManagementExportBaseResource) updateFunc() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.CostManagement.ExportClient - id, err := parse.CostManagementExportID(metadata.ResourceData.Id()) + id, err := exports.ParseScopedExportID(metadata.ResourceData.Id()) if err != nil { return err } // Update operation requires latest eTag to be set in the request. - resp, err := client.Get(ctx, id.Scope, id.Name, "") + var opts exports.GetOperationOptions + resp, err := client.Get(ctx, *id, opts) if err != nil { return fmt.Errorf("reading %s: %+v", *id, err) } - if resp.ETag == nil { - return fmt.Errorf("add %s: etag was nil", *id) + + if model := resp.Model; model != nil { + if model.ETag == nil { + return fmt.Errorf("add %s: etag was nil", *id) + } } - if err := createOrUpdateCostManagementExport(ctx, client, metadata, *id, resp.ETag); err != nil { + + if err := createOrUpdateCostManagementExport(ctx, client, metadata, *id, resp.Model.ETag); err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } @@ -244,13 +251,10 @@ func (br costManagementExportBaseResource) updateFunc() sdk.ResourceFunc { } } -func createOrUpdateCostManagementExport(ctx context.Context, client *costmanagement.ExportsClient, metadata sdk.ResourceMetaData, id parse.CostManagementExportId, etag *string) error { - from, _ := time.Parse(time.RFC3339, metadata.ResourceData.Get("recurrence_period_start_date").(string)) - to, _ := time.Parse(time.RFC3339, metadata.ResourceData.Get("recurrence_period_end_date").(string)) - - status := costmanagement.Active +func createOrUpdateCostManagementExport(ctx context.Context, client *exports.ExportsClient, metadata sdk.ResourceMetaData, id exports.ScopedExportId, etag *string) error { + status := exports.StatusTypeActive if v := metadata.ResourceData.Get("active"); !v.(bool) { - status = costmanagement.Inactive + status = exports.StatusTypeInactive } deliveryInfo, err := expandExportDataStorageLocation(metadata.ResourceData.Get("export_data_storage_location").([]interface{})) @@ -258,29 +262,31 @@ func createOrUpdateCostManagementExport(ctx context.Context, client *costmanagem return fmt.Errorf("expanding `export_data_storage_location`: %+v", err) } - props := costmanagement.Export{ + format := exports.FormatTypeCsv + recurrenceType := exports.RecurrenceType(metadata.ResourceData.Get("recurrence_type").(string)) + props := exports.Export{ ETag: etag, - ExportProperties: &costmanagement.ExportProperties{ - Schedule: &costmanagement.ExportSchedule{ - Recurrence: costmanagement.RecurrenceType(metadata.ResourceData.Get("recurrence_type").(string)), - RecurrencePeriod: &costmanagement.ExportRecurrencePeriod{ - From: &date.Time{Time: from}, - To: &date.Time{Time: to}, + Properties: &exports.ExportProperties{ + Schedule: &exports.ExportSchedule{ + Recurrence: &recurrenceType, + RecurrencePeriod: &exports.ExportRecurrencePeriod{ + From: metadata.ResourceData.Get("recurrence_period_start_date").(string), + To: utils.String(metadata.ResourceData.Get("recurrence_period_end_date").(string)), }, - Status: status, + Status: &status, }, - DeliveryInfo: deliveryInfo, - Format: costmanagement.Csv, - Definition: expandExportDefinition(metadata.ResourceData.Get("export_data_options").([]interface{})), + DeliveryInfo: *deliveryInfo, + Format: &format, + Definition: *expandExportDefinition(metadata.ResourceData.Get("export_data_options").([]interface{})), }, } - _, err = client.CreateOrUpdate(ctx, id.Scope, id.Name, props) + _, err = client.CreateOrUpdate(ctx, id, props) return err } -func expandExportDataStorageLocation(input []interface{}) (*costmanagement.ExportDeliveryInfo, error) { +func expandExportDataStorageLocation(input []interface{}) (*exports.ExportDeliveryInfo, error) { if len(input) == 0 || input[0] == nil { return nil, nil } @@ -293,10 +299,10 @@ func expandExportDataStorageLocation(input []interface{}) (*costmanagement.Expor storageId := storageParse.NewStorageAccountID(containerId.SubscriptionId, containerId.ResourceGroup, containerId.StorageAccountName) - deliveryInfo := &costmanagement.ExportDeliveryInfo{ - Destination: &costmanagement.ExportDeliveryDestination{ - ResourceID: utils.String(storageId.ID()), - Container: utils.String(containerId.ContainerName), + deliveryInfo := &exports.ExportDeliveryInfo{ + Destination: exports.ExportDeliveryDestination{ + ResourceId: utils.String(storageId.ID()), + Container: containerId.ContainerName, RootFolderPath: utils.String(attrs["root_folder_path"].(string)), }, } @@ -304,22 +310,22 @@ func expandExportDataStorageLocation(input []interface{}) (*costmanagement.Expor return deliveryInfo, nil } -func expandExportDefinition(input []interface{}) *costmanagement.ExportDefinition { +func expandExportDefinition(input []interface{}) *exports.ExportDefinition { if len(input) == 0 || input[0] == nil { return nil } attrs := input[0].(map[string]interface{}) - definitionInfo := &costmanagement.ExportDefinition{ - Type: costmanagement.ExportType(attrs["type"].(string)), - Timeframe: costmanagement.TimeframeType(attrs["time_frame"].(string)), + definitionInfo := &exports.ExportDefinition{ + Type: exports.ExportType(attrs["type"].(string)), + Timeframe: exports.TimeframeType(attrs["time_frame"].(string)), } return definitionInfo } -func flattenExportDataStorageLocation(input *costmanagement.ExportDeliveryInfo) ([]interface{}, error) { - if input == nil || input.Destination == nil { +func flattenExportDataStorageLocation(input *exports.ExportDeliveryInfo) ([]interface{}, error) { + if input == nil { return []interface{}{}, nil } @@ -327,7 +333,7 @@ func flattenExportDataStorageLocation(input *costmanagement.ExportDeliveryInfo) var err error var storageAccountId *storageParse.StorageAccountId - if v := destination.ResourceID; v != nil { + if v := destination.ResourceId; v != nil { storageAccountId, err = storageParse.StorageAccountID(*v) if err != nil { return nil, err @@ -335,8 +341,8 @@ func flattenExportDataStorageLocation(input *costmanagement.ExportDeliveryInfo) } containerId := "" - if v := destination.Container; v != nil && storageAccountId != nil { - containerId = storageParse.NewStorageContainerResourceManagerID(storageAccountId.SubscriptionId, storageAccountId.ResourceGroup, storageAccountId.Name, "default", *v).ID() + if v := destination.Container; v != "" && storageAccountId != nil { + containerId = storageParse.NewStorageContainerResourceManagerID(storageAccountId.SubscriptionId, storageAccountId.ResourceGroup, storageAccountId.Name, "default", v).ID() } rootFolderPath := "" @@ -352,7 +358,7 @@ func flattenExportDataStorageLocation(input *costmanagement.ExportDeliveryInfo) }, nil } -func flattenExportDefinition(input *costmanagement.ExportDefinition) []interface{} { +func flattenExportDefinition(input *exports.ExportDefinition) []interface{} { if input == nil { return []interface{}{} } diff --git a/internal/services/costmanagement/export_resource_group_resource_test.go b/internal/services/costmanagement/export_resource_group_resource_test.go index ef412cef48f67..650a40b50852f 100644 --- a/internal/services/costmanagement/export_resource_group_resource_test.go +++ b/internal/services/costmanagement/export_resource_group_resource_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/costmanagement/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -79,17 +79,18 @@ func TestAccResourceGroupCostManagementExport_requiresImport(t *testing.T) { } func (t ResourceGroupCostManagementExport) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.CostManagementExportID(state.ID) + id, err := exports.ParseScopedExportID(state.ID) if err != nil { return nil, err } - resp, err := clients.CostManagement.ExportClient.Get(ctx, id.Scope, id.Name, "") + var opts exports.GetOperationOptions + resp, err := clients.CostManagement.ExportClient.Get(ctx, *id, opts) if err != nil { return nil, fmt.Errorf("retrieving (%s): %+v", *id, err) } - return utils.Bool(resp.ExportProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } func (ResourceGroupCostManagementExport) basic(data acceptance.TestData) string { diff --git a/internal/services/costmanagement/export_subscription_resource_test.go b/internal/services/costmanagement/export_subscription_resource_test.go index f4cd5e6460ca7..905ab865b5512 100644 --- a/internal/services/costmanagement/export_subscription_resource_test.go +++ b/internal/services/costmanagement/export_subscription_resource_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/costmanagement/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -79,17 +79,18 @@ func TestAccSubscriptionCostManagementExport_requiresImport(t *testing.T) { } func (t SubscriptionCostManagementExport) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.CostManagementExportID(state.ID) + id, err := exports.ParseScopedExportID(state.ID) if err != nil { return nil, err } - resp, err := clients.CostManagement.ExportClient.Get(ctx, id.Scope, id.Name, "") + var opts exports.GetOperationOptions + resp, err := clients.CostManagement.ExportClient.Get(ctx, *id, opts) if err != nil { return nil, fmt.Errorf("retrieving (%s): %+v", *id, err) } - return utils.Bool(resp.ExportProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } func (SubscriptionCostManagementExport) basic(data acceptance.TestData) string { diff --git a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go index 2dfb91140b61c..78aa78d2a01b1 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go +++ b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource.go @@ -111,6 +111,21 @@ func resourceDataFactoryIntegrationRuntimeAzureSsis() *pluginsdk.Resource { }, false), }, + "express_vnet_integration": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "subnet_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: networkValidate.SubnetID, + }, + }, + }, + }, + "license_type": { Type: pluginsdk.TypeString, Optional: true, @@ -450,8 +465,9 @@ func resourceDataFactoryIntegrationRuntimeAzureSsisCreateUpdate(d *pluginsdk.Res Description: &description, Type: datafactory.TypeBasicIntegrationRuntimeTypeManaged, ManagedIntegrationRuntimeTypeProperties: &datafactory.ManagedIntegrationRuntimeTypeProperties{ - ComputeProperties: expandDataFactoryIntegrationRuntimeAzureSsisComputeProperties(d), - SsisProperties: expandDataFactoryIntegrationRuntimeAzureSsisProperties(d), + ComputeProperties: expandDataFactoryIntegrationRuntimeAzureSsisComputeProperties(d), + SsisProperties: expandDataFactoryIntegrationRuntimeAzureSsisProperties(d), + CustomerVirtualNetwork: expandDataFactoryIntegrationRuntimeCustomerVirtualNetwork(d.Get("express_vnet_integration").([]interface{})), }, } @@ -552,6 +568,10 @@ func resourceDataFactoryIntegrationRuntimeAzureSsisRead(d *pluginsdk.ResourceDat } } + if err := d.Set("express_vnet_integration", flattenDataFactoryIntegrationRuntimeCustomerVnetIntegration(managedIntegrationRuntime.CustomerVirtualNetwork)); err != nil { + return fmt.Errorf("setting `express_vnet_integration`: %+v", err) + } + return nil } @@ -797,6 +817,16 @@ func expandDataFactoryIntegrationRuntimeAzureSsisKeyVaultSecretReference(input [ return reference } +func expandDataFactoryIntegrationRuntimeCustomerVirtualNetwork(input []interface{}) *datafactory.IntegrationRuntimeCustomerVirtualNetwork { + if len(input) == 0 || input[0] == nil { + return nil + } + raw := input[0].(map[string]interface{}) + return &datafactory.IntegrationRuntimeCustomerVirtualNetwork{ + SubnetID: utils.String(raw["subnet_id"].(string)), + } +} + func flattenDataFactoryIntegrationRuntimeAzureSsisVnetIntegration(vnetProperties *datafactory.IntegrationRuntimeVNetProperties) []interface{} { if vnetProperties == nil { return []interface{}{} @@ -1047,6 +1077,21 @@ func flattenDataFactoryIntegrationRuntimeAzureSsisKeyVaultSecretReference(input } } +func flattenDataFactoryIntegrationRuntimeCustomerVnetIntegration(input *datafactory.IntegrationRuntimeCustomerVirtualNetwork) []interface{} { + if input == nil { + return []interface{}{} + } + subnetId := "" + if input.SubnetID != nil { + subnetId = *input.SubnetID + } + return []interface{}{ + map[string]interface{}{ + "subnet_id": subnetId, + }, + } +} + func readBackSensitiveValue(input []interface{}, propertyName string, filters map[string]string) string { if len(input) == 0 { return "" diff --git a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource_test.go b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource_test.go index 18cb0124a1e26..a5b0b13b513bb 100644 --- a/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource_test.go +++ b/internal/services/datafactory/data_factory_integration_runtime_azure_ssis_resource_test.go @@ -147,6 +147,21 @@ func TestAccDataFactoryIntegrationRuntimeManagedSsis_aadAuth(t *testing.T) { }) } +func TestAccDataFactoryIntegrationRuntimeManagedSsis_expressVnetInjection(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_factory_integration_runtime_azure_ssis", "test") + r := IntegrationRuntimeManagedSsisResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.expressVnetInjection(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func (IntegrationRuntimeManagedSsisResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -708,6 +723,49 @@ resource "azurerm_data_factory_integration_runtime_azure_ssis" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } +func (IntegrationRuntimeManagedSsisResource) expressVnetInjection(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-df-%[1]d" + location = "%[2]s" +} + +resource "azurerm_virtual_network" "test" { + name = "acctestvnet%[1]d" + address_space = ["10.0.0.0/16"] + location = "${azurerm_resource_group.test.location}" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_subnet" "test" { + name = "acctestsubnet%[1]d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefixes = ["10.0.2.0/24"] +} + +resource "azurerm_data_factory" "test" { + name = "acctestdfirm%[1]d" + location = "${azurerm_resource_group.test.location}" + resource_group_name = "${azurerm_resource_group.test.name}" +} + +resource "azurerm_data_factory_integration_runtime_azure_ssis" "test" { + name = "managed-integration-runtime" + data_factory_id = azurerm_data_factory.test.id + location = azurerm_resource_group.test.location + node_size = "Standard_D8_v3" + express_vnet_integration { + subnet_id = azurerm_subnet.test.id + } +} +`, data.RandomInteger, data.Locations.Primary) +} + func (t IntegrationRuntimeManagedSsisResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { id, err := parse.IntegrationRuntimeID(state.ID) if err != nil { diff --git a/internal/services/dns/dns_a_record_data_source.go b/internal/services/dns/dns_a_record_data_source.go new file mode 100644 index 0000000000000..e28f79570eaf3 --- /dev/null +++ b/internal/services/dns/dns_a_record_data_source.go @@ -0,0 +1,104 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsARecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsARecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "records": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString}, + Set: pluginsdk.HashString, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "target_resource_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsARecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.A) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS A record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS A record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewARecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("records", flattenAzureRmDnsARecords(resp.ARecords)); err != nil { + return fmt.Errorf("setting `records`: %+v", err) + } + + targetResourceId := "" + if resp.TargetResource != nil && resp.TargetResource.ID != nil { + targetResourceId = *resp.TargetResource.ID + } + d.Set("target_resource_id", targetResourceId) + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_a_record_data_source_test.go b/internal/services/dns/dns_a_record_data_source_test.go new file mode 100644 index 0000000000000..26f2d0631c371 --- /dev/null +++ b/internal/services/dns/dns_a_record_data_source_test.go @@ -0,0 +1,44 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type TestAccDnsARecordDataSource struct{} + +func TestAccDataSourceDnsARecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_a_record", "test") + r := TestAccDnsARecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("records.#").HasValue("2"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + check.That(data.ResourceName).Key("target_resource_id").HasValue(""), + ), + }, + }) +} + +func (TestAccDnsARecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_a_record" "test" { + name = azurerm_dns_a_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, TestAccDnsARecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_aaaa_record_data_source.go b/internal/services/dns/dns_aaaa_record_data_source.go new file mode 100644 index 0000000000000..cec8d0957089c --- /dev/null +++ b/internal/services/dns/dns_aaaa_record_data_source.go @@ -0,0 +1,105 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/set" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsAAAARecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsAAAARecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "records": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString}, + Set: set.HashIPv6Address, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "target_resource_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsAAAARecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.AAAA) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS AAAA record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS AAAA record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewAaaaRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("records", flattenAzureRmDnsAaaaRecords(resp.AaaaRecords)); err != nil { + return fmt.Errorf("setting `records`: %+v", err) + } + + targetResourceId := "" + if resp.TargetResource != nil && resp.TargetResource.ID != nil { + targetResourceId = *resp.TargetResource.ID + } + d.Set("target_resource_id", targetResourceId) + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_aaaa_record_data_source_test.go b/internal/services/dns/dns_aaaa_record_data_source_test.go new file mode 100644 index 0000000000000..5707601fe17fe --- /dev/null +++ b/internal/services/dns/dns_aaaa_record_data_source_test.go @@ -0,0 +1,44 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsAAAARecordDataSource struct{} + +func TestAccDataSourceDnsAAAARecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_aaaa_record", "test") + r := DnsAAAARecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("records.#").HasValue("2"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + check.That(data.ResourceName).Key("target_resource_id").HasValue(""), + ), + }, + }) +} + +func (DnsAAAARecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_aaaa_record" "test" { + name = azurerm_dns_aaaa_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsAAAARecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_caa_record_data_source.go b/internal/services/dns/dns_caa_record_data_source.go new file mode 100644 index 0000000000000..760e2fb4fb9ce --- /dev/null +++ b/internal/services/dns/dns_caa_record_data_source.go @@ -0,0 +1,110 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsCaaRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsCaaRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "record": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "flags": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "tag": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "value": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + Set: resourceDnsCaaRecordHash, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsCaaRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.CAA) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS CAA record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS CAA record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewCaaRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("record", flattenAzureRmDnsCaaRecords(resp.CaaRecords)); err != nil { + return err + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_caa_record_data_source_test.go b/internal/services/dns/dns_caa_record_data_source_test.go new file mode 100644 index 0000000000000..4d1574cf99614 --- /dev/null +++ b/internal/services/dns/dns_caa_record_data_source_test.go @@ -0,0 +1,43 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsCaaRecordDataSource struct{} + +func TestAccDataSourceDnsCaaRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_caa_record", "test") + r := DnsCaaRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("record.#").HasValue("4"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsCaaRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_caa_record" "test" { + name = azurerm_dns_caa_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsCaaRecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_cname_record_data_source.go b/internal/services/dns/dns_cname_record_data_source.go new file mode 100644 index 0000000000000..c0c82681857a7 --- /dev/null +++ b/internal/services/dns/dns_cname_record_data_source.go @@ -0,0 +1,106 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsCNameRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsCNameRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "record": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "target_resource_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsCNameRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.CNAME) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS CNAME record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS CNAME record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewCnameRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if props := resp.RecordSetProperties; props != nil { + cname := "" + if props.CnameRecord != nil && props.CnameRecord.Cname != nil { + cname = *props.CnameRecord.Cname + } + d.Set("record", cname) + + targetResourceId := "" + if props.TargetResource != nil && props.TargetResource.ID != nil { + targetResourceId = *props.TargetResource.ID + } + d.Set("target_resource_id", targetResourceId) + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_cname_record_data_source_test.go b/internal/services/dns/dns_cname_record_data_source_test.go new file mode 100644 index 0000000000000..aba24f4ed012f --- /dev/null +++ b/internal/services/dns/dns_cname_record_data_source_test.go @@ -0,0 +1,43 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsCNameRecordDataSource struct{} + +func TestAccDataSourceDnsCNameRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_cname_record", "test") + r := DnsCNameRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("record").HasValue("contoso.com"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsCNameRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_cname_record" "test" { + name = azurerm_dns_cname_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsCNameRecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_mx_record_data_source.go b/internal/services/dns/dns_mx_record_data_source.go new file mode 100644 index 0000000000000..d94bff0ecef26 --- /dev/null +++ b/internal/services/dns/dns_mx_record_data_source.go @@ -0,0 +1,106 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsMxRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsMxRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Optional: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "record": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "preference": { + // TODO: this should become an Int + Type: pluginsdk.TypeString, + Computed: true, + }, + + "exchange": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + Set: resourceDnsMxRecordHash, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsMxRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.MX) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS MX record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS MX record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewMxRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("record", flattenAzureRmDnsMxRecords(resp.MxRecords)); err != nil { + return err + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_mx_record_data_source_test.go b/internal/services/dns/dns_mx_record_data_source_test.go new file mode 100644 index 0000000000000..d9e2747a3cc5e --- /dev/null +++ b/internal/services/dns/dns_mx_record_data_source_test.go @@ -0,0 +1,43 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsMxRecordDataSource struct{} + +func TestAccDataSourceDnsMxRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_mx_record", "test") + r := DnsMxRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("record.#").HasValue("2"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsMxRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_mx_record" "test" { + name = azurerm_dns_mx_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsMxRecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_ns_record_data_source.go b/internal/services/dns/dns_ns_record_data_source.go new file mode 100644 index 0000000000000..32021e082d36f --- /dev/null +++ b/internal/services/dns/dns_ns_record_data_source.go @@ -0,0 +1,94 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsNsRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsNsRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "records": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsNsRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.NS) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS NS record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS NS record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewNsRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("records", flattenAzureRmDnsNsRecords(resp.NsRecords)); err != nil { + return fmt.Errorf("settings `records`: %+v", err) + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_ns_record_data_source_test.go b/internal/services/dns/dns_ns_record_data_source_test.go new file mode 100644 index 0000000000000..2c19ae637224c --- /dev/null +++ b/internal/services/dns/dns_ns_record_data_source_test.go @@ -0,0 +1,43 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsNsRecordDataSource struct{} + +func TestAccDataSourceDnsNsRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_ns_record", "test") + r := DnsNsRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("records.#").HasValue("2"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsNsRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_ns_record" "test" { + name = azurerm_dns_ns_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsNsRecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_ptr_record_data_source.go b/internal/services/dns/dns_ptr_record_data_source.go new file mode 100644 index 0000000000000..0fb1a5183de8f --- /dev/null +++ b/internal/services/dns/dns_ptr_record_data_source.go @@ -0,0 +1,93 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsPtrRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsPtrRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "records": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString}, + Set: pluginsdk.HashString, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsPtrRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.PTR) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS PTR record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS PTR record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewPtrRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("records", flattenAzureRmDnsPtrRecords(resp.PtrRecords)); err != nil { + return err + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_ptr_record_data_source_test.go b/internal/services/dns/dns_ptr_record_data_source_test.go new file mode 100644 index 0000000000000..289069ad6daca --- /dev/null +++ b/internal/services/dns/dns_ptr_record_data_source_test.go @@ -0,0 +1,43 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsPtrRecordDataSource struct{} + +func TestAccDataSourceDnsPtrRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_ptr_record", "test") + r := DnsPtrRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("records.#").HasValue("2"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsPtrRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_ptr_record" "test" { + name = azurerm_dns_ptr_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsPtrRecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_soa_record_data_source.go b/internal/services/dns/dns_soa_record_data_source.go new file mode 100644 index 0000000000000..8e2c37e2552ec --- /dev/null +++ b/internal/services/dns/dns_soa_record_data_source.go @@ -0,0 +1,126 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsSoaRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsSoaRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Optional: true, + Default: "@", + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "email": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "host_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "expire_time": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "minimum_ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "refresh_time": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "retry_time": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "serial_number": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsSoaRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, "@", dns.SOA) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS SOA record (zone %s) was not found", zoneName) + } + return fmt.Errorf("reading DNS SOA record (zone %s): %+v", zoneName, err) + } + + resourceId := parse.NewSoaRecordID(subscriptionId, resourceGroup, zoneName, "@") + d.SetId(resourceId.ID()) + + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if soaRecord := resp.SoaRecord; soaRecord != nil { + d.Set("email", soaRecord.Email) + d.Set("host_name", soaRecord.Host) + d.Set("expire_time", soaRecord.ExpireTime) + d.Set("minimum_ttl", soaRecord.MinimumTTL) + d.Set("refresh_time", soaRecord.RefreshTime) + d.Set("retry_time", soaRecord.RetryTime) + d.Set("serial_number", soaRecord.SerialNumber) + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_soa_record_data_source_test.go b/internal/services/dns/dns_soa_record_data_source_test.go new file mode 100644 index 0000000000000..21272538a98de --- /dev/null +++ b/internal/services/dns/dns_soa_record_data_source_test.go @@ -0,0 +1,72 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsSoaRecordDataSource struct{} + +func TestAccDataSourceDnsSoaRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_soa_record", "test") + r := DnsSoaRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basicWithDataSource(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("name").HasValue("@"), + check.That(data.ResourceName).Key("email").HasValue("testemail.com"), + check.That(data.ResourceName).Key("host_name").HasValue("testhost.contoso.com"), + check.That(data.ResourceName).Key("expire_time").HasValue("2419200"), + check.That(data.ResourceName).Key("minimum_ttl").HasValue("300"), + check.That(data.ResourceName).Key("refresh_time").HasValue("3600"), + check.That(data.ResourceName).Key("retry_time").HasValue("300"), + check.That(data.ResourceName).Key("serial_number").HasValue("1"), + check.That(data.ResourceName).Key("ttl").HasValue("3600"), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsSoaRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_dns_zone" "test" { + name = "acctestzone%d.com" + resource_group_name = azurerm_resource_group.test.name + + soa_record { + email = "testemail.com" + host_name = "testhost.contoso.com" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (d DnsSoaRecordDataSource) basicWithDataSource(data acceptance.TestData) string { + config := d.basic(data) + return fmt.Sprintf(` +%s + +data "azurerm_dns_soa_record" "test" { + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, config) +} diff --git a/internal/services/dns/dns_srv_record_data_source.go b/internal/services/dns/dns_srv_record_data_source.go new file mode 100644 index 0000000000000..2b990f8c7b0c8 --- /dev/null +++ b/internal/services/dns/dns_srv_record_data_source.go @@ -0,0 +1,115 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsSrvRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsSrvRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "record": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "priority": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "weight": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "port": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "target": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + Set: resourceDnsSrvRecordHash, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsSrvRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.SRV) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS SRV record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS SRV record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewSrvRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("record", flattenAzureRmDnsSrvRecords(resp.SrvRecords)); err != nil { + return err + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_srv_record_data_source_test.go b/internal/services/dns/dns_srv_record_data_source_test.go new file mode 100644 index 0000000000000..0383638279b98 --- /dev/null +++ b/internal/services/dns/dns_srv_record_data_source_test.go @@ -0,0 +1,43 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsSrvRecordDataSource struct{} + +func TestAccDataSourceDnsSrvRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_srv_record", "test") + r := DnsSrvRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("record.#").HasValue("2"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsSrvRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_srv_record" "test" { + name = azurerm_dns_srv_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsSrvRecordResource{}.basic(data)) +} diff --git a/internal/services/dns/dns_txt_record_data_source.go b/internal/services/dns/dns_txt_record_data_source.go new file mode 100644 index 0000000000000..11bb141a27e47 --- /dev/null +++ b/internal/services/dns/dns_txt_record_data_source.go @@ -0,0 +1,99 @@ +package dns + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceDnsTxtRecord() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceDnsTxtRecordRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "zone_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "record": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "value": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, + + "ttl": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "fqdn": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.Schema(), + }, + } +} + +func dataSourceDnsTxtRecordRead(d *pluginsdk.ResourceData, meta interface{}) error { + recordSetsClient := meta.(*clients.Client).Dns.RecordSetsClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + zoneName := d.Get("zone_name").(string) + + resp, err := recordSetsClient.Get(ctx, resourceGroup, zoneName, name, dns.TXT) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error: DNS TXT record %s: (zone %s) was not found", name, zoneName) + } + return fmt.Errorf("reading DNS TXT record %s (zone %s): %+v", name, zoneName, err) + } + + resourceId := parse.NewTxtRecordID(subscriptionId, resourceGroup, zoneName, name) + d.SetId(resourceId.ID()) + + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + d.Set("zone_name", zoneName) + + d.Set("ttl", resp.TTL) + d.Set("fqdn", resp.Fqdn) + + if err := d.Set("record", flattenAzureRmDnsTxtRecords(resp.TxtRecords)); err != nil { + return err + } + + return tags.FlattenAndSet(d, resp.Metadata) +} diff --git a/internal/services/dns/dns_txt_record_data_source_test.go b/internal/services/dns/dns_txt_record_data_source_test.go new file mode 100644 index 0000000000000..34937ee4f2abc --- /dev/null +++ b/internal/services/dns/dns_txt_record_data_source_test.go @@ -0,0 +1,43 @@ +package dns_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type DnsTxtRecordDataSource struct{} + +func TestAccDataSourceDnsTxtRecord_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_dns_txt_record", "test") + r := DnsTxtRecordDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("zone_name").Exists(), + check.That(data.ResourceName).Key("record.#").HasValue("2"), + check.That(data.ResourceName).Key("ttl").Exists(), + check.That(data.ResourceName).Key("fqdn").Exists(), + check.That(data.ResourceName).Key("tags.%").HasValue("0"), + ), + }, + }) +} + +func (DnsTxtRecordDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_dns_txt_record" "test" { + name = azurerm_dns_txt_record.test.name + resource_group_name = azurerm_resource_group.test.name + zone_name = azurerm_dns_zone.test.name +} +`, DnsTxtRecordResource{}.basic(data)) +} diff --git a/internal/services/compute/parse/dedicated_host_group.go b/internal/services/dns/parse/soa_record.go similarity index 56% rename from internal/services/compute/parse/dedicated_host_group.go rename to internal/services/dns/parse/soa_record.go index 453a86e5019bc..350c5604a64a7 100644 --- a/internal/services/compute/parse/dedicated_host_group.go +++ b/internal/services/dns/parse/soa_record.go @@ -9,42 +9,45 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) -type DedicatedHostGroupId struct { +type SoaRecordId struct { SubscriptionId string ResourceGroup string - HostGroupName string + DnszoneName string + SOAName string } -func NewDedicatedHostGroupID(subscriptionId, resourceGroup, hostGroupName string) DedicatedHostGroupId { - return DedicatedHostGroupId{ +func NewSoaRecordID(subscriptionId, resourceGroup, dnszoneName, sOAName string) SoaRecordId { + return SoaRecordId{ SubscriptionId: subscriptionId, ResourceGroup: resourceGroup, - HostGroupName: hostGroupName, + DnszoneName: dnszoneName, + SOAName: sOAName, } } -func (id DedicatedHostGroupId) String() string { +func (id SoaRecordId) String() string { segments := []string{ - fmt.Sprintf("Host Group Name %q", id.HostGroupName), + fmt.Sprintf("SOA Name %q", id.SOAName), + fmt.Sprintf("Dnszone Name %q", id.DnszoneName), fmt.Sprintf("Resource Group %q", id.ResourceGroup), } segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Dedicated Host Group", segmentsStr) + return fmt.Sprintf("%s: (%s)", "SOA Record", segmentsStr) } -func (id DedicatedHostGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/hostGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.HostGroupName) +func (id SoaRecordId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/dnszones/%s/SOA/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.DnszoneName, id.SOAName) } -// DedicatedHostGroupID parses a DedicatedHostGroup ID into an DedicatedHostGroupId struct -func DedicatedHostGroupID(input string) (*DedicatedHostGroupId, error) { +// SoaRecordID parses a SOARecord ID into an SoaRecordId struct +func SoaRecordID(input string) (*SoaRecordId, error) { id, err := resourceids.ParseAzureResourceID(input) if err != nil { return nil, err } - resourceId := DedicatedHostGroupId{ + resourceId := SoaRecordId{ SubscriptionId: id.SubscriptionID, ResourceGroup: id.ResourceGroup, } @@ -57,7 +60,10 @@ func DedicatedHostGroupID(input string) (*DedicatedHostGroupId, error) { return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") } - if resourceId.HostGroupName, err = id.PopSegment("hostGroups"); err != nil { + if resourceId.DnszoneName, err = id.PopSegment("dnszones"); err != nil { + return nil, err + } + if resourceId.SOAName, err = id.PopSegment("SOA"); err != nil { return nil, err } diff --git a/internal/services/dns/registration.go b/internal/services/dns/registration.go index 4316c2bb110b5..34bd173367d4e 100644 --- a/internal/services/dns/registration.go +++ b/internal/services/dns/registration.go @@ -28,7 +28,17 @@ func (r Registration) WebsiteCategories() []string { // SupportedDataSources returns the supported Data Sources supported by this Service func (r Registration) SupportedDataSources() map[string]*pluginsdk.Resource { return map[string]*pluginsdk.Resource{ - "azurerm_dns_zone": dataSourceDnsZone(), + "azurerm_dns_a_record": dataSourceDnsARecord(), + "azurerm_dns_aaaa_record": dataSourceDnsAAAARecord(), + "azurerm_dns_caa_record": dataSourceDnsCaaRecord(), + "azurerm_dns_cname_record": dataSourceDnsCNameRecord(), + "azurerm_dns_mx_record": dataSourceDnsMxRecord(), + "azurerm_dns_ns_record": dataSourceDnsNsRecord(), + "azurerm_dns_ptr_record": dataSourceDnsPtrRecord(), + "azurerm_dns_soa_record": dataSourceDnsSoaRecord(), + "azurerm_dns_srv_record": dataSourceDnsSrvRecord(), + "azurerm_dns_txt_record": dataSourceDnsTxtRecord(), + "azurerm_dns_zone": dataSourceDnsZone(), } } diff --git a/internal/services/domainservices/active_directory_domain_service_data_source.go b/internal/services/domainservices/active_directory_domain_service_data_source.go index 2a8321b17ed44..d31b0bb164a4e 100644 --- a/internal/services/domainservices/active_directory_domain_service_data_source.go +++ b/internal/services/domainservices/active_directory_domain_service_data_source.go @@ -129,6 +129,16 @@ func dataSourceActiveDirectoryDomainService() *pluginsdk.Resource { Computed: true, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ + "kerberos_armoring_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "kerberos_rc4_encryption_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + "ntlm_v1_enabled": { Type: pluginsdk.TypeBool, Computed: true, diff --git a/internal/services/domainservices/active_directory_domain_service_resource.go b/internal/services/domainservices/active_directory_domain_service_resource.go index e6a12fec48d9a..82e7b05712153 100644 --- a/internal/services/domainservices/active_directory_domain_service_resource.go +++ b/internal/services/domainservices/active_directory_domain_service_resource.go @@ -210,6 +210,18 @@ func resourceActiveDirectoryDomainService() *pluginsdk.Resource { MaxItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ + "kerberos_armoring_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + + "kerberos_rc4_encryption_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + "ntlm_v1_enabled": { Type: pluginsdk.TypeBool, Optional: true, @@ -634,12 +646,20 @@ func expandDomainServiceSecurity(input []interface{}) *domainservices.DomainSecu } v := input[0].(map[string]interface{}) + kerberosRc4Encryption := domainservices.KerberosRc4EncryptionDisabled + kerberosArmoring := domainservices.KerberosArmoringDisabled ntlmV1 := domainservices.NtlmV1Disabled syncKerberosPasswords := domainservices.SyncKerberosPasswordsDisabled syncNtlmPasswords := domainservices.SyncNtlmPasswordsDisabled syncOnPremPasswords := domainservices.SyncOnPremPasswordsDisabled tlsV1 := domainservices.TlsV1Disabled + if v["kerberos_armoring_enabled"].(bool) { + kerberosArmoring = domainservices.KerberosArmoringEnabled + } + if v["kerberos_rc4_encryption_enabled"].(bool) { + kerberosRc4Encryption = domainservices.KerberosRc4EncryptionEnabled + } if v["ntlm_v1_enabled"].(bool) { ntlmV1 = domainservices.NtlmV1Enabled } @@ -657,6 +677,8 @@ func expandDomainServiceSecurity(input []interface{}) *domainservices.DomainSecu } return &domainservices.DomainSecuritySettings{ + KerberosArmoring: &kerberosArmoring, + KerberosRc4Encryption: &kerberosRc4Encryption, NtlmV1: &ntlmV1, SyncKerberosPasswords: &syncKerberosPasswords, SyncNtlmPasswords: &syncNtlmPasswords, @@ -771,11 +793,19 @@ func flattenDomainServiceSecurity(input *domainservices.DomainSecuritySettings) } result := map[string]bool{ - "ntlm_v1_enabled": false, - "sync_kerberos_passwords": false, - "sync_ntlm_passwords": false, - "sync_on_prem_passwords": false, - "tls_v1_enabled": false, + "kerberos_armoring_enabled": false, + "kerberos_rc4_encryption_enabled": false, + "ntlm_v1_enabled": false, + "sync_kerberos_passwords": false, + "sync_ntlm_passwords": false, + "sync_on_prem_passwords": false, + "tls_v1_enabled": false, + } + if input.KerberosArmoring != nil && *input.KerberosArmoring == domainservices.KerberosArmoringEnabled { + result["kerberos_armoring_enabled"] = true + } + if input.KerberosRc4Encryption != nil && *input.KerberosRc4Encryption == domainservices.KerberosRc4EncryptionEnabled { + result["kerberos_rc4_encryption_enabled"] = true } if input.NtlmV1 != nil && *input.NtlmV1 == domainservices.NtlmV1Enabled { result["ntlm_v1_enabled"] = true diff --git a/internal/services/domainservices/active_directory_domain_service_test.go b/internal/services/domainservices/active_directory_domain_service_test.go index 4ff74847bcb51..2ff4bfc0a7118 100644 --- a/internal/services/domainservices/active_directory_domain_service_test.go +++ b/internal/services/domainservices/active_directory_domain_service_test.go @@ -125,6 +125,8 @@ func TestAccActiveDirectoryDomainService_updateWithDatasource(t *testing.T) { check.That(dataSourceData.ResourceName).Key("secure_ldap.0.external_access_enabled").HasValue("true"), check.That(dataSourceData.ResourceName).Key("secure_ldap.0.public_certificate").Exists(), check.That(dataSourceData.ResourceName).Key("security.#").HasValue("1"), + check.That(dataSourceData.ResourceName).Key("security.0.kerberos_armoring_enabled").HasValue("true"), + check.That(dataSourceData.ResourceName).Key("security.0.kerberos_rc4_encryption_enabled").HasValue("true"), check.That(dataSourceData.ResourceName).Key("security.0.ntlm_v1_enabled").HasValue("true"), check.That(dataSourceData.ResourceName).Key("security.0.sync_kerberos_passwords").HasValue("true"), check.That(dataSourceData.ResourceName).Key("security.0.sync_ntlm_passwords").HasValue("true"), @@ -354,11 +356,13 @@ resource "azurerm_active_directory_domain_service" "test" { } security { - ntlm_v1_enabled = true - sync_kerberos_passwords = true - sync_ntlm_passwords = true - sync_on_prem_passwords = true - tls_v1_enabled = true + kerberos_armoring_enabled = true + kerberos_rc4_encryption_enabled = true + ntlm_v1_enabled = true + sync_kerberos_passwords = true + sync_ntlm_passwords = true + sync_on_prem_passwords = true + tls_v1_enabled = true } tags = { diff --git a/internal/services/eventhub/client/client.go b/internal/services/eventhub/client/client.go index 3bc1ba3640d5e..dba63b7829a57 100644 --- a/internal/services/eventhub/client/client.go +++ b/internal/services/eventhub/client/client.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/eventhubs" "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/eventhubsclusters" "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/networkrulesets" + "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry" "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2022-01-01-preview/namespaces" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -23,6 +24,7 @@ type Client struct { NamespacesClient *namespaces.NamespacesClient NamespaceAuthorizationRulesClient *authorizationrulesnamespaces.AuthorizationRulesNamespacesClient NetworkRuleSetsClient *networkrulesets.NetworkRuleSetsClient + SchemaRegistryClient *schemaregistry.SchemaRegistryClient } func NewClient(o *common.ClientOptions) *Client { @@ -53,6 +55,9 @@ func NewClient(o *common.ClientOptions) *Client { networkRuleSetsClient := networkrulesets.NewNetworkRuleSetsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&networkRuleSetsClient.Client, o.ResourceManagerAuthorizer) + schemaRegistryClient := schemaregistry.NewSchemaRegistryClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&schemaRegistryClient.Client, o.ResourceManagerAuthorizer) + return &Client{ ClusterClient: &clustersClient, ConsumerGroupClient: &consumerGroupsClient, @@ -63,5 +68,6 @@ func NewClient(o *common.ClientOptions) *Client { NamespacesClient: &namespacesClient, NamespaceAuthorizationRulesClient: &namespaceAuthorizationRulesClient, NetworkRuleSetsClient: &networkRuleSetsClient, + SchemaRegistryClient: &schemaRegistryClient, } } diff --git a/internal/services/eventhub/eventhub_namespace_schema_registry_resource.go b/internal/services/eventhub/eventhub_namespace_schema_registry_resource.go new file mode 100644 index 0000000000000..a2e62d4bcc541 --- /dev/null +++ b/internal/services/eventhub/eventhub_namespace_schema_registry_resource.go @@ -0,0 +1,180 @@ +package eventhub + +import ( + "fmt" + "log" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces" + "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry" + "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventhub/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" +) + +func resourceEventHubNamespaceSchemaRegistry() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Create: resourceEventHubNamespaceSchemaRegistryCreateUpdate, + Read: resourceEventHubNamespaceSchemaRegistryRead, + // Update: resourceEventHubNamespaceSchemaRegistryCreateUpdate, + Delete: resourceEventHubNamespaceSchemaRegistryDelete, + + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { + _, err := schemaregistry.ParseSchemaGroupID(id) + return err + }), + + Timeouts: &pluginsdk.ResourceTimeout{ + Create: pluginsdk.DefaultTimeout(30 * time.Minute), + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + // Update: pluginsdk.DefaultTimeout(30 * time.Minute), + Delete: pluginsdk.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.ValidateSchemaGroupName(), + }, + + "namespace_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: namespaces.ValidateNamespaceID, + }, + + "schema_compatibility": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(schemaregistry.SchemaCompatibilityNone), + string(schemaregistry.SchemaCompatibilityBackward), + string(schemaregistry.SchemaCompatibilityForward), + }, false), + }, + + "schema_type": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(schemaregistry.SchemaTypeUnknown), + string(schemaregistry.SchemaTypeAvro), + }, false), + }, + }, + } +} + +func resourceEventHubNamespaceSchemaRegistryCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Eventhub.SchemaRegistryClient + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + log.Printf("[INFO] preparing arguments for AzureRM EventHub Namespace Schema Registry creation.") + + namespaceId, err := namespaces.ParseNamespaceID(d.Get("namespace_id").(string)) + if err != nil { + return fmt.Errorf("parsing eventhub namespace %s error: %+v", namespaceId.ID(), err) + } + + id := schemaregistry.NewSchemaGroupID(subscriptionId, namespaceId.ResourceGroupName, namespaceId.NamespaceName, d.Get("name").(string)) + if d.IsNewResource() { + existing, err := client.Get(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + } + + if existing.Model != nil { + return tf.ImportAsExistsError("azurerm_eventhub_namespace_schema_group", id.ID()) + } + } + + schemaCompatibilityType := schemaregistry.SchemaCompatibility(d.Get("schema_compatibility").(string)) + schemaType := schemaregistry.SchemaType(d.Get("schema_type").(string)) + + parameters := schemaregistry.SchemaGroup{ + Properties: &schemaregistry.SchemaGroupProperties{ + SchemaCompatibility: &schemaCompatibilityType, + SchemaType: &schemaType, + }, + } + + if _, err := client.CreateOrUpdate(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + d.SetId(id.ID()) + + return resourceEventHubNamespaceSchemaRegistryRead(d, meta) +} + +func resourceEventHubNamespaceSchemaRegistryRead(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Eventhub.SchemaRegistryClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := schemaregistry.ParseSchemaGroupID(d.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + d.SetId("") + return nil + } + return fmt.Errorf("making Read request on %s: %+v", id, err) + } + + d.Set("name", id.SchemaGroupName) + + namespaceId := namespaces.NewNamespaceID(id.SubscriptionId, id.ResourceGroupName, id.NamespaceName) + d.Set("namespace_id", namespaceId.ID()) + + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + if props.SchemaCompatibility != nil { + d.Set("schema_compatibility", string(*props.SchemaCompatibility)) + } + if props.SchemaType != nil { + d.Set("schema_type", string(*props.SchemaType)) + } + } + } + + return nil +} + +func resourceEventHubNamespaceSchemaRegistryDelete(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Eventhub.SchemaRegistryClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := schemaregistry.ParseSchemaGroupID(d.Id()) + if err != nil { + return err + } + + resp, err := client.Delete(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return nil + } + + return fmt.Errorf("deleting %s: %+v", id, err) + } + + return nil +} diff --git a/internal/services/eventhub/eventhub_namespace_schema_registry_resource_test.go b/internal/services/eventhub/eventhub_namespace_schema_registry_resource_test.go new file mode 100644 index 0000000000000..cfb779444b81b --- /dev/null +++ b/internal/services/eventhub/eventhub_namespace_schema_registry_resource_test.go @@ -0,0 +1,71 @@ +package eventhub_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type EventHubNamespaceSchemaRegistryResource struct{} + +func TestAccEventHubNamespaceSchemaRegistry_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_eventhub_namespace_schema_group", "test") + r := EventHubNamespaceSchemaRegistryResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r)), + }, + data.ImportStep(), + }) +} + +func (EventHubNamespaceSchemaRegistryResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := schemaregistry.ParseSchemaGroupID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Eventhub.SchemaRegistryClient.Get(ctx, *id) + if err != nil { + return nil, fmt.Errorf("retrieving %s: %v", *id, err) + } + + return utils.Bool(resp.Model != nil), nil +} + +func (EventHubNamespaceSchemaRegistryResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-eventhubSG-%d" + location = "%s" +} + +resource "azurerm_eventhub_namespace" "test" { + name = "acctesteventhubnamespace-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku = "Standard" +} + +resource "azurerm_eventhub_namespace_schema_group" "test" { + name = "acctestsg-%d" + namespace_id = azurerm_eventhub_namespace.test.id + schema_compatibility = "Forward" + schema_type = "Avro" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} diff --git a/internal/services/eventhub/registration.go b/internal/services/eventhub/registration.go index 19db6da0b323f..0edb4cf9a9f3b 100644 --- a/internal/services/eventhub/registration.go +++ b/internal/services/eventhub/registration.go @@ -46,6 +46,7 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_eventhub_namespace_customer_managed_key": resourceEventHubNamespaceCustomerManagedKey(), "azurerm_eventhub_namespace_disaster_recovery_config": resourceEventHubNamespaceDisasterRecoveryConfig(), "azurerm_eventhub_namespace": resourceEventHubNamespace(), + "azurerm_eventhub_namespace_schema_group": resourceEventHubNamespaceSchemaRegistry(), "azurerm_eventhub": resourceEventHub(), } } diff --git a/internal/services/eventhub/validate/eventhub_names.go b/internal/services/eventhub/validate/eventhub_names.go index ed1d5b01801e1..09c0fe01af288 100644 --- a/internal/services/eventhub/validate/eventhub_names.go +++ b/internal/services/eventhub/validate/eventhub_names.go @@ -35,3 +35,10 @@ func ValidateEventHubAuthorizationRuleName() pluginsdk.SchemaValidateFunc { "The authorization rule name can contain only letters, numbers, periods, hyphens and underscores. The name must start and end with a letter or number and be up to 60 characters long.", ) } + +func ValidateSchemaGroupName() pluginsdk.SchemaValidateFunc { + return validation.StringMatch( + regexp.MustCompile("^[a-zA-Z0-9]([-._a-zA-Z0-9]{0,254}[a-zA-Z0-9])?$"), + "The schema group name can contain only letters, numbers, periods (.), hyphens (-),and underscores (_), up to 256 characters, and it must begin and end with a letter or number.", + ) +} diff --git a/internal/services/firewall/firewall_policy_resource.go b/internal/services/firewall/firewall_policy_resource.go index e9086275bc692..73d701b42af66 100644 --- a/internal/services/firewall/firewall_policy_resource.go +++ b/internal/services/firewall/firewall_policy_resource.go @@ -20,6 +20,7 @@ import ( logAnalytiscValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -98,6 +99,12 @@ func resourceFirewallPolicyCreateUpdate(d *pluginsdk.ResourceData, meta interfac } } + if v, ok := d.GetOk("sql_redirect_allowed"); ok { + props.FirewallPolicyPropertiesFormat.SQL = &network.FirewallPolicySQL{ + AllowSQLRedirect: utils.Bool(v.(bool)), + } + } + if v, ok := d.GetOk("private_ip_ranges"); ok { privateIPRanges := utils.ExpandStringSlice(v.([]interface{})) props.FirewallPolicyPropertiesFormat.Snat = &network.FirewallPolicySNAT{ @@ -198,6 +205,12 @@ func resourceFirewallPolicyRead(d *pluginsdk.ResourceData, meta interface{}) err if err := d.Set("insights", flattenFirewallPolicyInsights(prop.Insights)); err != nil { return fmt.Errorf(`setting "insights": %+v`, err) } + + if prop.SQL != nil && prop.SQL.AllowSQLRedirect != nil { + if err := d.Set("sql_redirect_allowed", prop.SQL.AllowSQLRedirect); err != nil { + return fmt.Errorf("setting `sql_redirect_allowed`: %+v", err) + } + } } flattenedIdentity, err := flattenFirewallPolicyIdentity(resp.Identity) @@ -297,10 +310,16 @@ func expandFirewallPolicyIntrusionDetection(input []interface{}) *network.Firewa }) } + var privateRanges []string + for _, v := range raw["private_ranges"].([]interface{}) { + privateRanges = append(privateRanges, v.(string)) + } + return &network.FirewallPolicyIntrusionDetection{ Mode: network.FirewallPolicyIntrusionDetectionStateType(raw["mode"].(string)), Configuration: &network.FirewallPolicyIntrusionDetectionConfiguration{ SignatureOverrides: &signatureOverrides, + PrivateRanges: &privateRanges, BypassTrafficSettings: &trafficBypass, }, } @@ -460,12 +479,12 @@ func flattenFirewallPolicyIntrusionDetection(input *network.FirewallPolicyIntrus description = *bypass.Description } - sourceAddresses := make([]string, 0) + var sourceAddresses []string if bypass.SourceAddresses != nil { sourceAddresses = *bypass.SourceAddresses } - destinationAddresses := make([]string, 0) + var destinationAddresses []string if bypass.DestinationAddresses != nil { destinationAddresses = *bypass.DestinationAddresses } @@ -497,12 +516,17 @@ func flattenFirewallPolicyIntrusionDetection(input *network.FirewallPolicyIntrus }) } } + var privateRanges []string + if privates := input.Configuration.PrivateRanges; privates != nil { + privateRanges = *privates + } return []interface{}{ map[string]interface{}{ "mode": string(input.Mode), "signature_overrides": signatureOverrides, "traffic_bypass": trafficBypass, + "private_ranges": privateRanges, }, } } @@ -727,6 +751,13 @@ func resourceFirewallPolicySchema() map[string]*pluginsdk.Schema { }, }, }, + "private_ranges": { + Type: pluginsdk.TypeList, + Optional: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, "traffic_bypass": { Type: pluginsdk.TypeList, Optional: true, @@ -743,12 +774,14 @@ func resourceFirewallPolicySchema() map[string]*pluginsdk.Schema { "protocol": { Type: pluginsdk.TypeString, Required: true, + // protocol to be one of [ICMP ANY TCP UDP] but response may be "Any" + DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ string(network.FirewallPolicyIntrusionDetectionProtocolICMP), string(network.FirewallPolicyIntrusionDetectionProtocolANY), string(network.FirewallPolicyIntrusionDetectionProtocolTCP), string(network.FirewallPolicyIntrusionDetectionProtocolUDP), - }, false), + }, true), }, "source_addresses": { Type: pluginsdk.TypeSet, @@ -851,6 +884,11 @@ func resourceFirewallPolicySchema() map[string]*pluginsdk.Schema { }, }, + "sql_redirect_allowed": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + "child_policies": { Type: pluginsdk.TypeList, Computed: true, diff --git a/internal/services/firewall/firewall_policy_resource_test.go b/internal/services/firewall/firewall_policy_resource_test.go index 77610b0cec819..5f03e5f6cf8be 100644 --- a/internal/services/firewall/firewall_policy_resource_test.go +++ b/internal/services/firewall/firewall_policy_resource_test.go @@ -58,6 +58,7 @@ func TestAccFirewallPolicy_complete(t *testing.T) { check.That(data.ResourceName).Key("dns.0.servers.0").HasValue("1.1.1.1"), check.That(data.ResourceName).Key("dns.0.servers.1").HasValue("3.3.3.3"), check.That(data.ResourceName).Key("dns.0.servers.2").HasValue("2.2.2.2"), + check.That(data.ResourceName).Key("dns.0.proxy_enabled").HasValue("true"), ), }, data.ImportStep(), @@ -127,13 +128,6 @@ func TestAccFirewallPolicy_updatePremium(t *testing.T) { ), }, data.ImportStep(), - { - Config: r.basic(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), }) } @@ -287,11 +281,14 @@ resource "azurerm_firewall_policy" "test" { state = "Alert" id = "1" } + private_ranges = ["172.111.111.111"] traffic_bypass { - name = "Name bypass traffic settings" - description = "Description bypass traffic settings" - protocol = "ANY" - destination_ports = ["*"] + name = "Name bypass traffic settings" + description = "Description bypass traffic settings" + destination_addresses = [] + source_addresses = [] + protocol = "Any" + destination_ports = ["*"] source_ip_groups = [ azurerm_ip_group.test_source.id, ] @@ -300,6 +297,7 @@ resource "azurerm_firewall_policy" "test" { ] } } + sql_redirect_allowed = true identity { type = "UserAssigned" identity_ids = [ diff --git a/internal/services/keyvault/access_policy_schema.go b/internal/services/keyvault/access_policy_schema.go index 1acef77aeb18e..1c1b1c76f9a9f 100644 --- a/internal/services/keyvault/access_policy_schema.go +++ b/internal/services/keyvault/access_policy_schema.go @@ -58,6 +58,10 @@ func keyPermissions() []string { "Update", "Verify", "WrapKey", + "Release", + "Rotate", + "GetRotationPolicy", + "SetRotationPolicy", } } diff --git a/internal/services/keyvault/key_vault_certificate_data_source.go b/internal/services/keyvault/key_vault_certificate_data_source.go index a31aa2a322689..ba50254e57742 100644 --- a/internal/services/keyvault/key_vault_certificate_data_source.go +++ b/internal/services/keyvault/key_vault_certificate_data_source.go @@ -23,7 +23,8 @@ func dataSourceKeyVaultCertificate() *pluginsdk.Resource { Read: dataSourceKeyVaultCertificateRead, Timeouts: &pluginsdk.ResourceTimeout{ - Read: pluginsdk.DefaultTimeout(5 * time.Minute), + // TODO: Change this back to 5min, once https://github.com/hashicorp/terraform-provider-azurerm/issues/11059 is addressed. + Read: pluginsdk.DefaultTimeout(30 * time.Minute), }, Schema: map[string]*pluginsdk.Schema{ diff --git a/internal/services/keyvault/key_vault_certificate_resource.go b/internal/services/keyvault/key_vault_certificate_resource.go index 469340004f329..81a987cfbd127 100644 --- a/internal/services/keyvault/key_vault_certificate_resource.go +++ b/internal/services/keyvault/key_vault_certificate_resource.go @@ -41,7 +41,8 @@ func resourceKeyVaultCertificate() *pluginsdk.Resource { Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(60 * time.Minute), - Read: pluginsdk.DefaultTimeout(5 * time.Minute), + // TODO: Change this back to 5min, once https://github.com/hashicorp/terraform-provider-azurerm/issues/11059 is addressed. + Read: pluginsdk.DefaultTimeout(30 * time.Minute), Delete: pluginsdk.DefaultTimeout(30 * time.Minute), Update: pluginsdk.DefaultTimeout(30 * time.Minute), }, diff --git a/internal/services/keyvault/key_vault_key_data_source.go b/internal/services/keyvault/key_vault_key_data_source.go index f6adffc8505b0..40fb020bcdb92 100644 --- a/internal/services/keyvault/key_vault_key_data_source.go +++ b/internal/services/keyvault/key_vault_key_data_source.go @@ -24,7 +24,8 @@ func dataSourceKeyVaultKey() *pluginsdk.Resource { Read: dataSourceKeyVaultKeyRead, Timeouts: &pluginsdk.ResourceTimeout{ - Read: pluginsdk.DefaultTimeout(5 * time.Minute), + // TODO: Change this back to 5min, once https://github.com/hashicorp/terraform-provider-azurerm/issues/11059 is addressed. + Read: pluginsdk.DefaultTimeout(30 * time.Minute), }, Schema: map[string]*pluginsdk.Schema{ diff --git a/internal/services/keyvault/key_vault_key_resource.go b/internal/services/keyvault/key_vault_key_resource.go index be599828b51cf..149d0baa0fe25 100644 --- a/internal/services/keyvault/key_vault_key_resource.go +++ b/internal/services/keyvault/key_vault_key_resource.go @@ -42,7 +42,8 @@ func resourceKeyVaultKey() *pluginsdk.Resource { Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), - Read: pluginsdk.DefaultTimeout(5 * time.Minute), + // TODO: Change this back to 5min, once https://github.com/hashicorp/terraform-provider-azurerm/issues/11059 is addressed. + Read: pluginsdk.DefaultTimeout(30 * time.Minute), Update: pluginsdk.DefaultTimeout(30 * time.Minute), Delete: pluginsdk.DefaultTimeout(30 * time.Minute), }, diff --git a/internal/services/keyvault/key_vault_resource_test.go b/internal/services/keyvault/key_vault_resource_test.go index 0757e1e64cad4..f65cb8dffe9b2 100644 --- a/internal/services/keyvault/key_vault_resource_test.go +++ b/internal/services/keyvault/key_vault_resource_test.go @@ -928,7 +928,7 @@ access_policy { tenant_id = data.azurerm_client_config.current.tenant_id object_id = "%s" - key_permissions = ["Get", "Create", "Delete", "List", "Restore", "Recover", "UnwrapKey", "WrapKey", "Purge", "Encrypt", "Decrypt", "Sign", "Verify"] + key_permissions = ["Get", "Create", "Delete", "List", "Restore", "Recover", "UnwrapKey", "WrapKey", "Purge", "Encrypt", "Decrypt", "Sign", "Verify", "Release", "Rotate", "GetRotationPolicy", "SetRotationPolicy"] secret_permissions = ["Get"] } `, oid) diff --git a/internal/services/keyvault/key_vault_secret_data_source.go b/internal/services/keyvault/key_vault_secret_data_source.go index b73b376a6f5b7..45eae2cb92687 100644 --- a/internal/services/keyvault/key_vault_secret_data_source.go +++ b/internal/services/keyvault/key_vault_secret_data_source.go @@ -18,7 +18,8 @@ func dataSourceKeyVaultSecret() *pluginsdk.Resource { Read: dataSourceKeyVaultSecretRead, Timeouts: &pluginsdk.ResourceTimeout{ - Read: pluginsdk.DefaultTimeout(5 * time.Minute), + // TODO: Change this back to 5min, once https://github.com/hashicorp/terraform-provider-azurerm/issues/11059 is addressed. + Read: pluginsdk.DefaultTimeout(30 * time.Minute), }, Schema: map[string]*pluginsdk.Schema{ diff --git a/internal/services/keyvault/key_vault_secret_resource.go b/internal/services/keyvault/key_vault_secret_resource.go index c7b9d11922306..73412443bb5e8 100644 --- a/internal/services/keyvault/key_vault_secret_resource.go +++ b/internal/services/keyvault/key_vault_secret_resource.go @@ -33,7 +33,8 @@ func resourceKeyVaultSecret() *pluginsdk.Resource { Timeouts: &pluginsdk.ResourceTimeout{ Create: pluginsdk.DefaultTimeout(30 * time.Minute), - Read: pluginsdk.DefaultTimeout(5 * time.Minute), + // TODO: Change this back to 5min, once https://github.com/hashicorp/terraform-provider-azurerm/issues/11059 is addressed. + Read: pluginsdk.DefaultTimeout(30 * time.Minute), Update: pluginsdk.DefaultTimeout(30 * time.Minute), Delete: pluginsdk.DefaultTimeout(30 * time.Minute), }, diff --git a/internal/services/keyvault/migration/key_vault.go b/internal/services/keyvault/migration/key_vault.go index 5bad96d4357c2..fcbf648f1a0b4 100644 --- a/internal/services/keyvault/migration/key_vault.go +++ b/internal/services/keyvault/migration/key_vault.go @@ -184,6 +184,10 @@ func (KeyVaultV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { outputKeyPermissions = append(outputKeyPermissions, "update") outputKeyPermissions = append(outputKeyPermissions, "verify") outputKeyPermissions = append(outputKeyPermissions, "wrapKey") + outputKeyPermissions = append(outputKeyPermissions, "release") + outputKeyPermissions = append(outputKeyPermissions, "rotate") + outputKeyPermissions = append(outputKeyPermissions, "getRotationPolicy") + outputKeyPermissions = append(outputKeyPermissions, "setRotationPolicy") break } } diff --git a/internal/services/loganalytics/client/client.go b/internal/services/loganalytics/client/client.go index ba0162e3098f4..8580b04408a99 100644 --- a/internal/services/loganalytics/client/client.go +++ b/internal/services/loganalytics/client/client.go @@ -3,7 +3,7 @@ package client import ( "github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2020-08-01/operationalinsights" "github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement" - queryPacks "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -13,7 +13,7 @@ type Client struct { DataSourcesClient *operationalinsights.DataSourcesClient LinkedServicesClient *operationalinsights.LinkedServicesClient LinkedStorageAccountClient *operationalinsights.LinkedStorageAccountsClient - QueryPacksClient *queryPacks.OperationalInsightsClient + QueryPacksClient *querypacks.QueryPacksClient SavedSearchesClient *operationalinsights.SavedSearchesClient SharedKeysClient *operationalinsights.SharedKeysClient SolutionsClient *operationsmanagement.SolutionsClient @@ -52,7 +52,7 @@ func NewClient(o *common.ClientOptions) *Client { LinkedStorageAccountClient := operationalinsights.NewLinkedStorageAccountsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&LinkedStorageAccountClient.Client, o.ResourceManagerAuthorizer) - QueryPacksClient := queryPacks.NewOperationalInsightsClientWithBaseURI(o.ResourceManagerEndpoint) + QueryPacksClient := querypacks.NewQueryPacksClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&QueryPacksClient.Client, o.ResourceManagerAuthorizer) return &Client{ diff --git a/internal/services/loganalytics/log_analytics_query_pack_resource.go b/internal/services/loganalytics/log_analytics_query_pack_resource.go index 31cae69a391f4..75dff79e9167d 100644 --- a/internal/services/loganalytics/log_analytics_query_pack_resource.go +++ b/internal/services/loganalytics/log_analytics_query_pack_resource.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - queryPacks "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -36,7 +36,7 @@ func (r LogAnalyticsQueryPackResource) ModelObject() interface{} { } func (r LogAnalyticsQueryPackResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return queryPacks.ValidateQueryPackID + return querypacks.ValidateQueryPackID } func (r LogAnalyticsQueryPackResource) Arguments() map[string]*pluginsdk.Schema { @@ -72,7 +72,7 @@ func (r LogAnalyticsQueryPackResource) Create() sdk.ResourceFunc { client := metadata.Client.LogAnalytics.QueryPacksClient subscriptionId := metadata.Client.Account.SubscriptionId - id := queryPacks.NewQueryPackID(subscriptionId, model.ResourceGroupName, model.Name) + id := querypacks.NewQueryPackID(subscriptionId, model.ResourceGroupName, model.Name) existing, err := client.QueryPacksGet(ctx, id) if err != nil && !response.WasNotFound(existing.HttpResponse) { @@ -83,9 +83,9 @@ func (r LogAnalyticsQueryPackResource) Create() sdk.ResourceFunc { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - properties := &queryPacks.LogAnalyticsQueryPack{ + properties := &querypacks.LogAnalyticsQueryPack{ Location: location.Normalize(model.Location), - Properties: queryPacks.LogAnalyticsQueryPackProperties{}, + Properties: querypacks.LogAnalyticsQueryPackProperties{}, Tags: &model.Tags, } @@ -108,7 +108,7 @@ func (r LogAnalyticsQueryPackResource) Update() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.LogAnalytics.QueryPacksClient - id, err := queryPacks.ParseQueryPackID(metadata.ResourceData.Id()) + id, err := querypacks.ParseQueryPackID(metadata.ResourceData.Id()) if err != nil { return err } @@ -150,7 +150,7 @@ func (r LogAnalyticsQueryPackResource) Read() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.LogAnalytics.QueryPacksClient - id, err := queryPacks.ParseQueryPackID(metadata.ResourceData.Id()) + id, err := querypacks.ParseQueryPackID(metadata.ResourceData.Id()) if err != nil { return err } @@ -190,7 +190,7 @@ func (r LogAnalyticsQueryPackResource) Delete() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.LogAnalytics.QueryPacksClient - id, err := queryPacks.ParseQueryPackID(metadata.ResourceData.Id()) + id, err := querypacks.ParseQueryPackID(metadata.ResourceData.Id()) if err != nil { return err } diff --git a/internal/services/loganalytics/log_analytics_query_pack_resource_test.go b/internal/services/loganalytics/log_analytics_query_pack_resource_test.go index c6605715fdd8d..6d92ab456bcd3 100644 --- a/internal/services/loganalytics/log_analytics_query_pack_resource_test.go +++ b/internal/services/loganalytics/log_analytics_query_pack_resource_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - queryPacks "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -17,7 +17,7 @@ import ( type LogAnalyticsQueryPackResource struct{} func (r LogAnalyticsQueryPackResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := queryPacks.ParseQueryPackID(state.ID) + id, err := querypacks.ParseQueryPackID(state.ID) if err != nil { return nil, err } diff --git a/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go b/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go index 12959c05d2a79..24ffd6fe0623a 100644 --- a/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go +++ b/internal/services/maintenance/maintenance_assignment_dedicated_host_resource.go @@ -8,11 +8,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/maintenance/mgmt/2021-05-01/maintenance" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - parseCompute "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" - validateCompute "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/maintenance/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/maintenance/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -52,7 +51,7 @@ func resourceArmMaintenanceAssignmentDedicatedHost() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateCompute.DedicatedHostID, + ValidateFunc: dedicatedhosts.ValidateHostID, DiffSuppressFunc: suppress.CaseDifference, }, }, @@ -65,9 +64,9 @@ func resourceArmMaintenanceAssignmentDedicatedHostCreate(d *pluginsdk.ResourceDa defer cancel() dedicatedHostIdRaw := d.Get("dedicated_host_id").(string) - dedicatedHostId, _ := parseCompute.DedicatedHostID(dedicatedHostIdRaw) + dedicatedHostId, _ := dedicatedhosts.ParseHostID(dedicatedHostIdRaw) - existingList, err := getMaintenanceAssignmentDedicatedHost(ctx, client, dedicatedHostId, dedicatedHostIdRaw) + existingList, err := getMaintenanceAssignmentDedicatedHost(ctx, client, *dedicatedHostId, dedicatedHostIdRaw) if err != nil { return err } @@ -94,7 +93,7 @@ func resourceArmMaintenanceAssignmentDedicatedHostCreate(d *pluginsdk.ResourceDa // It may take a few minutes after starting a VM for it to become available to assign to a configuration err = pluginsdk.Retry(d.Timeout(pluginsdk.TimeoutCreate), func() *pluginsdk.RetryError { - if _, err := client.CreateOrUpdateParent(ctx, dedicatedHostId.ResourceGroup, "Microsoft.Compute", "hostGroups", dedicatedHostId.HostGroupName, "hosts", dedicatedHostId.HostName, assignmentName, configurationAssignment); err != nil { + if _, err := client.CreateOrUpdateParent(ctx, dedicatedHostId.ResourceGroupName, "Microsoft.Compute", "hostGroups", dedicatedHostId.HostGroupName, "hosts", dedicatedHostId.HostName, assignmentName, configurationAssignment); err != nil { if strings.Contains(err.Error(), "It may take a few minutes after starting a VM for it to become available to assign to a configuration") { return pluginsdk.RetryableError(fmt.Errorf("expected VM is available to assign to a configuration but was in pending state, retrying")) } @@ -107,7 +106,7 @@ func resourceArmMaintenanceAssignmentDedicatedHostCreate(d *pluginsdk.ResourceDa return err } - resp, err := getMaintenanceAssignmentDedicatedHost(ctx, client, dedicatedHostId, dedicatedHostIdRaw) + resp, err := getMaintenanceAssignmentDedicatedHost(ctx, client, *dedicatedHostId, dedicatedHostIdRaw) if err != nil { return err } @@ -146,11 +145,7 @@ func resourceArmMaintenanceAssignmentDedicatedHostRead(d *pluginsdk.ResourceData return fmt.Errorf("empty or nil ID of Maintenance Assignment (Dedicated Host ID: %q", id.DedicatedHostIdRaw) } - dedicatedHostId := "" - if id.DedicatedHostId != nil { - dedicatedHostId = id.DedicatedHostId.ID() - } - d.Set("dedicated_host_id", dedicatedHostId) + d.Set("dedicated_host_id", id.DedicatedHostId.ID()) if props := assignment.ConfigurationAssignmentProperties; props != nil { d.Set("maintenance_configuration_id", props.MaintenanceConfigurationID) @@ -168,15 +163,15 @@ func resourceArmMaintenanceAssignmentDedicatedHostDelete(d *pluginsdk.ResourceDa return err } - if _, err := client.DeleteParent(ctx, id.DedicatedHostId.ResourceGroup, "Microsoft.Compute", "hostGroups", id.DedicatedHostId.HostGroupName, "hosts", id.DedicatedHostId.HostName, id.Name); err != nil { + if _, err := client.DeleteParent(ctx, id.DedicatedHostId.ResourceGroupName, "Microsoft.Compute", "hostGroups", id.DedicatedHostId.HostGroupName, "hosts", id.DedicatedHostId.HostName, id.Name); err != nil { return fmt.Errorf("deleting Maintenance Assignment to resource %q: %+v", id.DedicatedHostIdRaw, err) } return nil } -func getMaintenanceAssignmentDedicatedHost(ctx context.Context, client *maintenance.ConfigurationAssignmentsClient, id *parseCompute.DedicatedHostId, dedicatedHostId string) (result *[]maintenance.ConfigurationAssignment, err error) { - resp, err := client.ListParent(ctx, id.ResourceGroup, "Microsoft.Compute", "hostGroups", id.HostGroupName, "hosts", id.HostName) +func getMaintenanceAssignmentDedicatedHost(ctx context.Context, client *maintenance.ConfigurationAssignmentsClient, id dedicatedhosts.HostId, dedicatedHostId string) (result *[]maintenance.ConfigurationAssignment, err error) { + resp, err := client.ListParent(ctx, id.ResourceGroupName, "Microsoft.Compute", "hostGroups", id.HostGroupName, "hosts", id.HostName) if err != nil { if !utils.ResponseWasNotFound(resp.Response) { err = fmt.Errorf("checking for presence of existing Maintenance assignment (Dedicated Host ID %q): %+v", dedicatedHostId, err) diff --git a/internal/services/maintenance/maintenance_assignment_dedicated_host_resource_test.go b/internal/services/maintenance/maintenance_assignment_dedicated_host_resource_test.go index 7693b4b1b8263..175e5841536a5 100644 --- a/internal/services/maintenance/maintenance_assignment_dedicated_host_resource_test.go +++ b/internal/services/maintenance/maintenance_assignment_dedicated_host_resource_test.go @@ -51,7 +51,7 @@ func (MaintenanceAssignmentDedicatedHostResource) Exists(ctx context.Context, cl return nil, err } - resp, err := clients.Maintenance.ConfigurationAssignmentsClient.ListParent(ctx, id.DedicatedHostId.ResourceGroup, "Microsoft.Compute", "hostGroups", id.DedicatedHostId.HostGroupName, "hosts", id.DedicatedHostId.HostName) + resp, err := clients.Maintenance.ConfigurationAssignmentsClient.ListParent(ctx, id.DedicatedHostId.ResourceGroupName, "Microsoft.Compute", "hostGroups", id.DedicatedHostId.HostGroupName, "hosts", id.DedicatedHostId.HostName) if err != nil { return nil, fmt.Errorf("retrieving Maintenance Assignment Dedicated Host (target resource id: %q): %v", id.DedicatedHostIdRaw, err) } diff --git a/internal/services/maintenance/parse/maintenance_assignment_dedicated_host.go b/internal/services/maintenance/parse/maintenance_assignment_dedicated_host.go index 1aeb0b31897c8..0335b7f1d4365 100644 --- a/internal/services/maintenance/parse/maintenance_assignment_dedicated_host.go +++ b/internal/services/maintenance/parse/maintenance_assignment_dedicated_host.go @@ -4,11 +4,11 @@ import ( "fmt" "regexp" - parseCompute "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" ) type MaintenanceAssignmentDedicatedHostId struct { - DedicatedHostId *parseCompute.DedicatedHostId + DedicatedHostId dedicatedhosts.HostId DedicatedHostIdRaw string Name string } @@ -20,13 +20,13 @@ func MaintenanceAssignmentDedicatedHostID(input string) (*MaintenanceAssignmentD } targetResourceId, name := groups[1], groups[2] - dedicatedHostID, err := parseCompute.DedicatedHostID(targetResourceId) + dedicatedHostID, err := dedicatedhosts.ParseHostIDInsensitively(targetResourceId) if err != nil { return nil, fmt.Errorf("parsing Maintenance Assignment Dedicated Host ID: %q: Expected valid Dedicated Host ID", input) } return &MaintenanceAssignmentDedicatedHostId{ - DedicatedHostId: dedicatedHostID, + DedicatedHostId: *dedicatedHostID, DedicatedHostIdRaw: targetResourceId, Name: name, }, nil diff --git a/internal/services/maintenance/parse/maintenance_assignment_dedicated_host_test.go b/internal/services/maintenance/parse/maintenance_assignment_dedicated_host_test.go index 2c47d2a31039f..1ef18a12f9e61 100644 --- a/internal/services/maintenance/parse/maintenance_assignment_dedicated_host_test.go +++ b/internal/services/maintenance/parse/maintenance_assignment_dedicated_host_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - parseCompute "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" ) func TestMaintenanceAssignmentDedicatedHostID(t *testing.T) { @@ -55,11 +55,11 @@ func TestMaintenanceAssignmentDedicatedHostID(t *testing.T) { Error: false, Expect: &MaintenanceAssignmentDedicatedHostId{ DedicatedHostIdRaw: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resGroup1/providers/microsoft.compute/hostGroups/group1/hosts/host1", - DedicatedHostId: &parseCompute.DedicatedHostId{ - SubscriptionId: "00000000-0000-0000-0000-000000000000", - ResourceGroup: "resGroup1", - HostGroupName: "group1", - HostName: "host1", + DedicatedHostId: dedicatedhosts.HostId{ + SubscriptionId: "00000000-0000-0000-0000-000000000000", + ResourceGroupName: "resGroup1", + HostGroupName: "group1", + HostName: "host1", }, Name: "assign1", }, diff --git a/internal/services/managementgroup/management_group_data_source.go b/internal/services/managementgroup/management_group_data_source.go index d69ec737f8465..88b0de7ee3282 100644 --- a/internal/services/managementgroup/management_group_data_source.go +++ b/internal/services/managementgroup/management_group_data_source.go @@ -44,10 +44,27 @@ func dataSourceManagementGroup() *pluginsdk.Resource { }, "subscription_ids": { - Type: pluginsdk.TypeSet, + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString}, + }, + + "management_group_ids": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString}, + }, + + "all_subscription_ids": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString}, + }, + + "all_management_group_ids": { + Type: pluginsdk.TypeList, Computed: true, Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString}, - Set: pluginsdk.HashString, }, }, } @@ -90,11 +107,29 @@ func dataSourceManagementGroupRead(d *pluginsdk.ResourceData, meta interface{}) if props := resp.Properties; props != nil { d.Set("display_name", props.DisplayName) - subscriptionIds, err := flattenManagementGroupDataSourceSubscriptionIds(props.Children) - if err != nil { - return fmt.Errorf("flattening `subscription_ids`: %+v", err) + subscriptionIds := []interface{}{} + mgmtgroupIds := []interface{}{} + if err := flattenManagementGroupDataSourceChildren(&subscriptionIds, &mgmtgroupIds, props.Children, false); err != nil { + return fmt.Errorf("flattening direct children resources: %+v", err) + } + if err := d.Set("subscription_ids", subscriptionIds); err != nil { + return fmt.Errorf("setting `subscription_ids`: %v", err) + } + if err := d.Set("management_group_ids", mgmtgroupIds); err != nil { + return fmt.Errorf("setting `management_group_ids`: %v", err) + } + + subscriptionIds = []interface{}{} + mgmtgroupIds = []interface{}{} + if err := flattenManagementGroupDataSourceChildren(&subscriptionIds, &mgmtgroupIds, props.Children, true); err != nil { + return fmt.Errorf("flattening all children resources: %+v", err) + } + if err := d.Set("all_subscription_ids", subscriptionIds); err != nil { + return fmt.Errorf("setting `all_subscription_ids`: %v", err) + } + if err := d.Set("all_management_group_ids", mgmtgroupIds); err != nil { + return fmt.Errorf("setting `all_management_group_ids`: %v", err) } - d.Set("subscription_ids", subscriptionIds) parentId := "" if details := props.Details; details != nil { @@ -141,26 +176,37 @@ func getManagementGroupNameByDisplayName(ctx context.Context, client *management return results[0], nil } -func flattenManagementGroupDataSourceSubscriptionIds(input *[]managementgroups.ChildInfo) (*pluginsdk.Set, error) { - subscriptionIds := &pluginsdk.Set{F: pluginsdk.HashString} +func flattenManagementGroupDataSourceChildren(subscriptionIds, mgmtgroupIds *[]interface{}, input *[]managementgroups.ChildInfo, recursive bool) error { if input == nil { - return subscriptionIds, nil + return nil } for _, child := range *input { if child.ID == nil { continue } - - id, err := parseManagementGroupSubscriptionID(*child.ID) - if err != nil { - return nil, fmt.Errorf("Unable to parse child Subscription ID %+v", err) + switch child.Type { + case managementgroups.Type1MicrosoftManagementmanagementGroups: + id, err := parse.ManagementGroupID(*child.ID) + if err != nil { + return fmt.Errorf("Unable to parse child Management Group ID %+v", err) + } + *mgmtgroupIds = append(*mgmtgroupIds, id.ID()) + case managementgroups.Type1Subscriptions: + id, err := parseManagementGroupSubscriptionID(*child.ID) + if err != nil { + return fmt.Errorf("Unable to parse child Subscription ID %+v", err) + } + *subscriptionIds = append(*subscriptionIds, id.subscriptionId) + default: + continue } - - if id != nil { - subscriptionIds.Add(id.subscriptionId) + if recursive { + if err := flattenManagementGroupDataSourceChildren(subscriptionIds, mgmtgroupIds, child.Children, recursive); err != nil { + return err + } } } - return subscriptionIds, nil + return nil } diff --git a/internal/services/managementgroup/management_group_data_source_test.go b/internal/services/managementgroup/management_group_data_source_test.go index 5a2ffd3b5e5ce..7d041eb88e394 100644 --- a/internal/services/managementgroup/management_group_data_source_test.go +++ b/internal/services/managementgroup/management_group_data_source_test.go @@ -40,6 +40,22 @@ func TestAccManagementGroupDataSource_basicByDisplayName(t *testing.T) { }) } +func TestAccManagementGroupDataSource_nestedManagmentGroup(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_management_group", "test") + r := ManagementGroupDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.nestedManagementGroup(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("display_name").HasValue(fmt.Sprintf("acctest Management Group %d", data.RandomInteger)), + check.That(data.ResourceName).Key("management_group_ids.#").HasValue("1"), + check.That(data.ResourceName).Key("all_management_group_ids.#").HasValue("2"), + ), + }, + }) +} + func (ManagementGroupDataSource) basicByName(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -71,3 +87,30 @@ data "azurerm_management_group" "test" { } `, data.RandomInteger) } + +func (ManagementGroupDataSource) nestedManagementGroup(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_management_group" "test" { + display_name = "acctest Management Group %[1]d" +} + +resource "azurerm_management_group" "child" { + display_name = "acctest child Management Group %[1]d" + parent_management_group_id = azurerm_management_group.test.id +} + +resource "azurerm_management_group" "grand_child" { + display_name = "acctest grand child Management Group %[1]d" + parent_management_group_id = azurerm_management_group.child.id +} + +data "azurerm_management_group" "test" { + name = azurerm_management_group.test.name + depends_on = [azurerm_management_group.grand_child] +} +`, data.RandomInteger) +} diff --git a/internal/services/mariadb/client/client.go b/internal/services/mariadb/client/client.go index 0e1cb2344c0de..deba55b330985 100644 --- a/internal/services/mariadb/client/client.go +++ b/internal/services/mariadb/client/client.go @@ -1,32 +1,36 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - ConfigurationsClient *mariadb.ConfigurationsClient - DatabasesClient *mariadb.DatabasesClient - FirewallRulesClient *mariadb.FirewallRulesClient - ServersClient *mariadb.ServersClient - VirtualNetworkRulesClient *mariadb.VirtualNetworkRulesClient + ConfigurationsClient *configurations.ConfigurationsClient + DatabasesClient *databases.DatabasesClient + FirewallRulesClient *firewallrules.FirewallRulesClient + ServersClient *servers.ServersClient + VirtualNetworkRulesClient *virtualnetworkrules.VirtualNetworkRulesClient } func NewClient(o *common.ClientOptions) *Client { - configurationsClient := mariadb.NewConfigurationsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + configurationsClient := configurations.NewConfigurationsClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&configurationsClient.Client, o.ResourceManagerAuthorizer) - DatabasesClient := mariadb.NewDatabasesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + DatabasesClient := databases.NewDatabasesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&DatabasesClient.Client, o.ResourceManagerAuthorizer) - FirewallRulesClient := mariadb.NewFirewallRulesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + FirewallRulesClient := firewallrules.NewFirewallRulesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&FirewallRulesClient.Client, o.ResourceManagerAuthorizer) - ServersClient := mariadb.NewServersClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + ServersClient := servers.NewServersClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&ServersClient.Client, o.ResourceManagerAuthorizer) - VirtualNetworkRulesClient := mariadb.NewVirtualNetworkRulesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + VirtualNetworkRulesClient := virtualnetworkrules.NewVirtualNetworkRulesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&VirtualNetworkRulesClient.Client, o.ResourceManagerAuthorizer) return &Client{ diff --git a/internal/services/mariadb/mariadb_configuration_resource.go b/internal/services/mariadb/mariadb_configuration_resource.go index abedc306deccf..f16ad13250468 100644 --- a/internal/services/mariadb/mariadb_configuration_resource.go +++ b/internal/services/mariadb/mariadb_configuration_resource.go @@ -5,10 +5,10 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -22,7 +22,7 @@ func resourceMariaDbConfiguration() *pluginsdk.Resource { Read: resourceMariaDbConfigurationRead, Delete: resourceMariaDbConfigurationDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.MariaDBConfigurationID(id) + _, err := configurations.ParseConfigurationID(id) return err }), @@ -65,23 +65,17 @@ func resourceMariaDbConfigurationCreateUpdate(d *pluginsdk.ResourceData, meta in ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - log.Printf("[INFO] preparing arguments for AzureRM MariaDb Configuration creation.") - id := parse.NewMariaDBConfigurationID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) + id := configurations.NewConfigurationID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) value := d.Get("value").(string) - properties := mariadb.Configuration{ - ConfigurationProperties: &mariadb.ConfigurationProperties{ + properties := configurations.Configuration{ + Properties: &configurations.ConfigurationProperties{ Value: utils.String(value), }, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServerName, id.ConfigurationName, properties) - if err != nil { - return fmt.Errorf("issuing create/update request for %s: %v", id, err) - } - - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for create/update of %s: %v", id, err) + if err := client.CreateOrUpdateThenPoll(ctx, id, properties); err != nil { + return fmt.Errorf("creating/updating %s: %+v", id, err) } d.SetId(id.ID()) @@ -94,26 +88,35 @@ func resourceMariaDbConfigurationRead(d *pluginsdk.ResourceData, meta interface{ ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBConfigurationID(d.Id()) + id, err := configurations.ParseConfigurationID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.ConfigurationName) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[WARN] %s was not found", *id) d.SetId("") return nil } - return fmt.Errorf("making Read request on %s: %+v", *id, err) + return fmt.Errorf("retrieving %s: %+v", *id, err) } d.Set("name", id.ConfigurationName) d.Set("server_name", id.ServerName) - d.Set("resource_group_name", id.ResourceGroup) - d.Set("value", resp.ConfigurationProperties.Value) + d.Set("resource_group_name", id.ResourceGroupName) + + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + value := "" + if v := props.Value; v != nil { + value = *v + } + d.Set("value", value) + } + } return nil } @@ -123,28 +126,37 @@ func resourceMariaDbConfigurationDelete(d *pluginsdk.ResourceData, meta interfac ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBConfigurationID(d.Id()) + id, err := configurations.ParseConfigurationID(d.Id()) if err != nil { return err } // "delete" = resetting this to the default value - resp, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.ConfigurationName) + resp, err := client.Get(ctx, *id) if err != nil { return fmt.Errorf("retrieving %s: %+v", *id, err) } - properties := mariadb.Configuration{ - ConfigurationProperties: &mariadb.ConfigurationProperties{ + defaultValue := "" + + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + if v := props.DefaultValue; v != nil { + defaultValue = *v + } + } + } + + properties := configurations.Configuration{ + Properties: &configurations.ConfigurationProperties{ // we can alternatively set `source: "system-default"` - Value: resp.DefaultValue, + Value: &defaultValue, }, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServerName, id.ConfigurationName, properties) - if err != nil { - return err + if err := client.CreateOrUpdateThenPoll(ctx, *id, properties); err != nil { + return fmt.Errorf("deleting %s: %+v", id, err) } - return future.WaitForCompletionRef(ctx, client.Client) + return nil } diff --git a/internal/services/mariadb/mariadb_configuration_resource_test.go b/internal/services/mariadb/mariadb_configuration_resource_test.go index b6ec842f3a80e..70af8fccc7328 100644 --- a/internal/services/mariadb/mariadb_configuration_resource_test.go +++ b/internal/services/mariadb/mariadb_configuration_resource_test.go @@ -5,9 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -84,39 +85,41 @@ func TestAccMariaDbConfiguration_logSlowAdminStatements(t *testing.T) { } func (MariaDbConfigurationResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.MariaDBConfigurationID(state.ID) + id, err := configurations.ParseConfigurationID(state.ID) if err != nil { return nil, err } - resp, err := clients.MariaDB.ConfigurationsClient.Get(ctx, id.ResourceGroup, id.ServerName, id.ConfigurationName) + resp, err := clients.MariaDB.ConfigurationsClient.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %v", *id, err) } - return utils.Bool(resp.ConfigurationProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } func checkValueIs(value string) acceptance.ClientCheckFunc { return func(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) error { - id, err := parse.MariaDBConfigurationID(state.ID) + id, err := configurations.ParseConfigurationID(state.ID) if err != nil { return err } - resp, err := clients.MariaDB.ConfigurationsClient.Get(ctx, id.ResourceGroup, id.ServerName, id.ConfigurationName) + resp, err := clients.MariaDB.ConfigurationsClient.Get(ctx, *id) if err != nil { return fmt.Errorf("retrieving %s: %v", *id, err) } - if resp.Value == nil { - return fmt.Errorf("%s Value is nil", *id) - } - - actualValue := *resp.Value - - if value != actualValue { - return fmt.Errorf("%s Value (%s) != expected (%s)", *id, actualValue, value) + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + if v := props.Value; v != nil { + if value != *v { + return fmt.Errorf("%s Value (%s) != expected (%s)", *id, *v, value) + } + } else { + return fmt.Errorf("%s Value is nil", *id) + } + } } return nil @@ -125,28 +128,41 @@ func checkValueIs(value string) acceptance.ClientCheckFunc { func checkValueIsReset(configurationName string) acceptance.ClientCheckFunc { return func(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) error { - id, err := parse.ServerID(state.ID) + serverId, err := servers.ParseServerID(state.ID) if err != nil { return err } - resp, err := clients.MariaDB.ConfigurationsClient.Get(ctx, id.ResourceGroup, id.Name, configurationName) + id := configurations.NewConfigurationID(serverId.SubscriptionId, serverId.ResourceGroupName, serverId.ServerName, configurationName) + + resp, err := clients.MariaDB.ConfigurationsClient.Get(ctx, id) if err != nil { - return fmt.Errorf("retrieving MariaDB Configuration %q (Server %q / Resource Group %q): %v", configurationName, id.Name, id.ResourceGroup, err) + return fmt.Errorf("retrieving %s: %v", id, err) + } + + actualValue := "" + defaultValue := "" + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + if v := props.Value; v != nil { + actualValue = *v + } + if v := props.DefaultValue; v != nil { + defaultValue = *v + } + } } - if resp.Value == nil { - return fmt.Errorf("MariaDB Configuration %q (Server %q / Resource Group %q) Value is nil", configurationName, id.Name, id.ResourceGroup) + if actualValue == "" { + return fmt.Errorf("%s Value is nil", id) } - if resp.DefaultValue == nil { - return fmt.Errorf("MariaDB Configuration %q (Server %q / Resource Group %q) Default Value is nil", configurationName, id.Name, id.ResourceGroup) + if defaultValue == "" { + return fmt.Errorf("%s Default Value is nil", id) } - actualValue := *resp.Value - defaultValue := *resp.DefaultValue if defaultValue != actualValue { - return fmt.Errorf("MariaDB Configuration %q (Server %q / Resource Group %q) Value (%s) != Default (%s)", configurationName, id.Name, id.ResourceGroup, actualValue, defaultValue) + return fmt.Errorf("%s Value (%s) != Default (%s)", id, actualValue, defaultValue) } return nil diff --git a/internal/services/mariadb/mariadb_database_resource.go b/internal/services/mariadb/mariadb_database_resource.go index 4c3226a63ecf2..391a05b861df6 100644 --- a/internal/services/mariadb/mariadb_database_resource.go +++ b/internal/services/mariadb/mariadb_database_resource.go @@ -6,11 +6,11 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -25,7 +25,7 @@ func resourceMariaDbDatabase() *pluginsdk.Resource { Delete: resourceMariaDbDatabaseDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.MariaDBDatabaseID(id) + _, err := databases.ParseDatabaseID(id) return err }), @@ -87,17 +87,17 @@ func resourceMariaDbDatabaseCreateUpdate(d *pluginsdk.ResourceData, meta interfa log.Printf("[INFO] preparing arguments for AzureRM MariaDB database creation") - id := parse.NewMariaDBDatabaseID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) + id := databases.NewDatabaseID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.DatabaseName) + existing, err := client.Get(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %s", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_mariadb_database", id.ID()) } } @@ -105,22 +105,17 @@ func resourceMariaDbDatabaseCreateUpdate(d *pluginsdk.ResourceData, meta interfa charset := d.Get("charset").(string) collation := d.Get("collation").(string) - properties := mariadb.Database{ - DatabaseProperties: &mariadb.DatabaseProperties{ + properties := databases.Database{ + Properties: &databases.DatabaseProperties{ Charset: utils.String(charset), Collation: utils.String(collation), }, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServerName, id.DatabaseName, properties) - if err != nil { + if err := client.CreateOrUpdateThenPoll(ctx, id, properties); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for completion of %s: %+v", id, err) - } - d.SetId(id.ID()) return resourceMariaDbDatabaseRead(d, meta) @@ -131,31 +126,43 @@ func resourceMariaDbDatabaseRead(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBDatabaseID(d.Id()) + id, err := databases.ParseDatabaseID(d.Id()) if err != nil { - return fmt.Errorf("cannot parse MariaDB database %q ID:\n%+v", d.Id(), err) + return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.DatabaseName) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[WARN] %s was not found", *id) d.SetId("") return nil } - return fmt.Errorf("making read request on %s:\n%+v", *id, err) + return fmt.Errorf("retrieving %s: %+v", *id, err) } d.Set("name", id.DatabaseName) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("resource_group_name", id.ResourceGroupName) d.Set("server_name", id.ServerName) - if properties := resp.DatabaseProperties; properties != nil { - d.Set("charset", properties.Charset) - d.Set("collation", properties.Collation) + charset := "" + collation := "" + + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + if v := props.Charset; v != nil { + charset = *v + } + if v := props.Collation; v != nil { + collation = *v + } + } } + d.Set("charset", charset) + d.Set("collation", collation) + return nil } @@ -164,18 +171,13 @@ func resourceMariaDbDatabaseDelete(d *pluginsdk.ResourceData, meta interface{}) ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBDatabaseID(d.Id()) - if err != nil { - return fmt.Errorf("cannot parse MariaDB database %q ID:\n%+v", d.Id(), err) - } - - future, err := client.Delete(ctx, id.ResourceGroup, id.ServerName, id.DatabaseName) + id, err := databases.ParseDatabaseID(d.Id()) if err != nil { - return fmt.Errorf("making delete request on %s:\n%+v", *id, err) + return err } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for deletion of %s:\n%+v", *id, err) + if err := client.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) } return nil diff --git a/internal/services/mariadb/mariadb_database_resource_test.go b/internal/services/mariadb/mariadb_database_resource_test.go index 1c67f2b7fbed0..6a124f3a00a63 100644 --- a/internal/services/mariadb/mariadb_database_resource_test.go +++ b/internal/services/mariadb/mariadb_database_resource_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -51,17 +51,17 @@ func TestAccMariaDbDatabase_requiresImport(t *testing.T) { } func (MariaDbDatabaseResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.MariaDBDatabaseID(state.ID) + id, err := databases.ParseDatabaseID(state.ID) if err != nil { return nil, err } - resp, err := clients.MariaDB.DatabasesClient.Get(ctx, id.ResourceGroup, id.ServerName, id.DatabaseName) + resp, err := clients.MariaDB.DatabasesClient.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %v", *id, err) } - return utils.Bool(resp.DatabaseProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } func (MariaDbDatabaseResource) basic(data acceptance.TestData) string { diff --git a/internal/services/mariadb/mariadb_firewall_rule_resource.go b/internal/services/mariadb/mariadb_firewall_rule_resource.go index 50a217f362033..14a9a8fc64bbc 100644 --- a/internal/services/mariadb/mariadb_firewall_rule_resource.go +++ b/internal/services/mariadb/mariadb_firewall_rule_resource.go @@ -5,16 +5,15 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) func resourceArmMariaDBFirewallRule() *pluginsdk.Resource { @@ -24,7 +23,7 @@ func resourceArmMariaDBFirewallRule() *pluginsdk.Resource { Update: resourceArmMariaDBFirewallRuleCreateUpdate, Delete: resourceArmMariaDBFirewallRuleDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.MariaDBFirewallRuleID(id) + _, err := firewallrules.ParseFirewallRuleID(id) return err }), @@ -75,37 +74,32 @@ func resourceArmMariaDBFirewallRuleCreateUpdate(d *pluginsdk.ResourceData, meta log.Printf("[INFO] preparing arguments for AzureRM MariaDB Firewall Rule creation.") - id := parse.NewMariaDBFirewallRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) + id := firewallrules.NewFirewallRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) startIPAddress := d.Get("start_ip_address").(string) endIPAddress := d.Get("end_ip_address").(string) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.FirewallRuleName) + existing, err := client.Get(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_mariadb_firewall_rule", id.ID()) } } - properties := mariadb.FirewallRule{ - FirewallRuleProperties: &mariadb.FirewallRuleProperties{ - StartIPAddress: utils.String(startIPAddress), - EndIPAddress: utils.String(endIPAddress), + properties := firewallrules.FirewallRule{ + Properties: firewallrules.FirewallRuleProperties{ + StartIPAddress: startIPAddress, + EndIPAddress: endIPAddress, }, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServerName, id.FirewallRuleName, properties) - if err != nil { - return fmt.Errorf("issuing create/update request for %s: %v", id, err) - } - - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting on create/update future for %s: %v", id, err) + if err := client.CreateOrUpdateThenPoll(ctx, id, properties); err != nil { + return fmt.Errorf("creating/updated %s: %v", id, err) } d.SetId(id.ID()) @@ -118,25 +112,28 @@ func resourceArmMariaDBFirewallRuleRead(d *pluginsdk.ResourceData, meta interfac ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBFirewallRuleID(d.Id()) + id, err := firewallrules.ParseFirewallRuleID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.FirewallRuleName) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { d.SetId("") return nil } - return fmt.Errorf("making Read request on %s: %+v", *id, err) + return fmt.Errorf("retrieving %s: %+v", *id, err) } d.Set("name", id.FirewallRuleName) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("resource_group_name", id.ResourceGroupName) d.Set("server_name", id.ServerName) - d.Set("start_ip_address", resp.StartIPAddress) - d.Set("end_ip_address", resp.EndIPAddress) + + if model := resp.Model; model != nil { + d.Set("start_ip_address", model.Properties.StartIPAddress) + d.Set("end_ip_address", model.Properties.EndIPAddress) + } return nil } @@ -146,15 +143,14 @@ func resourceArmMariaDBFirewallRuleDelete(d *pluginsdk.ResourceData, meta interf ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBFirewallRuleID(d.Id()) + id, err := firewallrules.ParseFirewallRuleID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.ServerName, id.FirewallRuleName) - if err != nil { - return err + if err := client.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) } - return future.WaitForCompletionRef(ctx, client.Client) + return nil } diff --git a/internal/services/mariadb/mariadb_firewall_rule_resource_test.go b/internal/services/mariadb/mariadb_firewall_rule_resource_test.go index b0e1b50c8c61b..0dcfa0c465dd9 100644 --- a/internal/services/mariadb/mariadb_firewall_rule_resource_test.go +++ b/internal/services/mariadb/mariadb_firewall_rule_resource_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -49,17 +49,17 @@ func TestAccMariaDbFirewallRule_requiresImport(t *testing.T) { } func (MariaDbFirewallRuleResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.MariaDBFirewallRuleID(state.ID) + id, err := firewallrules.ParseFirewallRuleID(state.ID) if err != nil { return nil, err } - resp, err := clients.MariaDB.FirewallRulesClient.Get(ctx, id.ResourceGroup, id.ServerName, id.FirewallRuleName) + resp, err := clients.MariaDB.FirewallRulesClient.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %v", *id, err) } - return utils.Bool(resp.FirewallRuleProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } func (MariaDbFirewallRuleResource) basic(data acceptance.TestData) string { diff --git a/internal/services/mariadb/mariadb_server_data_source.go b/internal/services/mariadb/mariadb_server_data_source.go index 287aef2f68e17..180c47d9f7c3e 100644 --- a/internal/services/mariadb/mariadb_server_data_source.go +++ b/internal/services/mariadb/mariadb_server_data_source.go @@ -5,15 +5,15 @@ import ( "regexp" "time" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) func dataSourceMariaDbServer() *pluginsdk.Resource { @@ -91,7 +91,7 @@ func dataSourceMariaDbServer() *pluginsdk.Resource { Computed: true, }, - "tags": tags.SchemaDataSource(), + "tags": commonschema.TagsDataSource(), }, } } @@ -102,10 +102,10 @@ func dataSourceMariaDbServerRead(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewServerID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - resp, err := client.Get(ctx, id.ResourceGroup, id.Name) + id := servers.NewServerID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + resp, err := client.Get(ctx, id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return fmt.Errorf("%s was not found", id) } @@ -113,18 +113,45 @@ func dataSourceMariaDbServerRead(d *pluginsdk.ResourceData, meta interface{}) er } d.SetId(id.ID()) - d.Set("name", id.Name) - d.Set("resource_group_name", id.ResourceGroup) - d.Set("location", location.NormalizeNilable(resp.Location)) - if sku := resp.Sku; sku != nil { - d.Set("sku_name", sku.Name) - } + d.Set("name", id.ServerName) + d.Set("resource_group_name", id.ResourceGroupName) + + if model := resp.Model; model != nil { + d.Set("location", location.Normalize(model.Location)) + + if sku := model.Sku; sku != nil { + d.Set("sku_name", sku.Name) + } - if props := resp.ServerProperties; props != nil { - d.Set("administrator_login", props.AdministratorLogin) - d.Set("fqdn", props.FullyQualifiedDomainName) - d.Set("ssl_enforcement", string(props.SslEnforcement)) - d.Set("version", string(props.Version)) + if props := model.Properties; props != nil { + adminLogin := "" + if v := props.AdministratorLogin; v != nil { + adminLogin = *v + } + + fqdn := "" + if v := props.FullyQualifiedDomainName; v != nil { + fqdn = *v + } + + sslEnforcement := "" + if v := props.SslEnforcement; v != nil { + sslEnforcement = string(*v) + } + + version := "" + if v := props.Version; v != nil { + version = string(*v) + } + + d.Set("administrator_login", adminLogin) + d.Set("fqdn", fqdn) + d.Set("ssl_enforcement", sslEnforcement) + d.Set("version", version) + } + + return tags.FlattenAndSet(d, model.Tags) } - return tags.FlattenAndSet(d, resp.Tags) + + return nil } diff --git a/internal/services/mariadb/mariadb_server_resource.go b/internal/services/mariadb/mariadb_server_resource.go index 3f31eee1774ea..424e5f58cf7b0 100644 --- a/internal/services/mariadb/mariadb_server_resource.go +++ b/internal/services/mariadb/mariadb_server_resource.go @@ -8,14 +8,14 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb" - "github.com/Azure/go-autorest/autorest/date" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -30,7 +30,7 @@ func resourceMariaDbServer() *pluginsdk.Resource { Delete: resourceMariaDbServerDelete, Importer: pluginsdk.ImporterValidatingResourceIdThen(func(id string) error { - _, err := parse.ServerID(id) + _, err := servers.ParseServerID(id) return err }, func(ctx context.Context, d *pluginsdk.ResourceData, meta interface{}) ([]*pluginsdk.ResourceData, error) { d.Set("create_mode", "Default") @@ -42,7 +42,7 @@ func resourceMariaDbServer() *pluginsdk.Resource { }), Timeouts: &pluginsdk.ResourceTimeout{ - Create: pluginsdk.DefaultTimeout(60 * time.Minute), + Create: pluginsdk.DefaultTimeout(90 * time.Minute), Read: pluginsdk.DefaultTimeout(5 * time.Minute), Update: pluginsdk.DefaultTimeout(60 * time.Minute), Delete: pluginsdk.DefaultTimeout(60 * time.Minute), @@ -85,19 +85,19 @@ func resourceMariaDbServer() *pluginsdk.Resource { "create_mode": { Type: pluginsdk.TypeString, Optional: true, - Default: string(mariadb.CreateModeDefault), + Default: string(servers.CreateModeDefault), ValidateFunc: validation.StringInSlice([]string{ - string(mariadb.CreateModeDefault), - string(mariadb.CreateModeGeoRestore), - string(mariadb.CreateModePointInTimeRestore), - string(mariadb.CreateModeReplica), + string(servers.CreateModeDefault), + string(servers.CreateModeGeoRestore), + string(servers.CreateModePointInTimeRestore), + string(servers.CreateModeReplica), }, false), }, "creation_source_server_id": { Type: pluginsdk.TypeString, Optional: true, - ValidateFunc: validate.ServerID, + ValidateFunc: servers.ValidateServerID, }, "fqdn": { @@ -160,7 +160,7 @@ func resourceMariaDbServer() *pluginsdk.Resource { ), }, - "tags": tags.Schema(), + "tags": commonschema.Tags(), "version": { Type: pluginsdk.TypeString, @@ -181,45 +181,45 @@ func resourceMariaDbServerCreate(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewServerID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + id := servers.NewServerID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.Name) + existing, err := client.Get(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_mariadb_server", id.ID()) } } location := azure.NormalizeLocation(d.Get("location").(string)) - mode := mariadb.CreateMode(d.Get("create_mode").(string)) + mode := servers.CreateMode(d.Get("create_mode").(string)) source := d.Get("creation_source_server_id").(string) - version := mariadb.ServerVersion(d.Get("version").(string)) + version := servers.ServerVersion(d.Get("version").(string)) sku, err := expandServerSkuName(d.Get("sku_name").(string)) if err != nil { return fmt.Errorf("expanding `sku_name`: %+v", err) } - publicAccess := mariadb.PublicNetworkAccessEnumEnabled + publicAccess := servers.PublicNetworkAccessEnumEnabled if v := d.Get("public_network_access_enabled"); !v.(bool) { - publicAccess = mariadb.PublicNetworkAccessEnumDisabled + publicAccess = servers.PublicNetworkAccessEnumDisabled } - ssl := mariadb.SslEnforcementEnumEnabled + ssl := servers.SslEnforcementEnumEnabled if v := d.Get("ssl_enforcement_enabled").(bool); !v { - ssl = mariadb.SslEnforcementEnumDisabled + ssl = servers.SslEnforcementEnumDisabled } storage := expandMariaDbStorageProfile(d) - var props mariadb.BasicServerPropertiesForCreate + var props servers.ServerPropertiesForCreate switch mode { - case mariadb.CreateModeDefault: + case servers.CreateModeDefault: admin := d.Get("administrator_login").(string) pass := d.Get("administrator_login_password").(string) @@ -234,68 +234,57 @@ func resourceMariaDbServerCreate(d *pluginsdk.ResourceData, meta interface{}) er return fmt.Errorf("`restore_point_in_time` cannot be set when `create_mode` is `default`") } - props = &mariadb.ServerPropertiesForDefaultCreate{ - AdministratorLogin: &admin, - AdministratorLoginPassword: &pass, - CreateMode: mode, - PublicNetworkAccess: publicAccess, - SslEnforcement: ssl, + props = servers.ServerPropertiesForDefaultCreate{ + AdministratorLogin: admin, + AdministratorLoginPassword: pass, + PublicNetworkAccess: &publicAccess, + SslEnforcement: &ssl, StorageProfile: storage, - Version: version, + Version: &version, } - case mariadb.CreateModePointInTimeRestore: + + case servers.CreateModePointInTimeRestore: v, ok := d.GetOk("restore_point_in_time") if !ok || v.(string) == "" { return fmt.Errorf("restore_point_in_time must be set when create_mode is PointInTimeRestore") } - time, _ := time.Parse(time.RFC3339, v.(string)) // should be validated by the schema - props = &mariadb.ServerPropertiesForRestore{ - CreateMode: mode, - SourceServerID: &source, - RestorePointInTime: &date.Time{ - Time: time, - }, - PublicNetworkAccess: publicAccess, - SslEnforcement: ssl, + props = &servers.ServerPropertiesForRestore{ + SourceServerId: source, + RestorePointInTime: v.(string), + PublicNetworkAccess: &publicAccess, + SslEnforcement: &ssl, StorageProfile: storage, - Version: version, + Version: &version, } - case mariadb.CreateModeGeoRestore: - props = &mariadb.ServerPropertiesForGeoRestore{ - CreateMode: mode, - SourceServerID: &source, - PublicNetworkAccess: publicAccess, - SslEnforcement: ssl, + case servers.CreateModeGeoRestore: + props = &servers.ServerPropertiesForGeoRestore{ + SourceServerId: source, + PublicNetworkAccess: &publicAccess, + SslEnforcement: &ssl, StorageProfile: storage, - Version: version, + Version: &version, } - case mariadb.CreateModeReplica: - props = &mariadb.ServerPropertiesForReplica{ - CreateMode: mode, - SourceServerID: &source, - PublicNetworkAccess: publicAccess, - SslEnforcement: ssl, - Version: version, + case servers.CreateModeReplica: + props = &servers.ServerPropertiesForReplica{ + SourceServerId: source, + PublicNetworkAccess: &publicAccess, + SslEnforcement: &ssl, + Version: &version, } } - server := mariadb.ServerForCreate{ - Location: &location, + server := servers.ServerForCreate{ + Location: location, Properties: props, Sku: sku, Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - future, err := client.Create(ctx, id.ResourceGroup, id.Name, server) - if err != nil { + if err := client.CreateThenPoll(ctx, id, server); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for the creation of %s: %+v", id, err) - } - d.SetId(id.ID()) return resourceMariaDbServerRead(d, meta) } @@ -307,7 +296,7 @@ func resourceMariaDbServerUpdate(d *pluginsdk.ResourceData, meta interface{}) er log.Printf("[INFO] preparing arguments for AzureRM MariaDB Server update.") - id, err := parse.ServerID(d.Id()) + id, err := servers.ParseServerID(d.Id()) if err != nil { return err } @@ -317,39 +306,34 @@ func resourceMariaDbServerUpdate(d *pluginsdk.ResourceData, meta interface{}) er return fmt.Errorf("expanding `sku_name`: %+v", err) } - publicAccess := mariadb.PublicNetworkAccessEnumEnabled + publicAccess := servers.PublicNetworkAccessEnumEnabled if v := d.Get("public_network_access_enabled").(bool); !v { - publicAccess = mariadb.PublicNetworkAccessEnumDisabled + publicAccess = servers.PublicNetworkAccessEnumDisabled } - ssl := mariadb.SslEnforcementEnumEnabled + ssl := servers.SslEnforcementEnumEnabled if v := d.Get("ssl_enforcement_enabled").(bool); !v { - ssl = mariadb.SslEnforcementEnumDisabled + ssl = servers.SslEnforcementEnumDisabled } storageProfile := expandMariaDbStorageProfile(d) - - properties := mariadb.ServerUpdateParameters{ - ServerUpdateParametersProperties: &mariadb.ServerUpdateParametersProperties{ + serverVersion := servers.ServerVersion(d.Get("version").(string)) + properties := servers.ServerUpdateParameters{ + Properties: &servers.ServerUpdateParametersProperties{ AdministratorLoginPassword: utils.String(d.Get("administrator_login_password").(string)), - PublicNetworkAccess: publicAccess, - SslEnforcement: ssl, + PublicNetworkAccess: &publicAccess, + SslEnforcement: &ssl, StorageProfile: storageProfile, - Version: mariadb.ServerVersion(d.Get("version").(string)), + Version: &serverVersion, }, Sku: sku, Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - future, err := client.Update(ctx, id.ResourceGroup, id.Name, properties) - if err != nil { + if err := client.UpdateThenPoll(ctx, *id, properties); err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for update of %s: %+v", *id, err) - } - return resourceMariaDbServerRead(d, meta) } @@ -358,14 +342,14 @@ func resourceMariaDbServerRead(d *pluginsdk.ResourceData, meta interface{}) erro ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ServerID(d.Id()) + id, err := servers.ParseServerID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.Name) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[WARN] %s was not found - removing from state", *id) d.SetId("") return nil @@ -374,35 +358,60 @@ func resourceMariaDbServerRead(d *pluginsdk.ResourceData, meta interface{}) erro return fmt.Errorf("retrieving %s: %+v", *id, err) } - d.Set("name", id.Name) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("name", id.ServerName) + d.Set("resource_group_name", id.ResourceGroupName) - if location := resp.Location; location != nil { - d.Set("location", azure.NormalizeLocation(*location)) - } + if model := resp.Model; model != nil { + d.Set("location", azure.NormalizeLocation(model.Location)) - if sku := resp.Sku; sku != nil { - d.Set("sku_name", sku.Name) - } - - if props := resp.ServerProperties; props != nil { - d.Set("administrator_login", props.AdministratorLogin) - d.Set("public_network_access_enabled", props.PublicNetworkAccess == mariadb.PublicNetworkAccessEnumEnabled) - d.Set("ssl_enforcement_enabled", props.SslEnforcement == mariadb.SslEnforcementEnumEnabled) - d.Set("version", string(props.Version)) - - if storage := props.StorageProfile; storage != nil { - d.Set("auto_grow_enabled", storage.StorageAutogrow == mariadb.StorageAutogrowEnabled) - d.Set("backup_retention_days", storage.BackupRetentionDays) - d.Set("geo_redundant_backup_enabled", storage.GeoRedundantBackup == mariadb.Enabled) - d.Set("storage_mb", storage.StorageMB) + if sku := model.Sku; sku != nil { + d.Set("sku_name", sku.Name) } - // Computed - d.Set("fqdn", props.FullyQualifiedDomainName) - } + if props := model.Properties; props != nil { + d.Set("administrator_login", props.AdministratorLogin) - return tags.FlattenAndSet(d, resp.Tags) + publicNetworkAccess := false + if props.PublicNetworkAccess != nil { + publicNetworkAccess = *props.PublicNetworkAccess == servers.PublicNetworkAccessEnumEnabled + } + d.Set("public_network_access_enabled", publicNetworkAccess) + + sslEnforcement := false + if props.SslEnforcement != nil { + sslEnforcement = *props.SslEnforcement == servers.SslEnforcementEnumEnabled + } + d.Set("ssl_enforcement_enabled", sslEnforcement) + + version := "" + if props.Version != nil { + version = string(*props.Version) + } + d.Set("version", version) + + if storage := props.StorageProfile; storage != nil { + autoGrow := false + if storage.StorageAutogrow != nil { + autoGrow = *storage.StorageAutogrow == servers.StorageAutogrowEnabled + } + d.Set("auto_grow_enabled", autoGrow) + + geoRedundant := false + if storage.GeoRedundantBackup != nil { + geoRedundant = *storage.GeoRedundantBackup == servers.GeoRedundantBackupEnabled + } + d.Set("geo_redundant_backup_enabled", geoRedundant) + d.Set("backup_retention_days", storage.BackupRetentionDays) + d.Set("storage_mb", storage.StorageMB) + + } + + // Computed + d.Set("fqdn", props.FullyQualifiedDomainName) + } + return tags.FlattenAndSet(d, model.Tags) + } + return nil } func resourceMariaDbServerDelete(d *pluginsdk.ResourceData, meta interface{}) error { @@ -410,37 +419,32 @@ func resourceMariaDbServerDelete(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ServerID(d.Id()) + id, err := servers.ParseServerID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.Name) - if err != nil { + if err := client.DeleteThenPoll(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for the deletion of %s: %+v", *id, err) - } - return nil } -func expandServerSkuName(skuName string) (*mariadb.Sku, error) { +func expandServerSkuName(skuName string) (*servers.Sku, error) { parts := strings.Split(skuName, "_") if len(parts) != 3 { return nil, fmt.Errorf("sku_name (%s) has the wrong number of parts (%d) after splitting on _", skuName, len(parts)) } - var tier mariadb.SkuTier + var tier servers.SkuTier switch parts[0] { case "B": - tier = mariadb.Basic + tier = servers.SkuTierBasic case "GP": - tier = mariadb.GeneralPurpose + tier = servers.SkuTierGeneralPurpose case "MO": - tier = mariadb.MemoryOptimized + tier = servers.SkuTierMemoryOptimized default: return nil, fmt.Errorf("sku_name %s has unknown sku tier %s", skuName, parts[0]) } @@ -450,37 +454,39 @@ func expandServerSkuName(skuName string) (*mariadb.Sku, error) { return nil, fmt.Errorf("cannot convert `sku_name` %q capacity %s to int", skuName, parts[2]) } - return &mariadb.Sku{ - Name: utils.String(skuName), - Tier: tier, - Capacity: utils.Int32(int32(capacity)), + return &servers.Sku{ + Name: skuName, + Tier: &tier, + Capacity: utils.Int64(int64(capacity)), Family: utils.String(parts[1]), }, nil } -func expandMariaDbStorageProfile(d *pluginsdk.ResourceData) *mariadb.StorageProfile { - storage := mariadb.StorageProfile{} +func expandMariaDbStorageProfile(d *pluginsdk.ResourceData) *servers.StorageProfile { + storage := servers.StorageProfile{} // now override whatever we may have from the block with the top level properties if v, ok := d.GetOk("auto_grow_enabled"); ok { - storage.StorageAutogrow = mariadb.StorageAutogrowDisabled + autogrowEnabled := servers.StorageAutogrowDisabled if v.(bool) { - storage.StorageAutogrow = mariadb.StorageAutogrowEnabled + autogrowEnabled = servers.StorageAutogrowEnabled } + storage.StorageAutogrow = &autogrowEnabled } if v, ok := d.GetOk("backup_retention_days"); ok { - storage.BackupRetentionDays = utils.Int32(int32(v.(int))) + storage.BackupRetentionDays = utils.Int64(int64(v.(int))) } if v, ok := d.GetOk("geo_redundant_backup_enabled"); ok { - storage.GeoRedundantBackup = mariadb.Disabled + geoRedundantBackup := servers.GeoRedundantBackupDisabled if v.(bool) { - storage.GeoRedundantBackup = mariadb.Enabled + geoRedundantBackup = servers.GeoRedundantBackupEnabled } + storage.GeoRedundantBackup = &geoRedundantBackup } if v, ok := d.GetOk("storage_mb"); ok { - storage.StorageMB = utils.Int32(int32(v.(int))) + storage.StorageMB = utils.Int64(int64(v.(int))) } return &storage diff --git a/internal/services/mariadb/mariadb_server_resource_test.go b/internal/services/mariadb/mariadb_server_resource_test.go index 45b2bde401a75..25e2f5b3b0644 100644 --- a/internal/services/mariadb/mariadb_server_resource_test.go +++ b/internal/services/mariadb/mariadb_server_resource_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -199,17 +199,17 @@ func TestAccMariaDbServer_createPointInTimeRestore(t *testing.T) { } func (MariaDbServerResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.ServerID(state.ID) + id, err := servers.ParseServerID(state.ID) if err != nil { return nil, err } - resp, err := clients.MariaDB.ServersClient.Get(ctx, id.ResourceGroup, id.Name) + resp, err := clients.MariaDB.ServersClient.Get(ctx, *id) if err != nil { - return nil, fmt.Errorf("retrieving MariaDB Server %q (Resource Group %q): %v", id.Name, id.ResourceGroup, err) + return nil, fmt.Errorf("retrieving %s: %v", *id, err) } - return utils.Bool(resp.ServerProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } func (MariaDbServerResource) basic(data acceptance.TestData, version string) string { diff --git a/internal/services/mariadb/mariadb_virtual_network_rule_resource.go b/internal/services/mariadb/mariadb_virtual_network_rule_resource.go index c7af2b36673a7..00347fe437949 100644 --- a/internal/services/mariadb/mariadb_virtual_network_rule_resource.go +++ b/internal/services/mariadb/mariadb_virtual_network_rule_resource.go @@ -6,12 +6,11 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/validate" validate2 "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -26,7 +25,7 @@ func resourceMariaDbVirtualNetworkRule() *pluginsdk.Resource { Update: resourceMariaDbVirtualNetworkRuleCreateUpdate, Delete: resourceMariaDbVirtualNetworkRuleDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := parse.MariaDBVirtualNetworkRuleID(id) + _, err := virtualnetworkrules.ParseVirtualNetworkRuleID(id) return err }), @@ -69,44 +68,40 @@ func resourceMariaDbVirtualNetworkRuleCreateUpdate(d *pluginsdk.ResourceData, me ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewMariaDBVirtualNetworkRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) + id := virtualnetworkrules.NewVirtualNetworkRuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("server_name").(string), d.Get("name").(string)) subnetId := d.Get("subnet_id").(string) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.VirtualNetworkRuleName) + existing, err := client.Get(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_mariadb_virtual_network_rule", id.ID()) } } - parameters := mariadb.VirtualNetworkRule{ - VirtualNetworkRuleProperties: &mariadb.VirtualNetworkRuleProperties{ - VirtualNetworkSubnetID: utils.String(subnetId), + parameters := virtualnetworkrules.VirtualNetworkRule{ + Properties: &virtualnetworkrules.VirtualNetworkRuleProperties{ + VirtualNetworkSubnetId: subnetId, IgnoreMissingVnetServiceEndpoint: utils.Bool(false), }, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServerName, id.VirtualNetworkRuleName, parameters) - if err != nil { + if err := client.CreateOrUpdateThenPoll(ctx, id, parameters); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for creation/update of %q: %+v", id, err) - } // Wait for the provisioning state to become ready log.Printf("[DEBUG] Waiting for %s to become ready", id) stateConf := &pluginsdk.StateChangeConf{ Pending: []string{"Initializing", "InProgress", "Unknown", "ResponseNotFound"}, Target: []string{"Ready"}, - Refresh: mariaDbVirtualNetworkStateStatusCodeRefreshFunc(ctx, client, id.ResourceGroup, id.ServerName, id.VirtualNetworkRuleName), + Refresh: mariaDbVirtualNetworkStateStatusCodeRefreshFunc(ctx, client, id), MinTimeout: 1 * time.Minute, ContinuousTargetOccurence: 5, } @@ -130,14 +125,14 @@ func resourceMariaDbVirtualNetworkRuleRead(d *pluginsdk.ResourceData, meta inter ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBVirtualNetworkRuleID(d.Id()) + id, err := virtualnetworkrules.ParseVirtualNetworkRuleID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.ServerName, id.VirtualNetworkRuleName) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[INFO] Error reading MariaDb Virtual Network Rule %q - removing from state", d.Id()) d.SetId("") return nil @@ -147,11 +142,13 @@ func resourceMariaDbVirtualNetworkRuleRead(d *pluginsdk.ResourceData, meta inter } d.Set("name", id.VirtualNetworkRuleName) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("resource_group_name", id.ResourceGroupName) d.Set("server_name", id.ServerName) - if props := resp.VirtualNetworkRuleProperties; props != nil { - d.Set("subnet_id", props.VirtualNetworkSubnetID) + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + d.Set("subnet_id", props.VirtualNetworkSubnetId) + } } return nil @@ -162,44 +159,40 @@ func resourceMariaDbVirtualNetworkRuleDelete(d *pluginsdk.ResourceData, meta int ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.MariaDBVirtualNetworkRuleID(d.Id()) + id, err := virtualnetworkrules.ParseVirtualNetworkRuleID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.ServerName, id.VirtualNetworkRuleName) - if err != nil { + if err := client.DeleteThenPoll(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - if !response.WasNotFound(future.Response()) { - return fmt.Errorf("waiting for deletion of %s: %+v", *id, err) - } - } - return nil } -func mariaDbVirtualNetworkStateStatusCodeRefreshFunc(ctx context.Context, client *mariadb.VirtualNetworkRulesClient, resourceGroup string, serverName string, name string) pluginsdk.StateRefreshFunc { +func mariaDbVirtualNetworkStateStatusCodeRefreshFunc(ctx context.Context, client *virtualnetworkrules.VirtualNetworkRulesClient, id virtualnetworkrules.VirtualNetworkRuleId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { - resp, err := client.Get(ctx, resourceGroup, serverName, name) + resp, err := client.Get(ctx, id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { - log.Printf("[DEBUG] Retrieving MariaDb Virtual Network Rule %q (MariaDb Server: %q, Resource Group: %q) returned 404.", resourceGroup, serverName, name) + if response.WasNotFound(resp.HttpResponse) { + log.Printf("[DEBUG] Retrieving %s returned 404.", id) return nil, "ResponseNotFound", nil } - return nil, "", fmt.Errorf("polling for the state of the MariaDb Virtual Network Rule %q (MariaDb Server: %q, Resource Group: %q): %+v", name, serverName, resourceGroup, err) + return nil, "", fmt.Errorf("polling for the state of %s: %+v", id, err) } - if props := resp.VirtualNetworkRuleProperties; props != nil { - log.Printf("[DEBUG] Retrieving MariaDb Virtual Network Rule %q (MariaDb Server: %q, Resource Group: %q) returned Status %s", resourceGroup, serverName, name, props.State) - return resp, string(props.State), nil + if model := resp.Model; model != nil { + if props := model.Properties; props != nil { + log.Printf("[DEBUG] Retrieving %s returned Status %s", id, *props.State) + return resp, string(*props.State), nil + + } } // Valid response was returned but VirtualNetworkRuleProperties was nil. Basically the rule exists, but with no properties for some reason. Assume Unknown instead of returning error. - log.Printf("[DEBUG] Retrieving MariaDb Virtual Network Rule %q (MariaDb Server: %q, Resource Group: %q) returned empty VirtualNetworkRuleProperties", resourceGroup, serverName, name) + log.Printf("[DEBUG] Retrieving %s returned empty VirtualNetworkRuleProperties", id) return resp, "Unknown", nil } } diff --git a/internal/services/mariadb/mariadb_virtual_network_rule_resource_test.go b/internal/services/mariadb/mariadb_virtual_network_rule_resource_test.go index b399f8fdbb934..aa37b5bbd3212 100644 --- a/internal/services/mariadb/mariadb_virtual_network_rule_resource_test.go +++ b/internal/services/mariadb/mariadb_virtual_network_rule_resource_test.go @@ -6,10 +6,10 @@ import ( "regexp" "testing" + "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -91,17 +91,17 @@ func TestAccMariaDbVirtualNetworkRule_multipleSubnets(t *testing.T) { } func (MariaDbVirtualNetworkRuleResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.MariaDBVirtualNetworkRuleID(state.ID) + id, err := virtualnetworkrules.ParseVirtualNetworkRuleID(state.ID) if err != nil { return nil, err } - resp, err := clients.MariaDB.VirtualNetworkRulesClient.Get(ctx, id.ResourceGroup, id.ServerName, id.VirtualNetworkRuleName) + resp, err := clients.MariaDB.VirtualNetworkRulesClient.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %v", *id, err) } - return utils.Bool(resp.VirtualNetworkRuleProperties != nil), nil + return utils.Bool(resp.Model != nil), nil } func (MariaDbVirtualNetworkRuleResource) basic(data acceptance.TestData) string { diff --git a/internal/services/mariadb/parse/maria_db_configuration.go b/internal/services/mariadb/parse/maria_db_configuration.go deleted file mode 100644 index 5f3140e286303..0000000000000 --- a/internal/services/mariadb/parse/maria_db_configuration.go +++ /dev/null @@ -1,75 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type MariaDBConfigurationId struct { - SubscriptionId string - ResourceGroup string - ServerName string - ConfigurationName string -} - -func NewMariaDBConfigurationID(subscriptionId, resourceGroup, serverName, configurationName string) MariaDBConfigurationId { - return MariaDBConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - ServerName: serverName, - ConfigurationName: configurationName, - } -} - -func (id MariaDBConfigurationId) String() string { - segments := []string{ - fmt.Sprintf("Configuration Name %q", id.ConfigurationName), - fmt.Sprintf("Server Name %q", id.ServerName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Maria D B Configuration", segmentsStr) -} - -func (id MariaDBConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/configurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.ServerName, id.ConfigurationName) -} - -// MariaDBConfigurationID parses a MariaDBConfiguration ID into an MariaDBConfigurationId struct -func MariaDBConfigurationID(input string) (*MariaDBConfigurationId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := MariaDBConfigurationId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.ServerName, err = id.PopSegment("servers"); err != nil { - return nil, err - } - if resourceId.ConfigurationName, err = id.PopSegment("configurations"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/mariadb/parse/maria_db_configuration_test.go b/internal/services/mariadb/parse/maria_db_configuration_test.go deleted file mode 100644 index 63e32230b1c1c..0000000000000 --- a/internal/services/mariadb/parse/maria_db_configuration_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = MariaDBConfigurationId{} - -func TestMariaDBConfigurationIDFormatter(t *testing.T) { - actual := NewMariaDBConfigurationID("12345678-1234-9876-4563-123456789012", "resGroup1", "server1", "config1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/configurations/config1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestMariaDBConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MariaDBConfigurationId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Error: true, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Error: true, - }, - - { - // missing ConfigurationName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Error: true, - }, - - { - // missing value for ConfigurationName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/configurations/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/configurations/config1", - Expected: &MariaDBConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - ServerName: "server1", - ConfigurationName: "config1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/CONFIGURATIONS/CONFIG1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := MariaDBConfigurationID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - if actual.ConfigurationName != v.Expected.ConfigurationName { - t.Fatalf("Expected %q but got %q for ConfigurationName", v.Expected.ConfigurationName, actual.ConfigurationName) - } - } -} diff --git a/internal/services/mariadb/parse/maria_db_database.go b/internal/services/mariadb/parse/maria_db_database.go deleted file mode 100644 index 6dd9d3339acc8..0000000000000 --- a/internal/services/mariadb/parse/maria_db_database.go +++ /dev/null @@ -1,75 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type MariaDBDatabaseId struct { - SubscriptionId string - ResourceGroup string - ServerName string - DatabaseName string -} - -func NewMariaDBDatabaseID(subscriptionId, resourceGroup, serverName, databaseName string) MariaDBDatabaseId { - return MariaDBDatabaseId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - ServerName: serverName, - DatabaseName: databaseName, - } -} - -func (id MariaDBDatabaseId) String() string { - segments := []string{ - fmt.Sprintf("Database Name %q", id.DatabaseName), - fmt.Sprintf("Server Name %q", id.ServerName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Maria D B Database", segmentsStr) -} - -func (id MariaDBDatabaseId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/databases/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.ServerName, id.DatabaseName) -} - -// MariaDBDatabaseID parses a MariaDBDatabase ID into an MariaDBDatabaseId struct -func MariaDBDatabaseID(input string) (*MariaDBDatabaseId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := MariaDBDatabaseId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.ServerName, err = id.PopSegment("servers"); err != nil { - return nil, err - } - if resourceId.DatabaseName, err = id.PopSegment("databases"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/mariadb/parse/maria_db_database_test.go b/internal/services/mariadb/parse/maria_db_database_test.go deleted file mode 100644 index c5d9b1b08c956..0000000000000 --- a/internal/services/mariadb/parse/maria_db_database_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = MariaDBDatabaseId{} - -func TestMariaDBDatabaseIDFormatter(t *testing.T) { - actual := NewMariaDBDatabaseID("12345678-1234-9876-4563-123456789012", "resGroup1", "server1", "db1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/databases/db1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestMariaDBDatabaseID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MariaDBDatabaseId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Error: true, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Error: true, - }, - - { - // missing DatabaseName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Error: true, - }, - - { - // missing value for DatabaseName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/databases/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/databases/db1", - Expected: &MariaDBDatabaseId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - ServerName: "server1", - DatabaseName: "db1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/DATABASES/DB1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := MariaDBDatabaseID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - if actual.DatabaseName != v.Expected.DatabaseName { - t.Fatalf("Expected %q but got %q for DatabaseName", v.Expected.DatabaseName, actual.DatabaseName) - } - } -} diff --git a/internal/services/mariadb/parse/maria_db_firewall_rule.go b/internal/services/mariadb/parse/maria_db_firewall_rule.go deleted file mode 100644 index 3153fd283942b..0000000000000 --- a/internal/services/mariadb/parse/maria_db_firewall_rule.go +++ /dev/null @@ -1,75 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type MariaDBFirewallRuleId struct { - SubscriptionId string - ResourceGroup string - ServerName string - FirewallRuleName string -} - -func NewMariaDBFirewallRuleID(subscriptionId, resourceGroup, serverName, firewallRuleName string) MariaDBFirewallRuleId { - return MariaDBFirewallRuleId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - ServerName: serverName, - FirewallRuleName: firewallRuleName, - } -} - -func (id MariaDBFirewallRuleId) String() string { - segments := []string{ - fmt.Sprintf("Firewall Rule Name %q", id.FirewallRuleName), - fmt.Sprintf("Server Name %q", id.ServerName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Maria D B Firewall Rule", segmentsStr) -} - -func (id MariaDBFirewallRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/firewallRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.ServerName, id.FirewallRuleName) -} - -// MariaDBFirewallRuleID parses a MariaDBFirewallRule ID into an MariaDBFirewallRuleId struct -func MariaDBFirewallRuleID(input string) (*MariaDBFirewallRuleId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := MariaDBFirewallRuleId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.ServerName, err = id.PopSegment("servers"); err != nil { - return nil, err - } - if resourceId.FirewallRuleName, err = id.PopSegment("firewallRules"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/mariadb/parse/maria_db_firewall_rule_test.go b/internal/services/mariadb/parse/maria_db_firewall_rule_test.go deleted file mode 100644 index 86aaca3e4ec42..0000000000000 --- a/internal/services/mariadb/parse/maria_db_firewall_rule_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = MariaDBFirewallRuleId{} - -func TestMariaDBFirewallRuleIDFormatter(t *testing.T) { - actual := NewMariaDBFirewallRuleID("12345678-1234-9876-4563-123456789012", "resGroup1", "server1", "firewallRule1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/firewallRules/firewallRule1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestMariaDBFirewallRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MariaDBFirewallRuleId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Error: true, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Error: true, - }, - - { - // missing FirewallRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Error: true, - }, - - { - // missing value for FirewallRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/firewallRules/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/firewallRules/firewallRule1", - Expected: &MariaDBFirewallRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - ServerName: "server1", - FirewallRuleName: "firewallRule1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/FIREWALLRULES/FIREWALLRULE1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := MariaDBFirewallRuleID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - if actual.FirewallRuleName != v.Expected.FirewallRuleName { - t.Fatalf("Expected %q but got %q for FirewallRuleName", v.Expected.FirewallRuleName, actual.FirewallRuleName) - } - } -} diff --git a/internal/services/mariadb/parse/maria_db_virtual_network_rule.go b/internal/services/mariadb/parse/maria_db_virtual_network_rule.go deleted file mode 100644 index c1ef6a2c7d1af..0000000000000 --- a/internal/services/mariadb/parse/maria_db_virtual_network_rule.go +++ /dev/null @@ -1,75 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type MariaDBVirtualNetworkRuleId struct { - SubscriptionId string - ResourceGroup string - ServerName string - VirtualNetworkRuleName string -} - -func NewMariaDBVirtualNetworkRuleID(subscriptionId, resourceGroup, serverName, virtualNetworkRuleName string) MariaDBVirtualNetworkRuleId { - return MariaDBVirtualNetworkRuleId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - ServerName: serverName, - VirtualNetworkRuleName: virtualNetworkRuleName, - } -} - -func (id MariaDBVirtualNetworkRuleId) String() string { - segments := []string{ - fmt.Sprintf("Virtual Network Rule Name %q", id.VirtualNetworkRuleName), - fmt.Sprintf("Server Name %q", id.ServerName), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Maria D B Virtual Network Rule", segmentsStr) -} - -func (id MariaDBVirtualNetworkRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/virtualNetworkRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.ServerName, id.VirtualNetworkRuleName) -} - -// MariaDBVirtualNetworkRuleID parses a MariaDBVirtualNetworkRule ID into an MariaDBVirtualNetworkRuleId struct -func MariaDBVirtualNetworkRuleID(input string) (*MariaDBVirtualNetworkRuleId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := MariaDBVirtualNetworkRuleId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.ServerName, err = id.PopSegment("servers"); err != nil { - return nil, err - } - if resourceId.VirtualNetworkRuleName, err = id.PopSegment("virtualNetworkRules"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/mariadb/parse/maria_db_virtual_network_rule_test.go b/internal/services/mariadb/parse/maria_db_virtual_network_rule_test.go deleted file mode 100644 index 245d578ecd4df..0000000000000 --- a/internal/services/mariadb/parse/maria_db_virtual_network_rule_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = MariaDBVirtualNetworkRuleId{} - -func TestMariaDBVirtualNetworkRuleIDFormatter(t *testing.T) { - actual := NewMariaDBVirtualNetworkRuleID("12345678-1234-9876-4563-123456789012", "resGroup1", "server1", "vnetrule1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/virtualNetworkRules/vnetrule1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestMariaDBVirtualNetworkRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MariaDBVirtualNetworkRuleId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Error: true, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Error: true, - }, - - { - // missing VirtualNetworkRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Error: true, - }, - - { - // missing value for VirtualNetworkRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/virtualNetworkRules/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/virtualNetworkRules/vnetrule1", - Expected: &MariaDBVirtualNetworkRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - ServerName: "server1", - VirtualNetworkRuleName: "vnetrule1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/VIRTUALNETWORKRULES/VNETRULE1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := MariaDBVirtualNetworkRuleID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - if actual.VirtualNetworkRuleName != v.Expected.VirtualNetworkRuleName { - t.Fatalf("Expected %q but got %q for VirtualNetworkRuleName", v.Expected.VirtualNetworkRuleName, actual.VirtualNetworkRuleName) - } - } -} diff --git a/internal/services/mariadb/parse/server.go b/internal/services/mariadb/parse/server.go deleted file mode 100644 index 20bc1f33fa3db..0000000000000 --- a/internal/services/mariadb/parse/server.go +++ /dev/null @@ -1,69 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -type ServerId struct { - SubscriptionId string - ResourceGroup string - Name string -} - -func NewServerID(subscriptionId, resourceGroup, name string) ServerId { - return ServerId{ - SubscriptionId: subscriptionId, - ResourceGroup: resourceGroup, - Name: name, - } -} - -func (id ServerId) String() string { - segments := []string{ - fmt.Sprintf("Name %q", id.Name), - fmt.Sprintf("Resource Group %q", id.ResourceGroup), - } - segmentsStr := strings.Join(segments, " / ") - return fmt.Sprintf("%s: (%s)", "Server", segmentsStr) -} - -func (id ServerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.Name) -} - -// ServerID parses a Server ID into an ServerId struct -func ServerID(input string) (*ServerId, error) { - id, err := resourceids.ParseAzureResourceID(input) - if err != nil { - return nil, err - } - - resourceId := ServerId{ - SubscriptionId: id.SubscriptionID, - ResourceGroup: id.ResourceGroup, - } - - if resourceId.SubscriptionId == "" { - return nil, fmt.Errorf("ID was missing the 'subscriptions' element") - } - - if resourceId.ResourceGroup == "" { - return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") - } - - if resourceId.Name, err = id.PopSegment("servers"); err != nil { - return nil, err - } - - if err := id.ValidateNoEmptySegments(input); err != nil { - return nil, err - } - - return &resourceId, nil -} diff --git a/internal/services/mariadb/parse/server_test.go b/internal/services/mariadb/parse/server_test.go deleted file mode 100644 index 5a8802e547663..0000000000000 --- a/internal/services/mariadb/parse/server_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package parse - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "testing" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.Id = ServerId{} - -func TestServerIDFormatter(t *testing.T) { - actual := NewServerID("12345678-1234-9876-4563-123456789012", "resGroup1", "server1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1" - if actual != expected { - t.Fatalf("Expected %q but got %q", expected, actual) - } -} - -func TestServerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerId - }{ - - { - // empty - Input: "", - Error: true, - }, - - { - // missing SubscriptionId - Input: "/", - Error: true, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Error: true, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Error: true, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Error: true, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Error: true, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Error: true, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1", - Expected: &ServerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroup: "resGroup1", - Name: "server1", - }, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1", - Error: true, - }, - } - - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ServerID(v.Input) - if err != nil { - if v.Error { - continue - } - - t.Fatalf("Expect a value but got an error: %s", err) - } - if v.Error { - t.Fatal("Expect an error but didn't get one") - } - - if actual.SubscriptionId != v.Expected.SubscriptionId { - t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) - } - if actual.ResourceGroup != v.Expected.ResourceGroup { - t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) - } - if actual.Name != v.Expected.Name { - t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) - } - } -} diff --git a/internal/services/mariadb/resourceids.go b/internal/services/mariadb/resourceids.go deleted file mode 100644 index da078e4831b72..0000000000000 --- a/internal/services/mariadb/resourceids.go +++ /dev/null @@ -1,7 +0,0 @@ -package mariadb - -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Server -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=MariaDBFirewallRule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/firewallRules/firewallRule1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=MariaDBVirtualNetworkRule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/virtualNetworkRules/vnetrule1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=MariaDBConfiguration -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/configurations/config1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=MariaDBDatabase -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/databases/db1 diff --git a/internal/services/mariadb/validate/maria_db_configuration_id.go b/internal/services/mariadb/validate/maria_db_configuration_id.go deleted file mode 100644 index cb4f33723c41c..0000000000000 --- a/internal/services/mariadb/validate/maria_db_configuration_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" -) - -func MariaDBConfigurationID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.MariaDBConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/mariadb/validate/maria_db_configuration_id_test.go b/internal/services/mariadb/validate/maria_db_configuration_id_test.go deleted file mode 100644 index c92c8b16023d4..0000000000000 --- a/internal/services/mariadb/validate/maria_db_configuration_id_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestMariaDBConfigurationID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Valid: false, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Valid: false, - }, - - { - // missing ConfigurationName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Valid: false, - }, - - { - // missing value for ConfigurationName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/configurations/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/configurations/config1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/CONFIGURATIONS/CONFIG1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := MariaDBConfigurationID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/mariadb/validate/maria_db_database_id.go b/internal/services/mariadb/validate/maria_db_database_id.go deleted file mode 100644 index 72ace30d7eabb..0000000000000 --- a/internal/services/mariadb/validate/maria_db_database_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" -) - -func MariaDBDatabaseID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.MariaDBDatabaseID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/mariadb/validate/maria_db_database_id_test.go b/internal/services/mariadb/validate/maria_db_database_id_test.go deleted file mode 100644 index 860f79311e1bb..0000000000000 --- a/internal/services/mariadb/validate/maria_db_database_id_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestMariaDBDatabaseID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Valid: false, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Valid: false, - }, - - { - // missing DatabaseName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Valid: false, - }, - - { - // missing value for DatabaseName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/databases/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/databases/db1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/DATABASES/DB1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := MariaDBDatabaseID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/mariadb/validate/maria_db_firewall_rule_id.go b/internal/services/mariadb/validate/maria_db_firewall_rule_id.go deleted file mode 100644 index 469e95bf6ac95..0000000000000 --- a/internal/services/mariadb/validate/maria_db_firewall_rule_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" -) - -func MariaDBFirewallRuleID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.MariaDBFirewallRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/mariadb/validate/maria_db_firewall_rule_id_test.go b/internal/services/mariadb/validate/maria_db_firewall_rule_id_test.go deleted file mode 100644 index 72cf474ee02f1..0000000000000 --- a/internal/services/mariadb/validate/maria_db_firewall_rule_id_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestMariaDBFirewallRuleID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Valid: false, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Valid: false, - }, - - { - // missing FirewallRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Valid: false, - }, - - { - // missing value for FirewallRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/firewallRules/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/firewallRules/firewallRule1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/FIREWALLRULES/FIREWALLRULE1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := MariaDBFirewallRuleID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/mariadb/validate/maria_db_virtual_network_rule_id.go b/internal/services/mariadb/validate/maria_db_virtual_network_rule_id.go deleted file mode 100644 index 8da930b85a65c..0000000000000 --- a/internal/services/mariadb/validate/maria_db_virtual_network_rule_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" -) - -func MariaDBVirtualNetworkRuleID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.MariaDBVirtualNetworkRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/mariadb/validate/maria_db_virtual_network_rule_id_test.go b/internal/services/mariadb/validate/maria_db_virtual_network_rule_id_test.go deleted file mode 100644 index 99e3013e5da42..0000000000000 --- a/internal/services/mariadb/validate/maria_db_virtual_network_rule_id_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestMariaDBVirtualNetworkRuleID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Valid: false, - }, - - { - // missing value for ServerName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Valid: false, - }, - - { - // missing VirtualNetworkRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/", - Valid: false, - }, - - { - // missing value for VirtualNetworkRuleName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/virtualNetworkRules/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1/virtualNetworkRules/vnetrule1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1/VIRTUALNETWORKRULES/VNETRULE1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := MariaDBVirtualNetworkRuleID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/mariadb/validate/server_id.go b/internal/services/mariadb/validate/server_id.go deleted file mode 100644 index e3c030471093b..0000000000000 --- a/internal/services/mariadb/validate/server_id.go +++ /dev/null @@ -1,23 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import ( - "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" -) - -func ServerID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := parse.ServerID(v); err != nil { - errors = append(errors, err) - } - - return -} diff --git a/internal/services/mariadb/validate/server_id_test.go b/internal/services/mariadb/validate/server_id_test.go deleted file mode 100644 index 2f1d7e91db3e3..0000000000000 --- a/internal/services/mariadb/validate/server_id_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package validate - -// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten - -import "testing" - -func TestServerID(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - - { - // empty - Input: "", - Valid: false, - }, - - { - // missing SubscriptionId - Input: "/", - Valid: false, - }, - - { - // missing value for SubscriptionId - Input: "/subscriptions/", - Valid: false, - }, - - { - // missing ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", - Valid: false, - }, - - { - // missing value for ResourceGroup - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", - Valid: false, - }, - - { - // missing Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/", - Valid: false, - }, - - { - // missing value for Name - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/", - Valid: false, - }, - - { - // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DBforMariaDB/servers/server1", - Valid: true, - }, - - { - // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.DBFORMARIADB/SERVERS/SERVER1", - Valid: false, - }, - } - for _, tc := range cases { - t.Logf("[DEBUG] Testing Value %s", tc.Input) - _, errors := ServerID(tc.Input, "test") - valid := len(errors) == 0 - - if tc.Valid != valid { - t.Fatalf("Expected %t but got %t", tc.Valid, valid) - } - } -} diff --git a/internal/services/msi/client/client.go b/internal/services/msi/client/client.go index 587e7303a2167..83207868b8b59 100644 --- a/internal/services/msi/client/client.go +++ b/internal/services/msi/client/client.go @@ -1,16 +1,16 @@ package client import ( - "github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity" + "github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - UserAssignedIdentitiesClient *managedidentity.ManagedIdentityClient + UserAssignedIdentitiesClient *managedidentities.ManagedIdentitiesClient } func NewClient(o *common.ClientOptions) *Client { - userAssignedIdentitiesClient := managedidentity.NewManagedIdentityClientWithBaseURI(o.ResourceManagerEndpoint) + userAssignedIdentitiesClient := managedidentities.NewManagedIdentitiesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&userAssignedIdentitiesClient.Client, o.ResourceManagerAuthorizer) return &Client{ diff --git a/internal/services/msi/user_assigned_identity_resource.go b/internal/services/msi/user_assigned_identity_resource.go index 33dd68ee36c07..1b05a86330a2e 100644 --- a/internal/services/msi/user_assigned_identity_resource.go +++ b/internal/services/msi/user_assigned_identity_resource.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity" + "github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/msi/migration" @@ -99,7 +99,7 @@ func resourceArmUserAssignedIdentityCreateUpdate(d *pluginsdk.ResourceData, meta } } - identity := managedidentity.Identity{ + identity := managedidentities.Identity{ Name: utils.String(resourceId.ResourceName), Location: location.Normalize(d.Get("location").(string)), Tags: tags.Expand(t), diff --git a/internal/services/mssql/mssql_managed_instance_resource.go b/internal/services/mssql/mssql_managed_instance_resource.go index 5f8f1d96c0d25..8f2081e0d0234 100644 --- a/internal/services/mssql/mssql_managed_instance_resource.go +++ b/internal/services/mssql/mssql_managed_instance_resource.go @@ -120,7 +120,7 @@ func (r MsSqlManagedInstanceResource) Arguments() map[string]*pluginsdk.Schema { "storage_size_in_gb": { Type: schema.TypeInt, Required: true, - ValidateFunc: validation.IntBetween(32, 8192), + ValidateFunc: validation.IntBetween(32, 16384), }, "subnet_id": { diff --git a/internal/services/mssql/mssql_server_resource.go b/internal/services/mssql/mssql_server_resource.go index 088b50a53e9e4..de679242eae23 100644 --- a/internal/services/mssql/mssql_server_resource.go +++ b/internal/services/mssql/mssql_server_resource.go @@ -149,6 +149,7 @@ func resourceMsSqlServer() *pluginsdk.Resource { "1.0", "1.1", "1.2", + "Disabled", }, false), }, @@ -256,7 +257,7 @@ func resourceMsSqlServerCreate(d *pluginsdk.ResourceData, meta interface{}) erro props.ServerProperties.RestrictOutboundNetworkAccess = sql.ServerNetworkAccessFlagEnabled } - if v := d.Get("minimum_tls_version"); v.(string) != "" { + if v := d.Get("minimum_tls_version"); v.(string) != "Disabled" { props.ServerProperties.MinimalTLSVersion = utils.String(v.(string)) } @@ -346,7 +347,7 @@ func resourceMsSqlServerUpdate(d *pluginsdk.ResourceData, meta interface{}) erro props.ServerProperties.AdministratorLoginPassword = utils.String(adminPassword) } - if v := d.Get("minimum_tls_version"); v.(string) != "" { + if v := d.Get("minimum_tls_version"); v.(string) != "Disabled" { props.ServerProperties.MinimalTLSVersion = utils.String(v.(string)) } @@ -466,7 +467,11 @@ func resourceMsSqlServerRead(d *pluginsdk.ResourceData, meta interface{}) error d.Set("version", props.Version) d.Set("administrator_login", props.AdministratorLogin) d.Set("fully_qualified_domain_name", props.FullyQualifiedDomainName) - d.Set("minimum_tls_version", props.MinimalTLSVersion) + if v := props.MinimalTLSVersion; v == nil { + d.Set("minimum_tls_version", "Disabled") + } else { + d.Set("minimum_tls_version", props.MinimalTLSVersion) + } d.Set("public_network_access_enabled", props.PublicNetworkAccess == sql.ServerNetworkAccessFlagEnabled) d.Set("outbound_network_restriction_enabled", props.RestrictOutboundNetworkAccess == sql.ServerNetworkAccessFlagEnabled) primaryUserAssignedIdentityID := "" @@ -681,7 +686,7 @@ func flattenSqlServerRestorableDatabases(resp sql.RestorableDroppedDatabaseListR func msSqlMinimumTLSVersionDiff(ctx context.Context, d *pluginsdk.ResourceDiff, _ interface{}) (err error) { old, new := d.GetChange("minimum_tls_version") - if old != "" && new == "" { + if old != "" && old != "Disabled" && new == "Disabled" { err = fmt.Errorf("`minimum_tls_version` cannot be removed once set, please set a valid value for this property") } return diff --git a/internal/services/mssql/mssql_server_resource_test.go b/internal/services/mssql/mssql_server_resource_test.go index 6a4de734a52cd..e998e03b7f382 100644 --- a/internal/services/mssql/mssql_server_resource_test.go +++ b/internal/services/mssql/mssql_server_resource_test.go @@ -45,6 +45,21 @@ func TestAccMsSqlServer_complete(t *testing.T) { }) } +func TestAccMsSqlServer_minimumTLSVersionDisabled(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_mssql_server", "test") + r := MsSqlServerResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basicWithMinimumTLSVersionDisabled(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("administrator_login_password"), + }) +} + func TestAccMsSqlServer_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_mssql_server", "test") r := MsSqlServerResource{} @@ -255,6 +270,33 @@ resource "azurerm_mssql_server" "test" { `, data.RandomInteger, data.Locations.Primary) } +func (MsSqlServerResource) basicWithMinimumTLSVersionDisabled(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-mssql-%[1]d" + location = "%[2]s" +} + +resource "azurerm_mssql_server" "test" { + name = "acctestsqlserver%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + version = "12.0" + administrator_login = "missadministrator" + administrator_login_password = "thisIsKat11" + minimum_tls_version = "Disabled" + + identity { + type = "SystemAssigned" + } +} +`, data.RandomInteger, data.Locations.Primary) +} + func (MsSqlServerResource) basicWithMinimumTLSVersion(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/network/application_gateway_resource.go b/internal/services/network/application_gateway_resource.go index e92e3dbf08afe..e1fe39cb8e871 100644 --- a/internal/services/network/application_gateway_resource.go +++ b/internal/services/network/application_gateway_resource.go @@ -967,7 +967,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { Schema: map[string]*pluginsdk.Schema{ "body": { Type: pluginsdk.TypeString, - Required: true, + Optional: true, }, "status_code": { diff --git a/internal/services/network/private_endpoint_resource.go b/internal/services/network/private_endpoint_resource.go index 6bb98833fd41b..89aa0215f18ba 100644 --- a/internal/services/network/private_endpoint_resource.go +++ b/internal/services/network/private_endpoint_resource.go @@ -11,6 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + mariaDB "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers" "github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2017-12-01/servers" "github.com/hashicorp/go-azure-sdk/resource-manager/privatedns/2018-09-01/privatezones" "github.com/hashicorp/go-azure-sdk/resource-manager/signalr/2022-02-01/signalr" @@ -19,7 +20,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" cosmosParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/parse" - mariaDBParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/mariadb/parse" mysqlParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/mysql/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" @@ -673,7 +673,7 @@ func flattenPrivateLinkEndpointServiceConnection(serviceConnections *[]network.P } } if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.dbformariadb") { - if serverId, err := mariaDBParse.ServerID(privateConnectionId); err == nil { + if serverId, err := mariaDB.ParseServerID(privateConnectionId); err == nil { privateConnectionId = serverId.ID() } } @@ -735,7 +735,7 @@ func flattenPrivateLinkEndpointServiceConnection(serviceConnections *[]network.P } } if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.dbformariadb") { - if serverId, err := mariaDBParse.ServerID(privateConnectionId); err == nil { + if serverId, err := mariaDB.ParseServerID(privateConnectionId); err == nil { privateConnectionId = serverId.ID() } } diff --git a/internal/services/policy/assignment_management_group_resource.go b/internal/services/policy/assignment_management_group_resource.go index 34ca520973d6c..6480b40972c58 100644 --- a/internal/services/policy/assignment_management_group_resource.go +++ b/internal/services/policy/assignment_management_group_resource.go @@ -28,8 +28,8 @@ func (r ManagementGroupAssignmentResource) Arguments() map[string]*pluginsdk.Sch ForceNew: true, ValidateFunc: validation.All( validation.StringIsNotWhiteSpace, - // The policy assignment name length must not exceed '128' characters. - validation.StringLenBetween(1, 128), + // The policy assignment name length must not exceed '24' characters. + validation.StringLenBetween(3, 24), validation.StringDoesNotContainAny("/"), ), }, diff --git a/internal/services/policy/client/client.go b/internal/services/policy/client/client.go index e4656fcb0212e..2d57570ae7f34 100644 --- a/internal/services/policy/client/client.go +++ b/internal/services/policy/client/client.go @@ -4,7 +4,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration" "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" policyPreview "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -13,7 +13,7 @@ type Client struct { DefinitionsClient *policy.DefinitionsClient ExemptionsClient *policyPreview.ExemptionsClient SetDefinitionsClient *policy.SetDefinitionsClient - PolicyInsightsClient *policyinsights.PolicyInsightsClient + RemediationsClient *remediations.RemediationsClient GuestConfigurationAssignmentsClient *guestconfiguration.AssignmentsClient } @@ -30,8 +30,8 @@ func NewClient(o *common.ClientOptions) *Client { setDefinitionsClient := policy.NewSetDefinitionsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&setDefinitionsClient.Client, o.ResourceManagerAuthorizer) - policyInsightsClient := policyinsights.NewPolicyInsightsClientWithBaseURI(o.ResourceManagerEndpoint) - o.ConfigureClient(&policyInsightsClient.Client, o.ResourceManagerAuthorizer) + remediationsClient := remediations.NewRemediationsClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&remediationsClient.Client, o.ResourceManagerAuthorizer) guestConfigurationAssignmentsClient := guestconfiguration.NewAssignmentsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&guestConfigurationAssignmentsClient.Client, o.ResourceManagerAuthorizer) @@ -41,7 +41,7 @@ func NewClient(o *common.ClientOptions) *Client { DefinitionsClient: &definitionsClient, ExemptionsClient: &exemptionsClient, SetDefinitionsClient: &setDefinitionsClient, - PolicyInsightsClient: &policyInsightsClient, + RemediationsClient: &remediationsClient, GuestConfigurationAssignmentsClient: &guestConfigurationAssignmentsClient, } } diff --git a/internal/services/policy/remediation_management_group.go b/internal/services/policy/remediation_management_group.go index 7221236fbcdc6..6347a45fbb631 100644 --- a/internal/services/policy/remediation_management_group.go +++ b/internal/services/policy/remediation_management_group.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" managmentGroupParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/managementgroup/parse" @@ -84,10 +84,10 @@ func resourceArmManagementGroupPolicyRemediation() *pluginsdk.Resource { "resource_discovery_mode": { Type: pluginsdk.TypeString, Optional: true, - Default: string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), + Default: string(remediations.ResourceDiscoveryModeExistingNonCompliant), ValidateFunc: validation.StringInSlice([]string{ - string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), - string(policyinsights.ResourceDiscoveryModeReEvaluateCompliance), + string(remediations.ResourceDiscoveryModeExistingNonCompliant), + string(remediations.ResourceDiscoveryModeReEvaluateCompliance), }, false), }, }, @@ -95,7 +95,7 @@ func resourceArmManagementGroupPolicyRemediation() *pluginsdk.Resource { } func resourceArmManagementGroupPolicyRemediationCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -103,7 +103,7 @@ func resourceArmManagementGroupPolicyRemediationCreateUpdate(d *pluginsdk.Resour if err != nil { return err } - id := policyinsights.NewProviders2RemediationID(managementID.Name, d.Get("name").(string)) + id := remediations.NewProviders2RemediationID(managementID.Name, d.Get("name").(string)) if d.IsNewResource() { existing, err := client.RemediationsGetAtManagementGroup(ctx, id) @@ -117,16 +117,16 @@ func resourceArmManagementGroupPolicyRemediationCreateUpdate(d *pluginsdk.Resour } } - parameters := policyinsights.Remediation{ - Properties: &policyinsights.RemediationProperties{ - Filters: &policyinsights.RemediationFilters{ + parameters := remediations.Remediation{ + Properties: &remediations.RemediationProperties{ + Filters: &remediations.RemediationFilters{ Locations: utils.ExpandStringSlice(d.Get("location_filters").([]interface{})), }, PolicyAssignmentId: utils.String(d.Get("policy_assignment_id").(string)), PolicyDefinitionReferenceId: utils.String(d.Get("policy_definition_id").(string)), }, } - mode := policyinsights.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) + mode := remediations.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) parameters.Properties.ResourceDiscoveryMode = &mode if _, err := client.RemediationsCreateOrUpdateAtManagementGroup(ctx, id, parameters); err != nil { @@ -139,11 +139,11 @@ func resourceArmManagementGroupPolicyRemediationCreateUpdate(d *pluginsdk.Resour } func resourceArmManagementGroupPolicyRemediationRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseProviders2RemediationID(d.Id()) + id, err := remediations.ParseProviders2RemediationID(d.Id()) if err != nil { return fmt.Errorf("reading Policy Remediation: %+v", err) } @@ -180,11 +180,11 @@ func resourceArmManagementGroupPolicyRemediationRead(d *pluginsdk.ResourceData, } func resourceArmManagementGroupPolicyRemediationDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseProviders2RemediationID(d.Id()) + id, err := remediations.ParseProviders2RemediationID(d.Id()) if err != nil { return err } @@ -215,7 +215,7 @@ func resourceArmManagementGroupPolicyRemediationDelete(d *pluginsdk.ResourceData } func managementGroupPolicyRemediationCancellationRefreshFunc(ctx context.Context, - client *policyinsights.PolicyInsightsClient, id policyinsights.Providers2RemediationId) pluginsdk.StateRefreshFunc { + client *remediations.RemediationsClient, id remediations.Providers2RemediationId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { resp, err := client.RemediationsGetAtManagementGroup(ctx, id) diff --git a/internal/services/policy/remediation_management_group_test.go b/internal/services/policy/remediation_management_group_test.go index 99a4478648381..3b43037716386 100644 --- a/internal/services/policy/remediation_management_group_test.go +++ b/internal/services/policy/remediation_management_group_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -47,12 +47,12 @@ func TestAccAzureRMManagementGroupPolicyRemediation_complete(t *testing.T) { } func (r ManagementGroupPolicyRemediationResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := policyinsights.ParseProviders2RemediationID(state.ID) + id, err := remediations.ParseProviders2RemediationID(state.ID) if err != nil { return nil, err } - resp, err := client.Policy.PolicyInsightsClient.RemediationsGetAtManagementGroup(ctx, *id) + resp, err := client.Policy.RemediationsClient.RemediationsGetAtManagementGroup(ctx, *id) if err != nil || resp.Model == nil { if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil diff --git a/internal/services/policy/remediation_resource.go b/internal/services/policy/remediation_resource.go index efe4bb667e297..3744e6a9ce22c 100644 --- a/internal/services/policy/remediation_resource.go +++ b/internal/services/policy/remediation_resource.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -83,10 +83,10 @@ func resourceArmResourcePolicyRemediation() *pluginsdk.Resource { "resource_discovery_mode": { Type: pluginsdk.TypeString, Optional: true, - Default: string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), + Default: string(remediations.ResourceDiscoveryModeExistingNonCompliant), ValidateFunc: validation.StringInSlice([]string{ - string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), - string(policyinsights.ResourceDiscoveryModeReEvaluateCompliance), + string(remediations.ResourceDiscoveryModeExistingNonCompliant), + string(remediations.ResourceDiscoveryModeReEvaluateCompliance), }, false), }, }, @@ -94,13 +94,13 @@ func resourceArmResourcePolicyRemediation() *pluginsdk.Resource { } func resourceArmResourcePolicyRemediationCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() resourceId := d.Get("resource_id").(string) - id := policyinsights.NewScopedRemediationID(resourceId, d.Get("name").(string)) + id := remediations.NewScopedRemediationID(resourceId, d.Get("name").(string)) if d.IsNewResource() { existing, err := client.RemediationsGetAtResource(ctx, id) @@ -114,16 +114,16 @@ func resourceArmResourcePolicyRemediationCreateUpdate(d *pluginsdk.ResourceData, } } - parameters := policyinsights.Remediation{ - Properties: &policyinsights.RemediationProperties{ - Filters: &policyinsights.RemediationFilters{ + parameters := remediations.Remediation{ + Properties: &remediations.RemediationProperties{ + Filters: &remediations.RemediationFilters{ Locations: utils.ExpandStringSlice(d.Get("location_filters").([]interface{})), }, PolicyAssignmentId: utils.String(d.Get("policy_assignment_id").(string)), PolicyDefinitionReferenceId: utils.String(d.Get("policy_definition_id").(string)), }, } - mode := policyinsights.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) + mode := remediations.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) parameters.Properties.ResourceDiscoveryMode = &mode if _, err := client.RemediationsCreateOrUpdateAtResource(ctx, id, parameters); err != nil { @@ -136,11 +136,11 @@ func resourceArmResourcePolicyRemediationCreateUpdate(d *pluginsdk.ResourceData, } func resourceArmResourcePolicyRemediationRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseScopedRemediationID(d.Id()) + id, err := remediations.ParseScopedRemediationID(d.Id()) if err != nil { return fmt.Errorf("parsing Policy Scoped Remediation ID: %+v", err) } @@ -176,11 +176,11 @@ func resourceArmResourcePolicyRemediationRead(d *pluginsdk.ResourceData, meta in } func resourceArmResourcePolicyRemediationDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseScopedRemediationID(d.Id()) + id, err := remediations.ParseScopedRemediationID(d.Id()) if err != nil { return fmt.Errorf("parsing Policy Scoped Remediation ID: %+v", err) } @@ -213,7 +213,7 @@ func resourceArmResourcePolicyRemediationDelete(d *pluginsdk.ResourceData, meta return err } -func resourcePolicyRemediationCancellationRefreshFunc(ctx context.Context, client *policyinsights.PolicyInsightsClient, id policyinsights.ScopedRemediationId) pluginsdk.StateRefreshFunc { +func resourcePolicyRemediationCancellationRefreshFunc(ctx context.Context, client *remediations.RemediationsClient, id remediations.ScopedRemediationId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { resp, err := client.RemediationsGetAtResource(ctx, id) if err != nil { @@ -232,7 +232,7 @@ func resourcePolicyRemediationCancellationRefreshFunc(ctx context.Context, clien // waitRemediationToDelete waits for the remediation to a status that allow to delete func waitRemediationToDelete(ctx context.Context, - prop *policyinsights.RemediationProperties, + prop *remediations.RemediationProperties, id string, timeout time.Duration, cancelFunc func() error, @@ -241,7 +241,7 @@ func waitRemediationToDelete(ctx context.Context, if prop == nil { return nil } - if mode := prop.ResourceDiscoveryMode; mode != nil && *mode == policyinsights.ResourceDiscoveryModeReEvaluateCompliance { + if mode := prop.ResourceDiscoveryMode; mode != nil && *mode == remediations.ResourceDiscoveryModeReEvaluateCompliance { // Remediation can only be canceld when it is in "Evaluating" or "Accepted" status, otherwise, API might raise error (e.g. canceling a "Completed" remediation returns 400). if state := prop.ProvisioningState; state != nil && (*state == "Evaluating" || *state == "Accepted") { log.Printf("[DEBUG] cancelling the remediation first before deleting it when `resource_discovery_mode` is set to `ReEvaluateCompliance`") diff --git a/internal/services/policy/remediation_resource_group.go b/internal/services/policy/remediation_resource_group.go index 7999349226293..6d36c9ddf6fa3 100644 --- a/internal/services/policy/remediation_resource_group.go +++ b/internal/services/policy/remediation_resource_group.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" @@ -84,10 +84,10 @@ func resourceArmResourceGroupPolicyRemediation() *pluginsdk.Resource { "resource_discovery_mode": { Type: pluginsdk.TypeString, Optional: true, - Default: string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), + Default: string(remediations.ResourceDiscoveryModeExistingNonCompliant), ValidateFunc: validation.StringInSlice([]string{ - string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), - string(policyinsights.ResourceDiscoveryModeReEvaluateCompliance), + string(remediations.ResourceDiscoveryModeExistingNonCompliant), + string(remediations.ResourceDiscoveryModeReEvaluateCompliance), }, false), }, }, @@ -95,7 +95,7 @@ func resourceArmResourceGroupPolicyRemediation() *pluginsdk.Resource { } func resourceArmResourceGroupPolicyRemediationCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -104,7 +104,7 @@ func resourceArmResourceGroupPolicyRemediationCreateUpdate(d *pluginsdk.Resource return err } - id := policyinsights.NewProviderRemediationID(resourceGroupId.SubscriptionId, resourceGroupId.ResourceGroup, d.Get("name").(string)) + id := remediations.NewProviderRemediationID(resourceGroupId.SubscriptionId, resourceGroupId.ResourceGroup, d.Get("name").(string)) if d.IsNewResource() { existing, err := client.RemediationsGetAtResourceGroup(ctx, id) @@ -118,16 +118,16 @@ func resourceArmResourceGroupPolicyRemediationCreateUpdate(d *pluginsdk.Resource } } - parameters := policyinsights.Remediation{ - Properties: &policyinsights.RemediationProperties{ - Filters: &policyinsights.RemediationFilters{ + parameters := remediations.Remediation{ + Properties: &remediations.RemediationProperties{ + Filters: &remediations.RemediationFilters{ Locations: utils.ExpandStringSlice(d.Get("location_filters").([]interface{})), }, PolicyAssignmentId: utils.String(d.Get("policy_assignment_id").(string)), PolicyDefinitionReferenceId: utils.String(d.Get("policy_definition_id").(string)), }, } - mode := policyinsights.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) + mode := remediations.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) parameters.Properties.ResourceDiscoveryMode = &mode if _, err = client.RemediationsCreateOrUpdateAtResourceGroup(ctx, id, parameters); err != nil { @@ -140,11 +140,11 @@ func resourceArmResourceGroupPolicyRemediationCreateUpdate(d *pluginsdk.Resource } func resourceArmResourceGroupPolicyRemediationRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseProviderRemediationID(d.Id()) + id, err := remediations.ParseProviderRemediationID(d.Id()) if err != nil { return fmt.Errorf("reading Policy Remediation: %+v", err) } @@ -183,11 +183,11 @@ func resourceArmResourceGroupPolicyRemediationRead(d *pluginsdk.ResourceData, me } func resourceArmResourceGroupPolicyRemediationDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseProviderRemediationID(d.Id()) + id, err := remediations.ParseProviderRemediationID(d.Id()) if err != nil { return err } @@ -217,7 +217,7 @@ func resourceArmResourceGroupPolicyRemediationDelete(d *pluginsdk.ResourceData, return err } -func resourceGroupPolicyRemediationCancellationRefreshFunc(ctx context.Context, client *policyinsights.PolicyInsightsClient, id policyinsights.ProviderRemediationId) pluginsdk.StateRefreshFunc { +func resourceGroupPolicyRemediationCancellationRefreshFunc(ctx context.Context, client *remediations.RemediationsClient, id remediations.ProviderRemediationId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { resp, err := client.RemediationsGetAtResourceGroup(ctx, id) if err != nil { diff --git a/internal/services/policy/remediation_resource_group_test.go b/internal/services/policy/remediation_resource_group_test.go index 55c655a46424d..a60e7ad3c95e7 100644 --- a/internal/services/policy/remediation_resource_group_test.go +++ b/internal/services/policy/remediation_resource_group_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -47,12 +47,12 @@ func TestAccAzureRMResourceGroupPolicyRemediation_complete(t *testing.T) { } func (r ResourceGroupPolicyRemediationResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := policyinsights.ParseProviderRemediationID(state.ID) + id, err := remediations.ParseProviderRemediationID(state.ID) if err != nil { return nil, err } - resp, err := client.Policy.PolicyInsightsClient.RemediationsGetAtResourceGroup(ctx, *id) + resp, err := client.Policy.RemediationsClient.RemediationsGetAtResourceGroup(ctx, *id) if err != nil || resp.Model == nil { if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil diff --git a/internal/services/policy/remediation_resource_test.go b/internal/services/policy/remediation_resource_test.go index 14c1498a3d4ef..157e271a05c7e 100644 --- a/internal/services/policy/remediation_resource_test.go +++ b/internal/services/policy/remediation_resource_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + policyinsights "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -52,7 +52,7 @@ func (r ResourcePolicyRemediationResource) Exists(ctx context.Context, client *c return nil, err } - resp, err := client.Policy.PolicyInsightsClient.RemediationsGetAtResource(ctx, *id) + resp, err := client.Policy.RemediationsClient.RemediationsGetAtResource(ctx, *id) if err != nil || resp.Model == nil { if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil diff --git a/internal/services/policy/remediation_subscription.go b/internal/services/policy/remediation_subscription.go index 9ac266d7f89ab..625d1fa6d3965 100644 --- a/internal/services/policy/remediation_subscription.go +++ b/internal/services/policy/remediation_subscription.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/parse" @@ -83,10 +83,10 @@ func resourceArmSubscriptionPolicyRemediation() *pluginsdk.Resource { "resource_discovery_mode": { Type: pluginsdk.TypeString, Optional: true, - Default: string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), + Default: string(remediations.ResourceDiscoveryModeExistingNonCompliant), ValidateFunc: validation.StringInSlice([]string{ - string(policyinsights.ResourceDiscoveryModeExistingNonCompliant), - string(policyinsights.ResourceDiscoveryModeReEvaluateCompliance), + string(remediations.ResourceDiscoveryModeExistingNonCompliant), + string(remediations.ResourceDiscoveryModeReEvaluateCompliance), }, false), }, }, @@ -94,7 +94,7 @@ func resourceArmSubscriptionPolicyRemediation() *pluginsdk.Resource { } func resourceArmSubscriptionPolicyRemediationCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -103,7 +103,7 @@ func resourceArmSubscriptionPolicyRemediationCreateUpdate(d *pluginsdk.ResourceD return err } - id := policyinsights.NewRemediationID(subscriptionId.SubscriptionId, d.Get("name").(string)) + id := remediations.NewRemediationID(subscriptionId.SubscriptionId, d.Get("name").(string)) if d.IsNewResource() { existing, err := client.RemediationsGetAtSubscription(ctx, id) @@ -117,16 +117,16 @@ func resourceArmSubscriptionPolicyRemediationCreateUpdate(d *pluginsdk.ResourceD } } - parameters := policyinsights.Remediation{ - Properties: &policyinsights.RemediationProperties{ - Filters: &policyinsights.RemediationFilters{ + parameters := remediations.Remediation{ + Properties: &remediations.RemediationProperties{ + Filters: &remediations.RemediationFilters{ Locations: utils.ExpandStringSlice(d.Get("location_filters").([]interface{})), }, PolicyAssignmentId: utils.String(d.Get("policy_assignment_id").(string)), PolicyDefinitionReferenceId: utils.String(d.Get("policy_definition_id").(string)), }, } - mode := policyinsights.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) + mode := remediations.ResourceDiscoveryMode(d.Get("resource_discovery_mode").(string)) parameters.Properties.ResourceDiscoveryMode = &mode if _, err = client.RemediationsCreateOrUpdateAtSubscription(ctx, id, parameters); err != nil { @@ -139,11 +139,11 @@ func resourceArmSubscriptionPolicyRemediationCreateUpdate(d *pluginsdk.ResourceD } func resourceArmSubscriptionPolicyRemediationRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseRemediationID(d.Id()) + id, err := remediations.ParseRemediationID(d.Id()) if err != nil { return fmt.Errorf("reading Policy Remediation: %+v", err) } @@ -181,11 +181,11 @@ func resourceArmSubscriptionPolicyRemediationRead(d *pluginsdk.ResourceData, met } func resourceArmSubscriptionPolicyRemediationDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Policy.PolicyInsightsClient + client := meta.(*clients.Client).Policy.RemediationsClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := policyinsights.ParseRemediationID(d.Id()) + id, err := remediations.ParseRemediationID(d.Id()) if err != nil { return err } @@ -215,7 +215,7 @@ func resourceArmSubscriptionPolicyRemediationDelete(d *pluginsdk.ResourceData, m return err } -func subscriptionPolicyRemediationCancellationRefreshFunc(ctx context.Context, client *policyinsights.PolicyInsightsClient, id policyinsights.RemediationId) pluginsdk.StateRefreshFunc { +func subscriptionPolicyRemediationCancellationRefreshFunc(ctx context.Context, client *remediations.RemediationsClient, id remediations.RemediationId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { resp, err := client.RemediationsGetAtSubscription(ctx, id) if err != nil { diff --git a/internal/services/policy/remediation_subscription_test.go b/internal/services/policy/remediation_subscription_test.go index 0337874b58933..ee1a651a96077 100644 --- a/internal/services/policy/remediation_subscription_test.go +++ b/internal/services/policy/remediation_subscription_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" + "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -47,12 +47,12 @@ func TestAccAzureRMSubscriptionPolicyRemediation_complete(t *testing.T) { } func (r SubscriptionPolicyRemediationResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := policyinsights.ParseRemediationID(state.ID) + id, err := remediations.ParseRemediationID(state.ID) if err != nil { return nil, err } - resp, err := client.Policy.PolicyInsightsClient.RemediationsGetAtSubscription(ctx, *id) + resp, err := client.Policy.RemediationsClient.RemediationsGetAtSubscription(ctx, *id) if err != nil || resp.Model == nil { if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil diff --git a/internal/services/postgres/migration/postgresql_database.go b/internal/services/postgres/migration/postgresql_database.go new file mode 100644 index 0000000000000..22a69c38a4483 --- /dev/null +++ b/internal/services/postgres/migration/postgresql_database.go @@ -0,0 +1,74 @@ +package migration + +import ( + "context" + "log" + "strings" + + "github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2017-12-01/databases" + "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/postgres/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" +) + +var _ pluginsdk.StateUpgrade = PostgresqlDatabaseV0ToV1{} + +type PostgresqlDatabaseV0ToV1 struct{} + +func (PostgresqlDatabaseV0ToV1) Schema() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + }, + + "resource_group_name": azure.SchemaResourceGroupName(), + + "server_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.ServerName, + }, + + "charset": { + Type: pluginsdk.TypeString, + Required: true, + DiffSuppressFunc: suppress.CaseDifference, + ForceNew: true, + }, + + "collation": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.DatabaseCollation, + }, + } +} + +func (PostgresqlDatabaseV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { + return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + // old + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL/servers/{serverName}/databases/{databaseName} + // new: + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName} + // summary: + // Check for `For` and swap to `for` + oldId := rawState["id"].(string) + if strings.Contains(oldId, "Microsoft.DBForPostgreSQL") { + modifiedId := strings.ReplaceAll(oldId, "Microsoft.DBForPostgreSQL", "Microsoft.DBforPostgreSQL") + + newId, err := databases.ParseDatabaseID(modifiedId) + if err != nil { + return rawState, err + } + log.Printf("[DEBUG] Updating ID from %q to %q", oldId, newId) + rawState["id"] = newId.ID() + } + + return rawState, nil + } +} diff --git a/internal/services/postgres/postgresql_database_resource.go b/internal/services/postgres/postgresql_database_resource.go index 6fb76d3a8fe2c..ac051f4eaf7e5 100644 --- a/internal/services/postgres/postgresql_database_resource.go +++ b/internal/services/postgres/postgresql_database_resource.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/postgres/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/postgres/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" @@ -34,6 +35,11 @@ func resourcePostgreSQLDatabase() *pluginsdk.Resource { Delete: pluginsdk.DefaultTimeout(60 * time.Minute), }, + SchemaVersion: 1, + StateUpgraders: pluginsdk.StateUpgrades(map[int]pluginsdk.StateUpgrade{ + 0: migration.PostgresqlDatabaseV0ToV1{}, + }), + Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, diff --git a/internal/services/servicebus/migration/namespace_auth_rule.go b/internal/services/servicebus/migration/namespace_auth_rule.go new file mode 100644 index 0000000000000..2395be459743e --- /dev/null +++ b/internal/services/servicebus/migration/namespace_auth_rule.go @@ -0,0 +1,98 @@ +package migration + +import ( + "context" + + "github.com/hashicorp/go-azure-sdk/resource-manager/servicebus/2021-06-01-preview/namespacesauthorizationrule" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +var _ pluginsdk.StateUpgrade = ServicebusNamespaceAuthRuleV0ToV1{} + +type ServicebusNamespaceAuthRuleV0ToV1 struct{} + +func (ServicebusNamespaceAuthRuleV0ToV1) Schema() map[string]*pluginsdk.Schema { + s := map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + }, + //lintignore: S013 + "namespace_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + }, + + "listen": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + + "send": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + + "manage": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + + "primary_key": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "primary_connection_string": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "secondary_key": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "secondary_connection_string": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "primary_connection_string_alias": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "secondary_connection_string_alias": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + } + return s +} + +func (ServicebusNamespaceAuthRuleV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc { + return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + + oldID := rawState["id"].(string) + + id, err := namespacesauthorizationrule.ParseAuthorizationRuleIDInsensitively(oldID) + if err != nil { + return nil, err + } + rawState["id"] = id.ID() + + return rawState, nil + } +} diff --git a/internal/services/servicebus/servicebus_namespace_authorization_rule_resource.go b/internal/services/servicebus/servicebus_namespace_authorization_rule_resource.go index 3696264ad25dc..2fac3c86f2583 100644 --- a/internal/services/servicebus/servicebus_namespace_authorization_rule_resource.go +++ b/internal/services/servicebus/servicebus_namespace_authorization_rule_resource.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/servicebus/2021-06-01-preview/namespacesauthorizationrule" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/servicebus/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/servicebus/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -34,6 +35,11 @@ func resourceServiceBusNamespaceAuthorizationRule() *pluginsdk.Resource { Delete: pluginsdk.DefaultTimeout(30 * time.Minute), }, + SchemaVersion: 1, + StateUpgraders: pluginsdk.StateUpgrades(map[int]pluginsdk.StateUpgrade{ + 0: migration.ServicebusNamespaceAuthRuleV0ToV1{}, + }), + // function takes a schema map and adds the authorization rule properties to it Schema: resourceServiceBusNamespaceAuthorizationRuleSchema(), diff --git a/internal/services/springcloud/spring_cloud_service_data_source.go b/internal/services/springcloud/spring_cloud_service_data_source.go index 0029b60f55aed..dadceaa3a801d 100644 --- a/internal/services/springcloud/spring_cloud_service_data_source.go +++ b/internal/services/springcloud/spring_cloud_service_data_source.go @@ -172,19 +172,20 @@ func dataSourceSpringCloudServiceRead(d *pluginsdk.ResourceData, meta interface{ return fmt.Errorf("retrieving %s: %+v", id, err) } - configServer, err := configServersClient.Get(ctx, id.ResourceGroup, id.SpringName) - if err != nil { - return fmt.Errorf("retrieving config server configuration for %s: %+v", id, err) - } - d.SetId(id.ID()) d.Set("name", id.SpringName) d.Set("resource_group_name", id.ResourceGroup) d.Set("location", location.NormalizeNilable(resp.Location)) - if err := d.Set("config_server_git_setting", flattenSpringCloudConfigServerGitProperty(configServer.Properties, d)); err != nil { - return fmt.Errorf("setting `config_server_git_setting`: %+v", err) + if resp.Sku != nil && resp.Sku.Name != nil && *resp.Sku.Name != "E0" { + configServer, err := configServersClient.Get(ctx, id.ResourceGroup, id.SpringName) + if err != nil { + return fmt.Errorf("retrieving config server configuration for %s: %+v", id, err) + } + if err := d.Set("config_server_git_setting", flattenSpringCloudConfigServerGitProperty(configServer.Properties, d)); err != nil { + return fmt.Errorf("setting `config_server_git_setting`: %+v", err) + } } if props := resp.Properties; props != nil { diff --git a/internal/services/springcloud/spring_cloud_service_resource.go b/internal/services/springcloud/spring_cloud_service_resource.go index b4dab71971845..4939aae68a1a5 100644 --- a/internal/services/springcloud/spring_cloud_service_resource.go +++ b/internal/services/springcloud/spring_cloud_service_resource.go @@ -351,11 +351,18 @@ func resourceSpringCloudServiceCreate(d *pluginsdk.ResourceData, meta interface{ } d.SetId(id.ID()) - log.Printf("[DEBUG] Updating Config Server Settings for %s..", id) - if err := updateConfigServerSettings(ctx, configServersClient, id, gitProperty); err != nil { - return err + skuName := d.Get("sku_name").(string) + if skuName == "E0" && gitProperty != nil { + return fmt.Errorf("`config_server_git_setting` is not supported for sku `E0`") + } + + if skuName != "E0" { + log.Printf("[DEBUG] Updating Config Server Settings for %s..", id) + if err := updateConfigServerSettings(ctx, configServersClient, id, gitProperty); err != nil { + return err + } + log.Printf("[DEBUG] Updated Config Server Settings for %s.", id) } - log.Printf("[DEBUG] Updated Config Server Settings for %s.", id) log.Printf("[DEBUG] Updating Monitor Settings for %s..", id) monitorSettings := appplatform.MonitoringSettingResource{ @@ -439,12 +446,17 @@ func resourceSpringCloudServiceUpdate(d *pluginsdk.ResourceData, meta interface{ if err != nil { return err } - - log.Printf("[DEBUG] Updating Config Server Settings for %s..", *id) - if err := updateConfigServerSettings(ctx, configServersClient, *id, gitProperty); err != nil { - return err + skuName := d.Get("sku_name").(string) + if skuName == "E0" && gitProperty != nil { + return fmt.Errorf("`config_server_git_setting` is not supported for sku `E0`") + } + if skuName != "E0" { + log.Printf("[DEBUG] Updating Config Server Settings for %s..", *id) + if err := updateConfigServerSettings(ctx, configServersClient, *id, gitProperty); err != nil { + return err + } + log.Printf("[DEBUG] Updated Config Server Settings for %s.", *id) } - log.Printf("[DEBUG] Updated Config Server Settings for %s.", *id) } if d.HasChange("trace") { @@ -529,11 +541,6 @@ func resourceSpringCloudServiceRead(d *pluginsdk.ResourceData, meta interface{}) return fmt.Errorf("unable to read Spring Cloud Service %q (Resource Group %q): %+v", id.SpringName, id.ResourceGroup, err) } - configServer, err := configServersClient.Get(ctx, id.ResourceGroup, id.SpringName) - if err != nil { - return fmt.Errorf("retrieving config server settings for %s: %+v", id, err) - } - monitoringSettings, err := monitoringSettingsClient.Get(ctx, id.ResourceGroup, id.SpringName) if err != nil { return fmt.Errorf("retrieving monitoring settings for %s: %+v", id, err) @@ -574,8 +581,14 @@ func resourceSpringCloudServiceRead(d *pluginsdk.ResourceData, meta interface{}) d.Set("service_registry_id", "") } - if err := d.Set("config_server_git_setting", flattenSpringCloudConfigServerGitProperty(configServer.Properties, d)); err != nil { - return fmt.Errorf("setting `config_server_git_setting`: %+v", err) + if resp.Sku != nil && resp.Sku.Name != nil && *resp.Sku.Name != "E0" { + configServer, err := configServersClient.Get(ctx, id.ResourceGroup, id.SpringName) + if err != nil { + return fmt.Errorf("retrieving config server configuration for %s: %+v", id, err) + } + if err := d.Set("config_server_git_setting", flattenSpringCloudConfigServerGitProperty(configServer.Properties, d)); err != nil { + return fmt.Errorf("setting `config_server_git_setting`: %+v", err) + } } if err := d.Set("trace", flattenSpringCloudTrace(monitoringSettings.Properties)); err != nil { diff --git a/internal/services/storage/storage_account_resource.go b/internal/services/storage/storage_account_resource.go index 871d88e9060d6..d88f5c546d854 100644 --- a/internal/services/storage/storage_account_resource.go +++ b/internal/services/storage/storage_account_resource.go @@ -289,6 +289,12 @@ func resourceStorageAccount() *pluginsdk.Resource { Default: true, }, + "default_to_oauth_authentication": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + "network_rules": { Type: pluginsdk.TypeList, Optional: true, @@ -968,6 +974,7 @@ func resourceStorageAccountCreate(d *pluginsdk.ResourceData, meta interface{}) e nfsV3Enabled := d.Get("nfsv3_enabled").(bool) allowBlobPublicAccess := d.Get("allow_nested_items_to_be_public").(bool) allowSharedKeyAccess := d.Get("shared_access_key_enabled").(bool) + defaultToOAuthAuthentication := d.Get("default_to_oauth_authentication").(bool) crossTenantReplication := d.Get("cross_tenant_replication_enabled").(bool) accountTier := d.Get("account_tier").(string) @@ -983,12 +990,13 @@ func resourceStorageAccountCreate(d *pluginsdk.ResourceData, meta interface{}) e Tags: tags.Expand(t), Kind: storage.Kind(accountKind), AccountPropertiesCreateParameters: &storage.AccountPropertiesCreateParameters{ - EnableHTTPSTrafficOnly: &enableHTTPSTrafficOnly, - NetworkRuleSet: expandStorageAccountNetworkRules(d, tenantId), - IsHnsEnabled: &isHnsEnabled, - EnableNfsV3: &nfsV3Enabled, - AllowSharedKeyAccess: &allowSharedKeyAccess, - AllowCrossTenantReplication: &crossTenantReplication, + EnableHTTPSTrafficOnly: &enableHTTPSTrafficOnly, + NetworkRuleSet: expandStorageAccountNetworkRules(d, tenantId), + IsHnsEnabled: &isHnsEnabled, + EnableNfsV3: &nfsV3Enabled, + AllowSharedKeyAccess: &allowSharedKeyAccess, + DefaultToOAuthAuthentication: &defaultToOAuthAuthentication, + AllowCrossTenantReplication: &crossTenantReplication, }, } @@ -1317,6 +1325,11 @@ func resourceStorageAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) e }, } + if d.HasChange("default_to_oauth_authentication") { + defaultToOAuthAuthentication := d.Get("default_to_oauth_authentication").(bool) + opts.AccountPropertiesUpdateParameters.DefaultToOAuthAuthentication = &defaultToOAuthAuthentication + } + if d.HasChange("cross_tenant_replication_enabled") { crossTenantReplication := d.Get("cross_tenant_replication_enabled").(bool) opts.AccountPropertiesUpdateParameters.AllowCrossTenantReplication = &crossTenantReplication @@ -1818,6 +1831,12 @@ func resourceStorageAccountRead(d *pluginsdk.ResourceData, meta interface{}) err } d.Set("shared_access_key_enabled", allowSharedKeyAccess) + defaultToOAuthAuthentication := false + if props.DefaultToOAuthAuthentication != nil { + defaultToOAuthAuthentication = *props.DefaultToOAuthAuthentication + } + d.Set("default_to_oauth_authentication", defaultToOAuthAuthentication) + // Setting the encryption key type to "Service" in PUT. The following GET will not return the queue/table in the service list of its response. // So defaults to setting the encryption key type to "Service" if it is absent in the GET response. Also, define the default value as "Service" in the schema. var ( diff --git a/internal/services/storage/storage_account_resource_test.go b/internal/services/storage/storage_account_resource_test.go index ee61f6fcdcfd2..e52b9eacf8092 100644 --- a/internal/services/storage/storage_account_resource_test.go +++ b/internal/services/storage/storage_account_resource_test.go @@ -1034,6 +1034,36 @@ func TestAccStorageAccount_allowSharedKeyAccess(t *testing.T) { }) } +func TestAccStorageAccount_defaultToOAuthAuthentication(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_storage_account", "test") + r := StorageAccountResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.defaultToOAuthAuthentication(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("account_tier").HasValue("Standard"), + check.That(data.ResourceName).Key("account_replication_type").HasValue("LRS"), + check.That(data.ResourceName).Key("tags.%").HasValue("1"), + check.That(data.ResourceName).Key("tags.environment").HasValue("production"), + check.That(data.ResourceName).Key("default_to_oauth_authentication").HasValue("true"), + ), + }, + { + Config: r.defaultToOAuthAuthenticationUpdated(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("account_tier").HasValue("Standard"), + check.That(data.ResourceName).Key("account_replication_type").HasValue("LRS"), + check.That(data.ResourceName).Key("tags.%").HasValue("1"), + check.That(data.ResourceName).Key("tags.environment").HasValue("production"), + check.That(data.ResourceName).Key("default_to_oauth_authentication").HasValue("false"), + ), + }, + }) +} + func TestAccStorageAccount_encryptionKeyType(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_storage_account", "test") r := StorageAccountResource{} @@ -3259,6 +3289,62 @@ resource "azurerm_storage_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString) } +func (r StorageAccountResource) defaultToOAuthAuthentication(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} + storage_use_azuread = true +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-storage-%d" + location = "%s" +} + +resource "azurerm_storage_account" "test" { + name = "unlikely23exst2acct%s" + resource_group_name = azurerm_resource_group.test.name + + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" + default_to_oauth_authentication = true + + tags = { + environment = "production" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) +} + +func (r StorageAccountResource) defaultToOAuthAuthenticationUpdated(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} + storage_use_azuread = true +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-storage-%d" + location = "%s" +} + +resource "azurerm_storage_account" "test" { + name = "unlikely23exst2acct%s" + resource_group_name = azurerm_resource_group.test.name + + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" + default_to_oauth_authentication = false + + tags = { + environment = "production" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) +} + func (r StorageAccountResource) encryptionKeyType(data acceptance.TestData, t string) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/storage/storage_management_policy_resource.go b/internal/services/storage/storage_management_policy_resource.go index 14d80fab092e6..a2e6c640927dd 100644 --- a/internal/services/storage/storage_management_policy_resource.go +++ b/internal/services/storage/storage_management_policy_resource.go @@ -3,7 +3,6 @@ package storage import ( "fmt" "log" - "regexp" "time" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" @@ -49,12 +48,9 @@ func resourceStorageManagementPolicy() *pluginsdk.Resource { Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "name": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringMatch( - regexp.MustCompile(`^[a-zA-Z0-9-]*$`), - "A rule name can contain any combination of alpha numeric characters.", - ), + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, }, "enabled": { Type: pluginsdk.TypeBool, diff --git a/internal/services/storage/storage_table_entity_resource.go b/internal/services/storage/storage_table_entity_resource.go index 4d250c360e707..679201b3c6c39 100644 --- a/internal/services/storage/storage_table_entity_resource.go +++ b/internal/services/storage/storage_table_entity_resource.go @@ -3,6 +3,7 @@ package storage import ( "fmt" "log" + "strings" "time" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -163,7 +164,7 @@ func resourceStorageTableEntityRead(d *pluginsdk.ResourceData, meta interface{}) input := entities.GetEntityInput{ PartitionKey: id.PartitionKey, RowKey: id.RowKey, - MetaDataLevel: entities.NoMetaData, + MetaDataLevel: entities.FullMetaData, } result, err := client.Get(ctx, id.AccountName, id.TableName, input) @@ -223,5 +224,53 @@ func flattenEntity(entity map[string]interface{}) map[string]interface{} { delete(entity, "RowKey") delete(entity, "Timestamp") - return entity + result := map[string]interface{}{} + for k, v := range entity { + // skip ODATA annotation returned with fullmetadata + if strings.HasPrefix(k, "odata.") || strings.HasSuffix(k, "@odata.type") { + continue + } + if dtype, ok := entity[k+"@odata.type"]; ok { + switch dtype { + case "Edm.Boolean": + result[k] = fmt.Sprint(v) + case "Edm.Double": + result[k] = fmt.Sprintf("%f", v) + case "Edm.Int32": + fallthrough + case "Edm.Int64": + result[k] = fmt.Sprintf("%d", int64(v.(float64))) + case "Edm.String": + result[k] = v + default: + log.Printf("[WARN] key %q with unexpected @odata.type %q", k, dtype) + continue + } + + result[k+"@odata.type"] = dtype + } else { + // special handling for property types that do not require the annotation to be present + // https://docs.microsoft.com/en-us/rest/api/storageservices/payload-format-for-table-service-operations#property-types-in-a-json-feed + switch c := v.(type) { + case bool: + result[k] = fmt.Sprint(v) + result[k+"@odata.type"] = "Edm.Boolean" + case float64: + f64 := v.(float64) + if v == float64(int64(f64)) { + result[k] = fmt.Sprintf("%d", int64(f64)) + result[k+"@odata.type"] = "Edm.Int32" + } else { + result[k] = fmt.Sprintf("%f", v) + result[k+"@odata.type"] = "Edm.Double" + } + case string: + result[k] = v + default: + log.Printf("[WARN] key %q with unexpected type %T", k, c) + } + } + } + + return result } diff --git a/internal/services/storage/storage_table_entity_resource_test.go b/internal/services/storage/storage_table_entity_resource_test.go index 71eecddc9fa37..53993534b52f6 100644 --- a/internal/services/storage/storage_table_entity_resource_test.go +++ b/internal/services/storage/storage_table_entity_resource_test.go @@ -67,6 +67,28 @@ func TestAccTableEntity_update(t *testing.T) { }) } +func TestAccTableEntity_update_typed(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_storage_table_entity", "test") + r := StorageTableEntityResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.updated_typed(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func (r StorageTableEntityResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { id, err := entities.ParseResourceID(state.ID) if err != nil { @@ -155,6 +177,26 @@ resource "azurerm_storage_table_entity" "test" { `, template, data.RandomInteger, data.RandomInteger) } +func (r StorageTableEntityResource) updated_typed(data acceptance.TestData) string { + template := r.template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_storage_table_entity" "test" { + storage_account_name = azurerm_storage_account.test.name + table_name = azurerm_storage_table.test.name + + partition_key = "test_partition%d" + row_key = "test_row%d" + entity = { + Foo = 123 + "Foo@odata.type" = "Edm.Int32" + Test = "Updated" + } +} +`, template, data.RandomInteger, data.RandomInteger) +} + func (r StorageTableEntityResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/videoanalyzer/client/client.go b/internal/services/videoanalyzer/client/client.go index e8f5c44cb252c..a5379cc15cb06 100644 --- a/internal/services/videoanalyzer/client/client.go +++ b/internal/services/videoanalyzer/client/client.go @@ -1,20 +1,25 @@ package client import ( - "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer" + "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules" + "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - VideoAnalyzersClient *videoanalyzer.VideoAnalyzerClient + EdgeModuleClient *edgemodules.EdgeModulesClient + VideoAnalyzersClient *videoanalyzers.VideoAnalyzersClient } func NewClient(o *common.ClientOptions) *Client { - VideoAnalyzersClient := videoanalyzer.NewVideoAnalyzerClientWithBaseURI(o.ResourceManagerEndpoint) + edgeModulesClient := edgemodules.NewEdgeModulesClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&edgeModulesClient.Client, o.ResourceManagerAuthorizer) - o.ConfigureClient(&VideoAnalyzersClient.Client, o.ResourceManagerAuthorizer) + videoAnalyzersClient := videoanalyzers.NewVideoAnalyzersClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&videoAnalyzersClient.Client, o.ResourceManagerAuthorizer) return &Client{ - VideoAnalyzersClient: &VideoAnalyzersClient, + EdgeModuleClient: &edgeModulesClient, + VideoAnalyzersClient: &videoAnalyzersClient, } } diff --git a/internal/services/videoanalyzer/video_analyzer_edge_module_resource.go b/internal/services/videoanalyzer/video_analyzer_edge_module_resource.go index 09989a97fecf7..0333e43caaecc 100644 --- a/internal/services/videoanalyzer/video_analyzer_edge_module_resource.go +++ b/internal/services/videoanalyzer/video_analyzer_edge_module_resource.go @@ -7,7 +7,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer" + "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -30,7 +30,7 @@ func resourceVideoAnalyzerEdgeModule() *pluginsdk.Resource { }, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := videoanalyzer.ParseEdgeModuleID(id) + _, err := edgemodules.ParseEdgeModuleID(id) return err }), @@ -60,11 +60,11 @@ func resourceVideoAnalyzerEdgeModule() *pluginsdk.Resource { } func resourceVideoAnalyzerEdgeModuleCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).VideoAnalyzer.VideoAnalyzersClient + client := meta.(*clients.Client).VideoAnalyzer.EdgeModuleClient subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id := videoanalyzer.NewEdgeModuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("video_analyzer_name").(string), d.Get("name").(string)) + id := edgemodules.NewEdgeModuleID(subscriptionId, d.Get("resource_group_name").(string), d.Get("video_analyzer_name").(string), d.Get("name").(string)) if d.IsNewResource() { existing, err := client.EdgeModulesGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ func resourceVideoAnalyzerEdgeModuleCreateUpdate(d *pluginsdk.ResourceData, meta } } - if _, err := client.EdgeModulesCreateOrUpdate(ctx, id, videoanalyzer.EdgeModuleEntity{}); err != nil { + if _, err := client.EdgeModulesCreateOrUpdate(ctx, id, edgemodules.EdgeModuleEntity{}); err != nil { return fmt.Errorf("creating %s: %+v", id, err) } @@ -87,11 +87,11 @@ func resourceVideoAnalyzerEdgeModuleCreateUpdate(d *pluginsdk.ResourceData, meta } func resourceVideoAnalyzerEdgeModuleRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).VideoAnalyzer.VideoAnalyzersClient + client := meta.(*clients.Client).VideoAnalyzer.EdgeModuleClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := videoanalyzer.ParseEdgeModuleID(d.Id()) + id, err := edgemodules.ParseEdgeModuleID(d.Id()) if err != nil { return err } @@ -115,11 +115,11 @@ func resourceVideoAnalyzerEdgeModuleRead(d *pluginsdk.ResourceData, meta interfa } func resourceVideoAnalyzerEdgeModuleDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).VideoAnalyzer.VideoAnalyzersClient + client := meta.(*clients.Client).VideoAnalyzer.EdgeModuleClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := videoanalyzer.ParseEdgeModuleID(d.Id()) + id, err := edgemodules.ParseEdgeModuleID(d.Id()) if err != nil { return err } diff --git a/internal/services/videoanalyzer/video_analyzer_edge_module_resource_test.go b/internal/services/videoanalyzer/video_analyzer_edge_module_resource_test.go index 617d30b9e96cc..948e1484b7da9 100644 --- a/internal/services/videoanalyzer/video_analyzer_edge_module_resource_test.go +++ b/internal/services/videoanalyzer/video_analyzer_edge_module_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer" + "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -48,12 +48,12 @@ func TestAccVideoAnalyzerEdgeModule_requiresImport(t *testing.T) { } func (VideoAnalyzerEdgeModuleResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := videoanalyzer.ParseEdgeModuleID(state.ID) + id, err := edgemodules.ParseEdgeModuleID(state.ID) if err != nil { return nil, err } - resp, err := clients.VideoAnalyzer.VideoAnalyzersClient.EdgeModulesGet(ctx, *id) + resp, err := clients.VideoAnalyzer.EdgeModuleClient.EdgeModulesGet(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %v", *id, err) } diff --git a/internal/services/videoanalyzer/video_analyzer_resource.go b/internal/services/videoanalyzer/video_analyzer_resource.go index b211d83335b0d..3fcacf3fb1331 100644 --- a/internal/services/videoanalyzer/video_analyzer_resource.go +++ b/internal/services/videoanalyzer/video_analyzer_resource.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer" + "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -35,7 +35,7 @@ func resourceVideoAnalyzer() *pluginsdk.Resource { }, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { - _, err := videoanalyzer.ParseVideoAnalyzerID(id) + _, err := videoanalyzers.ParseVideoAnalyzerID(id) return err }), @@ -87,7 +87,7 @@ func resourceVideoAnalyzerCreateUpdate(d *pluginsdk.ResourceData, meta interface ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id := videoanalyzer.NewVideoAnalyzerID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + id := videoanalyzers.NewVideoAnalyzerID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) if d.IsNewResource() { existing, err := client.VideoAnalyzersGet(ctx, id) if err != nil { @@ -105,8 +105,8 @@ func resourceVideoAnalyzerCreateUpdate(d *pluginsdk.ResourceData, meta interface if err != nil { return err } - parameters := videoanalyzer.VideoAnalyzer{ - Properties: &videoanalyzer.VideoAnalyzerPropertiesUpdate{ + parameters := videoanalyzers.VideoAnalyzer{ + Properties: &videoanalyzers.VideoAnalyzerPropertiesUpdate{ StorageAccounts: expandVideoAnalyzerStorageAccounts(d), }, Location: azure.NormalizeLocation(d.Get("location").(string)), @@ -127,7 +127,7 @@ func resourceVideoAnalyzerRead(d *pluginsdk.ResourceData, meta interface{}) erro ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := videoanalyzer.ParseVideoAnalyzerID(d.Id()) + id, err := videoanalyzers.ParseVideoAnalyzerID(d.Id()) if err != nil { return err } @@ -176,7 +176,7 @@ func resourceVideoAnalyzerDelete(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := videoanalyzer.ParseVideoAnalyzerID(d.Id()) + id, err := videoanalyzers.ParseVideoAnalyzerID(d.Id()) if err != nil { return err } @@ -188,13 +188,13 @@ func resourceVideoAnalyzerDelete(d *pluginsdk.ResourceData, meta interface{}) er return nil } -func expandVideoAnalyzerStorageAccounts(d *pluginsdk.ResourceData) *[]videoanalyzer.StorageAccount { +func expandVideoAnalyzerStorageAccounts(d *pluginsdk.ResourceData) *[]videoanalyzers.StorageAccount { storageAccountRaw := d.Get("storage_account").([]interface{})[0].(map[string]interface{}) - results := []videoanalyzer.StorageAccount{ + results := []videoanalyzers.StorageAccount{ { Id: utils.String(storageAccountRaw["id"].(string)), - Identity: &videoanalyzer.ResourceIdentity{ + Identity: &videoanalyzers.ResourceIdentity{ UserAssignedIdentity: storageAccountRaw["user_assigned_identity_id"].(string), }, }, @@ -203,7 +203,7 @@ func expandVideoAnalyzerStorageAccounts(d *pluginsdk.ResourceData) *[]videoanaly return &results } -func flattenVideoAnalyzerStorageAccounts(input *[]videoanalyzer.StorageAccount) []interface{} { +func flattenVideoAnalyzerStorageAccounts(input *[]videoanalyzers.StorageAccount) []interface{} { if input == nil { return []interface{}{} } @@ -229,13 +229,13 @@ func flattenVideoAnalyzerStorageAccounts(input *[]videoanalyzer.StorageAccount) return results } -func expandAzureRmVideoAnalyzerIdentity(d *pluginsdk.ResourceData) (*videoanalyzer.VideoAnalyzerIdentity, error) { +func expandAzureRmVideoAnalyzerIdentity(d *pluginsdk.ResourceData) (*videoanalyzers.VideoAnalyzerIdentity, error) { identityRaw := d.Get("identity").([]interface{}) if identityRaw[0] == nil { return nil, fmt.Errorf("an `identity` block is required") } identity := identityRaw[0].(map[string]interface{}) - result := &videoanalyzer.VideoAnalyzerIdentity{ + result := &videoanalyzers.VideoAnalyzerIdentity{ Type: identity["type"].(string), } var identityIdSet []interface{} @@ -243,16 +243,16 @@ func expandAzureRmVideoAnalyzerIdentity(d *pluginsdk.ResourceData) (*videoanalyz identityIdSet = identityIds.(*pluginsdk.Set).List() } - userAssignedIdentities := make(map[string]videoanalyzer.UserAssignedManagedIdentity) + userAssignedIdentities := make(map[string]videoanalyzers.UserAssignedManagedIdentity) for _, id := range identityIdSet { - userAssignedIdentities[id.(string)] = videoanalyzer.UserAssignedManagedIdentity{} + userAssignedIdentities[id.(string)] = videoanalyzers.UserAssignedManagedIdentity{} } result.UserAssignedIdentities = &userAssignedIdentities return result, nil } -func flattenAzureRmVideoServiceIdentity(identity *videoanalyzer.VideoAnalyzerIdentity) ([]interface{}, error) { +func flattenAzureRmVideoServiceIdentity(identity *videoanalyzers.VideoAnalyzerIdentity) ([]interface{}, error) { if identity == nil { return make([]interface{}, 0), nil } diff --git a/internal/services/videoanalyzer/video_analyzer_resource_test.go b/internal/services/videoanalyzer/video_analyzer_resource_test.go index bbfaf42676181..5b5063547cd90 100644 --- a/internal/services/videoanalyzer/video_analyzer_resource_test.go +++ b/internal/services/videoanalyzer/video_analyzer_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer" + "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -70,7 +70,7 @@ func TestAccVideoAnalyzer_complete(t *testing.T) { } func (VideoAnalyzerResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := videoanalyzer.ParseVideoAnalyzerID(state.ID) + id, err := videoanalyzers.ParseVideoAnalyzerID(state.ID) if err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4c..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/_meta.json deleted file mode 100644 index 9d744e74962bc..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "e0f8b9ab0f5fe5e71b7429ebfea8a33c19ec9d8d", - "readme": "/_/azure-rest-api-specs/specification/cost-management/resource-manager/readme.md", - "tag": "package-2020-06", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-06 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/cost-management/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/alerts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/alerts.go deleted file mode 100644 index 38e55cab43241..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/alerts.go +++ /dev/null @@ -1,374 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AlertsClient is the client for the Alerts methods of the Costmanagement service. -type AlertsClient struct { - BaseClient -} - -// NewAlertsClient creates an instance of the AlertsClient client. -func NewAlertsClient(subscriptionID string) AlertsClient { - return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAlertsClientWithBaseURI creates an instance of the AlertsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsClient { - return AlertsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Dismiss dismisses the specified alert -// Parameters: -// scope - the scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// alertID - alert ID -// parameters - parameters supplied to the Dismiss Alert operation. -func (client AlertsClient) Dismiss(ctx context.Context, scope string, alertID string, parameters DismissAlertPayload) (result Alert, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.Dismiss") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DismissPreparer(ctx, scope, alertID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "Dismiss", nil, "Failure preparing request") - return - } - - resp, err := client.DismissSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "Dismiss", resp, "Failure sending request") - return - } - - result, err = client.DismissResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "Dismiss", resp, "Failure responding to request") - return - } - - return -} - -// DismissPreparer prepares the Dismiss request. -func (client AlertsClient) DismissPreparer(ctx context.Context, scope string, alertID string, parameters DismissAlertPayload) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "alertId": alertID, - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DismissSender sends the Dismiss request. The method will close the -// http.Response Body if it receives an error. -func (client AlertsClient) DismissSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DismissResponder handles the response to the Dismiss request. The method always -// closes the http.Response Body. -func (client AlertsClient) DismissResponder(resp *http.Response) (result Alert, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets the alert for the scope by alert ID. -// Parameters: -// scope - the scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// alertID - alert ID -func (client AlertsClient) Get(ctx context.Context, scope string, alertID string) (result Alert, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, scope, alertID) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AlertsClient) GetPreparer(ctx context.Context, scope string, alertID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "alertId": alertID, - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AlertsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AlertsClient) GetResponder(resp *http.Response) (result Alert, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists the alerts for scope defined. -// Parameters: -// scope - the scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -func (client AlertsClient) List(ctx context.Context, scope string) (result AlertsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AlertsClient) ListPreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/alerts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AlertsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AlertsClient) ListResponder(resp *http.Response) (result AlertsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListExternal lists the Alerts for external cloud provider type defined. -// Parameters: -// externalCloudProviderType - the external cloud provider type associated with dimension/query operations. -// This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated -// account. -// externalCloudProviderID - this can be '{externalSubscriptionId}' for linked account or -// '{externalBillingAccountId}' for consolidated account used with dimension/query operations. -func (client AlertsClient) ListExternal(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string) (result AlertsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListExternal") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListExternalPreparer(ctx, externalCloudProviderType, externalCloudProviderID) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "ListExternal", nil, "Failure preparing request") - return - } - - resp, err := client.ListExternalSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "ListExternal", resp, "Failure sending request") - return - } - - result, err = client.ListExternalResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.AlertsClient", "ListExternal", resp, "Failure responding to request") - return - } - - return -} - -// ListExternalPreparer prepares the ListExternal request. -func (client AlertsClient) ListExternalPreparer(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "externalCloudProviderId": autorest.Encode("path", externalCloudProviderID), - "externalCloudProviderType": autorest.Encode("path", externalCloudProviderType), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListExternalSender sends the ListExternal request. The method will close the -// http.Response Body if it receives an error. -func (client AlertsClient) ListExternalSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListExternalResponder handles the response to the ListExternal request. The method always -// closes the http.Response Body. -func (client AlertsClient) ListExternalResponder(resp *http.Response) (result AlertsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/client.go deleted file mode 100644 index b51618e010671..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/client.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package costmanagement implements the Azure ARM Costmanagement service API version 2020-06-01. -// -// -package costmanagement - -// 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. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Costmanagement - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Costmanagement. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/dimensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/dimensions.go deleted file mode 100644 index 3d08677933fc4..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/dimensions.go +++ /dev/null @@ -1,254 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DimensionsClient is the client for the Dimensions methods of the Costmanagement service. -type DimensionsClient struct { - BaseClient -} - -// NewDimensionsClient creates an instance of the DimensionsClient client. -func NewDimensionsClient(subscriptionID string) DimensionsClient { - return NewDimensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDimensionsClientWithBaseURI creates an instance of the DimensionsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDimensionsClientWithBaseURI(baseURI string, subscriptionID string) DimensionsClient { - return DimensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ByExternalCloudProviderType lists the dimensions by the external cloud provider type. -// Parameters: -// externalCloudProviderType - the external cloud provider type associated with dimension/query operations. -// This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated -// account. -// externalCloudProviderID - this can be '{externalSubscriptionId}' for linked account or -// '{externalBillingAccountId}' for consolidated account used with dimension/query operations. -// filter - may be used to filter dimensions by properties/category, properties/usageStart, -// properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. -// expand - may be used to expand the properties/data within a dimension category. By default, data is not -// included when listing dimensions. -// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that -// specifies a starting point to use for subsequent calls. -// top - may be used to limit the number of results to the most recent N dimension data. -func (client DimensionsClient) ByExternalCloudProviderType(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, filter string, expand string, skiptoken string, top *int32) (result DimensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DimensionsClient.ByExternalCloudProviderType") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.DimensionsClient", "ByExternalCloudProviderType", err.Error()) - } - - req, err := client.ByExternalCloudProviderTypePreparer(ctx, externalCloudProviderType, externalCloudProviderID, filter, expand, skiptoken, top) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "ByExternalCloudProviderType", nil, "Failure preparing request") - return - } - - resp, err := client.ByExternalCloudProviderTypeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "ByExternalCloudProviderType", resp, "Failure sending request") - return - } - - result, err = client.ByExternalCloudProviderTypeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "ByExternalCloudProviderType", resp, "Failure responding to request") - return - } - - return -} - -// ByExternalCloudProviderTypePreparer prepares the ByExternalCloudProviderType request. -func (client DimensionsClient) ByExternalCloudProviderTypePreparer(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, filter string, expand string, skiptoken string, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "externalCloudProviderId": autorest.Encode("path", externalCloudProviderID), - "externalCloudProviderType": autorest.Encode("path", externalCloudProviderType), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if len(skiptoken) > 0 { - queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ByExternalCloudProviderTypeSender sends the ByExternalCloudProviderType request. The method will close the -// http.Response Body if it receives an error. -func (client DimensionsClient) ByExternalCloudProviderTypeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ByExternalCloudProviderTypeResponder handles the response to the ByExternalCloudProviderType request. The method always -// closes the http.Response Body. -func (client DimensionsClient) ByExternalCloudProviderTypeResponder(resp *http.Response) (result DimensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists the dimensions by the defined scope. -// Parameters: -// scope - the scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// filter - may be used to filter dimensions by properties/category, properties/usageStart, -// properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. -// expand - may be used to expand the properties/data within a dimension category. By default, data is not -// included when listing dimensions. -// skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that -// specifies a starting point to use for subsequent calls. -// top - may be used to limit the number of results to the most recent N dimension data. -func (client DimensionsClient) List(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (result DimensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DimensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.DimensionsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, scope, filter, expand, skiptoken, top) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.DimensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DimensionsClient) ListPreparer(ctx context.Context, scope string, filter string, expand string, skiptoken string, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if len(skiptoken) > 0 { - queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/dimensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DimensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DimensionsClient) ListResponder(resp *http.Response) (result DimensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/enums.go deleted file mode 100644 index 605588d2729ec..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/enums.go +++ /dev/null @@ -1,546 +0,0 @@ -package costmanagement - -// 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. - -// AccumulatedType enumerates the values for accumulated type. -type AccumulatedType string - -const ( - // False ... - False AccumulatedType = "false" - // True ... - True AccumulatedType = "true" -) - -// PossibleAccumulatedTypeValues returns an array of possible values for the AccumulatedType const type. -func PossibleAccumulatedTypeValues() []AccumulatedType { - return []AccumulatedType{False, True} -} - -// AlertCategory enumerates the values for alert category. -type AlertCategory string - -const ( - // Billing ... - Billing AlertCategory = "Billing" - // Cost ... - Cost AlertCategory = "Cost" - // System ... - System AlertCategory = "System" - // Usage ... - Usage AlertCategory = "Usage" -) - -// PossibleAlertCategoryValues returns an array of possible values for the AlertCategory const type. -func PossibleAlertCategoryValues() []AlertCategory { - return []AlertCategory{Billing, Cost, System, Usage} -} - -// AlertCriteria enumerates the values for alert criteria. -type AlertCriteria string - -const ( - // CostThresholdExceeded ... - CostThresholdExceeded AlertCriteria = "CostThresholdExceeded" - // CreditThresholdApproaching ... - CreditThresholdApproaching AlertCriteria = "CreditThresholdApproaching" - // CreditThresholdReached ... - CreditThresholdReached AlertCriteria = "CreditThresholdReached" - // CrossCloudCollectionError ... - CrossCloudCollectionError AlertCriteria = "CrossCloudCollectionError" - // CrossCloudNewDataAvailable ... - CrossCloudNewDataAvailable AlertCriteria = "CrossCloudNewDataAvailable" - // ForecastCostThresholdExceeded ... - ForecastCostThresholdExceeded AlertCriteria = "ForecastCostThresholdExceeded" - // ForecastUsageThresholdExceeded ... - ForecastUsageThresholdExceeded AlertCriteria = "ForecastUsageThresholdExceeded" - // GeneralThresholdError ... - GeneralThresholdError AlertCriteria = "GeneralThresholdError" - // InvoiceDueDateApproaching ... - InvoiceDueDateApproaching AlertCriteria = "InvoiceDueDateApproaching" - // InvoiceDueDateReached ... - InvoiceDueDateReached AlertCriteria = "InvoiceDueDateReached" - // MultiCurrency ... - MultiCurrency AlertCriteria = "MultiCurrency" - // QuotaThresholdApproaching ... - QuotaThresholdApproaching AlertCriteria = "QuotaThresholdApproaching" - // QuotaThresholdReached ... - QuotaThresholdReached AlertCriteria = "QuotaThresholdReached" - // UsageThresholdExceeded ... - UsageThresholdExceeded AlertCriteria = "UsageThresholdExceeded" -) - -// PossibleAlertCriteriaValues returns an array of possible values for the AlertCriteria const type. -func PossibleAlertCriteriaValues() []AlertCriteria { - return []AlertCriteria{CostThresholdExceeded, CreditThresholdApproaching, CreditThresholdReached, CrossCloudCollectionError, CrossCloudNewDataAvailable, ForecastCostThresholdExceeded, ForecastUsageThresholdExceeded, GeneralThresholdError, InvoiceDueDateApproaching, InvoiceDueDateReached, MultiCurrency, QuotaThresholdApproaching, QuotaThresholdReached, UsageThresholdExceeded} -} - -// AlertOperator enumerates the values for alert operator. -type AlertOperator string - -const ( - // EqualTo ... - EqualTo AlertOperator = "EqualTo" - // GreaterThan ... - GreaterThan AlertOperator = "GreaterThan" - // GreaterThanOrEqualTo ... - GreaterThanOrEqualTo AlertOperator = "GreaterThanOrEqualTo" - // LessThan ... - LessThan AlertOperator = "LessThan" - // LessThanOrEqualTo ... - LessThanOrEqualTo AlertOperator = "LessThanOrEqualTo" - // None ... - None AlertOperator = "None" -) - -// PossibleAlertOperatorValues returns an array of possible values for the AlertOperator const type. -func PossibleAlertOperatorValues() []AlertOperator { - return []AlertOperator{EqualTo, GreaterThan, GreaterThanOrEqualTo, LessThan, LessThanOrEqualTo, None} -} - -// AlertSource enumerates the values for alert source. -type AlertSource string - -const ( - // Preset ... - Preset AlertSource = "Preset" - // User ... - User AlertSource = "User" -) - -// PossibleAlertSourceValues returns an array of possible values for the AlertSource const type. -func PossibleAlertSourceValues() []AlertSource { - return []AlertSource{Preset, User} -} - -// AlertStatus enumerates the values for alert status. -type AlertStatus string - -const ( - // AlertStatusActive ... - AlertStatusActive AlertStatus = "Active" - // AlertStatusDismissed ... - AlertStatusDismissed AlertStatus = "Dismissed" - // AlertStatusNone ... - AlertStatusNone AlertStatus = "None" - // AlertStatusOverridden ... - AlertStatusOverridden AlertStatus = "Overridden" - // AlertStatusResolved ... - AlertStatusResolved AlertStatus = "Resolved" -) - -// PossibleAlertStatusValues returns an array of possible values for the AlertStatus const type. -func PossibleAlertStatusValues() []AlertStatus { - return []AlertStatus{AlertStatusActive, AlertStatusDismissed, AlertStatusNone, AlertStatusOverridden, AlertStatusResolved} -} - -// AlertTimeGrainType enumerates the values for alert time grain type. -type AlertTimeGrainType string - -const ( - // AlertTimeGrainTypeAnnually ... - AlertTimeGrainTypeAnnually AlertTimeGrainType = "Annually" - // AlertTimeGrainTypeBillingAnnual ... - AlertTimeGrainTypeBillingAnnual AlertTimeGrainType = "BillingAnnual" - // AlertTimeGrainTypeBillingMonth ... - AlertTimeGrainTypeBillingMonth AlertTimeGrainType = "BillingMonth" - // AlertTimeGrainTypeBillingQuarter ... - AlertTimeGrainTypeBillingQuarter AlertTimeGrainType = "BillingQuarter" - // AlertTimeGrainTypeMonthly ... - AlertTimeGrainTypeMonthly AlertTimeGrainType = "Monthly" - // AlertTimeGrainTypeNone ... - AlertTimeGrainTypeNone AlertTimeGrainType = "None" - // AlertTimeGrainTypeQuarterly ... - AlertTimeGrainTypeQuarterly AlertTimeGrainType = "Quarterly" -) - -// PossibleAlertTimeGrainTypeValues returns an array of possible values for the AlertTimeGrainType const type. -func PossibleAlertTimeGrainTypeValues() []AlertTimeGrainType { - return []AlertTimeGrainType{AlertTimeGrainTypeAnnually, AlertTimeGrainTypeBillingAnnual, AlertTimeGrainTypeBillingMonth, AlertTimeGrainTypeBillingQuarter, AlertTimeGrainTypeMonthly, AlertTimeGrainTypeNone, AlertTimeGrainTypeQuarterly} -} - -// AlertType enumerates the values for alert type. -type AlertType string - -const ( - // Budget ... - Budget AlertType = "Budget" - // BudgetForecast ... - BudgetForecast AlertType = "BudgetForecast" - // Credit ... - Credit AlertType = "Credit" - // General ... - General AlertType = "General" - // Invoice ... - Invoice AlertType = "Invoice" - // Quota ... - Quota AlertType = "Quota" - // XCloud ... - XCloud AlertType = "xCloud" -) - -// PossibleAlertTypeValues returns an array of possible values for the AlertType const type. -func PossibleAlertTypeValues() []AlertType { - return []AlertType{Budget, BudgetForecast, Credit, General, Invoice, Quota, XCloud} -} - -// ChartType enumerates the values for chart type. -type ChartType string - -const ( - // Area ... - Area ChartType = "Area" - // GroupedColumn ... - GroupedColumn ChartType = "GroupedColumn" - // Line ... - Line ChartType = "Line" - // StackedColumn ... - StackedColumn ChartType = "StackedColumn" - // Table ... - Table ChartType = "Table" -) - -// PossibleChartTypeValues returns an array of possible values for the ChartType const type. -func PossibleChartTypeValues() []ChartType { - return []ChartType{Area, GroupedColumn, Line, StackedColumn, Table} -} - -// Direction enumerates the values for direction. -type Direction string - -const ( - // Ascending ... - Ascending Direction = "Ascending" - // Descending ... - Descending Direction = "Descending" -) - -// PossibleDirectionValues returns an array of possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{Ascending, Descending} -} - -// ExecutionStatus enumerates the values for execution status. -type ExecutionStatus string - -const ( - // Completed ... - Completed ExecutionStatus = "Completed" - // DataNotAvailable ... - DataNotAvailable ExecutionStatus = "DataNotAvailable" - // Failed ... - Failed ExecutionStatus = "Failed" - // InProgress ... - InProgress ExecutionStatus = "InProgress" - // NewDataNotAvailable ... - NewDataNotAvailable ExecutionStatus = "NewDataNotAvailable" - // Queued ... - Queued ExecutionStatus = "Queued" - // Timeout ... - Timeout ExecutionStatus = "Timeout" -) - -// PossibleExecutionStatusValues returns an array of possible values for the ExecutionStatus const type. -func PossibleExecutionStatusValues() []ExecutionStatus { - return []ExecutionStatus{Completed, DataNotAvailable, Failed, InProgress, NewDataNotAvailable, Queued, Timeout} -} - -// ExecutionType enumerates the values for execution type. -type ExecutionType string - -const ( - // OnDemand ... - OnDemand ExecutionType = "OnDemand" - // Scheduled ... - Scheduled ExecutionType = "Scheduled" -) - -// PossibleExecutionTypeValues returns an array of possible values for the ExecutionType const type. -func PossibleExecutionTypeValues() []ExecutionType { - return []ExecutionType{OnDemand, Scheduled} -} - -// ExportType enumerates the values for export type. -type ExportType string - -const ( - // ExportTypeActualCost ... - ExportTypeActualCost ExportType = "ActualCost" - // ExportTypeAmortizedCost ... - ExportTypeAmortizedCost ExportType = "AmortizedCost" - // ExportTypeUsage ... - ExportTypeUsage ExportType = "Usage" -) - -// PossibleExportTypeValues returns an array of possible values for the ExportType const type. -func PossibleExportTypeValues() []ExportType { - return []ExportType{ExportTypeActualCost, ExportTypeAmortizedCost, ExportTypeUsage} -} - -// ExternalCloudProviderType enumerates the values for external cloud provider type. -type ExternalCloudProviderType string - -const ( - // ExternalBillingAccounts ... - ExternalBillingAccounts ExternalCloudProviderType = "externalBillingAccounts" - // ExternalSubscriptions ... - ExternalSubscriptions ExternalCloudProviderType = "externalSubscriptions" -) - -// PossibleExternalCloudProviderTypeValues returns an array of possible values for the ExternalCloudProviderType const type. -func PossibleExternalCloudProviderTypeValues() []ExternalCloudProviderType { - return []ExternalCloudProviderType{ExternalBillingAccounts, ExternalSubscriptions} -} - -// ForecastTimeframeType enumerates the values for forecast timeframe type. -type ForecastTimeframeType string - -const ( - // BillingMonthToDate ... - BillingMonthToDate ForecastTimeframeType = "BillingMonthToDate" - // Custom ... - Custom ForecastTimeframeType = "Custom" - // MonthToDate ... - MonthToDate ForecastTimeframeType = "MonthToDate" - // TheLastBillingMonth ... - TheLastBillingMonth ForecastTimeframeType = "TheLastBillingMonth" - // TheLastMonth ... - TheLastMonth ForecastTimeframeType = "TheLastMonth" - // WeekToDate ... - WeekToDate ForecastTimeframeType = "WeekToDate" -) - -// PossibleForecastTimeframeTypeValues returns an array of possible values for the ForecastTimeframeType const type. -func PossibleForecastTimeframeTypeValues() []ForecastTimeframeType { - return []ForecastTimeframeType{BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate} -} - -// ForecastType enumerates the values for forecast type. -type ForecastType string - -const ( - // ForecastTypeActualCost ... - ForecastTypeActualCost ForecastType = "ActualCost" - // ForecastTypeAmortizedCost ... - ForecastTypeAmortizedCost ForecastType = "AmortizedCost" - // ForecastTypeUsage ... - ForecastTypeUsage ForecastType = "Usage" -) - -// PossibleForecastTypeValues returns an array of possible values for the ForecastType const type. -func PossibleForecastTypeValues() []ForecastType { - return []ForecastType{ForecastTypeActualCost, ForecastTypeAmortizedCost, ForecastTypeUsage} -} - -// FormatType enumerates the values for format type. -type FormatType string - -const ( - // Csv ... - Csv FormatType = "Csv" -) - -// PossibleFormatTypeValues returns an array of possible values for the FormatType const type. -func PossibleFormatTypeValues() []FormatType { - return []FormatType{Csv} -} - -// GranularityType enumerates the values for granularity type. -type GranularityType string - -const ( - // Daily ... - Daily GranularityType = "Daily" -) - -// PossibleGranularityTypeValues returns an array of possible values for the GranularityType const type. -func PossibleGranularityTypeValues() []GranularityType { - return []GranularityType{Daily} -} - -// KpiTypeType enumerates the values for kpi type type. -type KpiTypeType string - -const ( - // KpiTypeTypeBudget ... - KpiTypeTypeBudget KpiTypeType = "Budget" - // KpiTypeTypeForecast ... - KpiTypeTypeForecast KpiTypeType = "Forecast" -) - -// PossibleKpiTypeTypeValues returns an array of possible values for the KpiTypeType const type. -func PossibleKpiTypeTypeValues() []KpiTypeType { - return []KpiTypeType{KpiTypeTypeBudget, KpiTypeTypeForecast} -} - -// MetricType enumerates the values for metric type. -type MetricType string - -const ( - // ActualCost ... - ActualCost MetricType = "ActualCost" - // AHUB ... - AHUB MetricType = "AHUB" - // AmortizedCost ... - AmortizedCost MetricType = "AmortizedCost" -) - -// PossibleMetricTypeValues returns an array of possible values for the MetricType const type. -func PossibleMetricTypeValues() []MetricType { - return []MetricType{ActualCost, AHUB, AmortizedCost} -} - -// OperatorType enumerates the values for operator type. -type OperatorType string - -const ( - // Contains ... - Contains OperatorType = "Contains" - // In ... - In OperatorType = "In" -) - -// PossibleOperatorTypeValues returns an array of possible values for the OperatorType const type. -func PossibleOperatorTypeValues() []OperatorType { - return []OperatorType{Contains, In} -} - -// PivotTypeType enumerates the values for pivot type type. -type PivotTypeType string - -const ( - // PivotTypeTypeDimension ... - PivotTypeTypeDimension PivotTypeType = "Dimension" - // PivotTypeTypeTagKey ... - PivotTypeTypeTagKey PivotTypeType = "TagKey" -) - -// PossiblePivotTypeTypeValues returns an array of possible values for the PivotTypeType const type. -func PossiblePivotTypeTypeValues() []PivotTypeType { - return []PivotTypeType{PivotTypeTypeDimension, PivotTypeTypeTagKey} -} - -// QueryColumnType enumerates the values for query column type. -type QueryColumnType string - -const ( - // QueryColumnTypeDimension ... - QueryColumnTypeDimension QueryColumnType = "Dimension" - // QueryColumnTypeTag ... - QueryColumnTypeTag QueryColumnType = "Tag" -) - -// PossibleQueryColumnTypeValues returns an array of possible values for the QueryColumnType const type. -func PossibleQueryColumnTypeValues() []QueryColumnType { - return []QueryColumnType{QueryColumnTypeDimension, QueryColumnTypeTag} -} - -// RecurrenceType enumerates the values for recurrence type. -type RecurrenceType string - -const ( - // RecurrenceTypeAnnually ... - RecurrenceTypeAnnually RecurrenceType = "Annually" - // RecurrenceTypeDaily ... - RecurrenceTypeDaily RecurrenceType = "Daily" - // RecurrenceTypeMonthly ... - RecurrenceTypeMonthly RecurrenceType = "Monthly" - // RecurrenceTypeWeekly ... - RecurrenceTypeWeekly RecurrenceType = "Weekly" -) - -// PossibleRecurrenceTypeValues returns an array of possible values for the RecurrenceType const type. -func PossibleRecurrenceTypeValues() []RecurrenceType { - return []RecurrenceType{RecurrenceTypeAnnually, RecurrenceTypeDaily, RecurrenceTypeMonthly, RecurrenceTypeWeekly} -} - -// ReportConfigColumnType enumerates the values for report config column type. -type ReportConfigColumnType string - -const ( - // ReportConfigColumnTypeDimension ... - ReportConfigColumnTypeDimension ReportConfigColumnType = "Dimension" - // ReportConfigColumnTypeTag ... - ReportConfigColumnTypeTag ReportConfigColumnType = "Tag" -) - -// PossibleReportConfigColumnTypeValues returns an array of possible values for the ReportConfigColumnType const type. -func PossibleReportConfigColumnTypeValues() []ReportConfigColumnType { - return []ReportConfigColumnType{ReportConfigColumnTypeDimension, ReportConfigColumnTypeTag} -} - -// ReportGranularityType enumerates the values for report granularity type. -type ReportGranularityType string - -const ( - // ReportGranularityTypeDaily ... - ReportGranularityTypeDaily ReportGranularityType = "Daily" - // ReportGranularityTypeMonthly ... - ReportGranularityTypeMonthly ReportGranularityType = "Monthly" -) - -// PossibleReportGranularityTypeValues returns an array of possible values for the ReportGranularityType const type. -func PossibleReportGranularityTypeValues() []ReportGranularityType { - return []ReportGranularityType{ReportGranularityTypeDaily, ReportGranularityTypeMonthly} -} - -// ReportTimeframeType enumerates the values for report timeframe type. -type ReportTimeframeType string - -const ( - // ReportTimeframeTypeCustom ... - ReportTimeframeTypeCustom ReportTimeframeType = "Custom" - // ReportTimeframeTypeMonthToDate ... - ReportTimeframeTypeMonthToDate ReportTimeframeType = "MonthToDate" - // ReportTimeframeTypeWeekToDate ... - ReportTimeframeTypeWeekToDate ReportTimeframeType = "WeekToDate" - // ReportTimeframeTypeYearToDate ... - ReportTimeframeTypeYearToDate ReportTimeframeType = "YearToDate" -) - -// PossibleReportTimeframeTypeValues returns an array of possible values for the ReportTimeframeType const type. -func PossibleReportTimeframeTypeValues() []ReportTimeframeType { - return []ReportTimeframeType{ReportTimeframeTypeCustom, ReportTimeframeTypeMonthToDate, ReportTimeframeTypeWeekToDate, ReportTimeframeTypeYearToDate} -} - -// StatusType enumerates the values for status type. -type StatusType string - -const ( - // Active ... - Active StatusType = "Active" - // Inactive ... - Inactive StatusType = "Inactive" -) - -// PossibleStatusTypeValues returns an array of possible values for the StatusType const type. -func PossibleStatusTypeValues() []StatusType { - return []StatusType{Active, Inactive} -} - -// TimeframeType enumerates the values for timeframe type. -type TimeframeType string - -const ( - // TimeframeTypeBillingMonthToDate ... - TimeframeTypeBillingMonthToDate TimeframeType = "BillingMonthToDate" - // TimeframeTypeCustom ... - TimeframeTypeCustom TimeframeType = "Custom" - // TimeframeTypeMonthToDate ... - TimeframeTypeMonthToDate TimeframeType = "MonthToDate" - // TimeframeTypeTheLastBillingMonth ... - TimeframeTypeTheLastBillingMonth TimeframeType = "TheLastBillingMonth" - // TimeframeTypeTheLastMonth ... - TimeframeTypeTheLastMonth TimeframeType = "TheLastMonth" - // TimeframeTypeWeekToDate ... - TimeframeTypeWeekToDate TimeframeType = "WeekToDate" -) - -// PossibleTimeframeTypeValues returns an array of possible values for the TimeframeType const type. -func PossibleTimeframeTypeValues() []TimeframeType { - return []TimeframeType{TimeframeTypeBillingMonthToDate, TimeframeTypeCustom, TimeframeTypeMonthToDate, TimeframeTypeTheLastBillingMonth, TimeframeTypeTheLastMonth, TimeframeTypeWeekToDate} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/exports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/exports.go deleted file mode 100644 index 10febf8574d76..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/exports.go +++ /dev/null @@ -1,581 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExportsClient is the client for the Exports methods of the Costmanagement service. -type ExportsClient struct { - BaseClient -} - -// NewExportsClient creates an instance of the ExportsClient client. -func NewExportsClient(subscriptionID string) ExportsClient { - return NewExportsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExportsClientWithBaseURI creates an instance of the ExportsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewExportsClientWithBaseURI(baseURI string, subscriptionID string) ExportsClient { - return ExportsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update a export. Update operation requires latest eTag to be set in the -// request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -// Parameters: -// scope - the scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// exportName - export Name. -// parameters - parameters supplied to the CreateOrUpdate Export operation. -func (client ExportsClient) CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters Export) (result Export, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ExportProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule.RecurrencePeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ExportProperties.Schedule.RecurrencePeriod.From", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.ExportsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, scope, exportName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExportsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, exportName string, parameters Export) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "exportName": autorest.Encode("path", exportName), - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExportsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExportsClient) CreateOrUpdateResponder(resp *http.Response) (result Export, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete a export. -// Parameters: -// scope - the scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// exportName - export Name. -func (client ExportsClient) Delete(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, scope, exportName) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExportsClient) DeletePreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "exportName": autorest.Encode("path", exportName), - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExportsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExportsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Execute the operation to execute an export. -// Parameters: -// scope - the scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// exportName - export Name. -func (client ExportsClient) Execute(ctx context.Context, scope string, exportName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.Execute") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ExecutePreparer(ctx, scope, exportName) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", nil, "Failure preparing request") - return - } - - resp, err := client.ExecuteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", resp, "Failure sending request") - return - } - - result, err = client.ExecuteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Execute", resp, "Failure responding to request") - return - } - - return -} - -// ExecutePreparer prepares the Execute request. -func (client ExportsClient) ExecutePreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "exportName": autorest.Encode("path", exportName), - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExecuteSender sends the Execute request. The method will close the -// http.Response Body if it receives an error. -func (client ExportsClient) ExecuteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExecuteResponder handles the response to the Execute request. The method always -// closes the http.Response Body. -func (client ExportsClient) ExecuteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the export for the defined scope by export name. -// Parameters: -// scope - the scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// exportName - export Name. -// expand - may be used to expand the properties within an export. Currently only 'runHistory' is supported and -// will return information for the last 10 executions of the export. -func (client ExportsClient) Get(ctx context.Context, scope string, exportName string, expand string) (result Export, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, scope, exportName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExportsClient) GetPreparer(ctx context.Context, scope string, exportName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "exportName": autorest.Encode("path", exportName), - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExportsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExportsClient) GetResponder(resp *http.Response) (result Export, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetExecutionHistory the operation to get the execution history of an export for the defined scope and export name. -// Parameters: -// scope - the scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// exportName - export Name. -func (client ExportsClient) GetExecutionHistory(ctx context.Context, scope string, exportName string) (result ExportExecutionListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.GetExecutionHistory") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetExecutionHistoryPreparer(ctx, scope, exportName) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", nil, "Failure preparing request") - return - } - - resp, err := client.GetExecutionHistorySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", resp, "Failure sending request") - return - } - - result, err = client.GetExecutionHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "GetExecutionHistory", resp, "Failure responding to request") - return - } - - return -} - -// GetExecutionHistoryPreparer prepares the GetExecutionHistory request. -func (client ExportsClient) GetExecutionHistoryPreparer(ctx context.Context, scope string, exportName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "exportName": autorest.Encode("path", exportName), - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetExecutionHistorySender sends the GetExecutionHistory request. The method will close the -// http.Response Body if it receives an error. -func (client ExportsClient) GetExecutionHistorySender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetExecutionHistoryResponder handles the response to the GetExecutionHistory request. The method always -// closes the http.Response Body. -func (client ExportsClient) GetExecutionHistoryResponder(resp *http.Response) (result ExportExecutionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to list all exports at the given scope. -// Parameters: -// scope - the scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// expand - may be used to expand the properties within an export. Currently only 'runHistory' is supported and -// will return information for the last execution of each export. -func (client ExportsClient) List(ctx context.Context, scope string, expand string) (result ExportListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExportsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, scope, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ExportsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExportsClient) ListPreparer(ctx context.Context, scope string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/exports", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExportsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExportsClient) ListResponder(resp *http.Response) (result ExportListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/forecast.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/forecast.go deleted file mode 100644 index fac797fa2654c..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/forecast.go +++ /dev/null @@ -1,274 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ForecastClient is the client for the Forecast methods of the Costmanagement service. -type ForecastClient struct { - BaseClient -} - -// NewForecastClient creates an instance of the ForecastClient client. -func NewForecastClient(subscriptionID string) ForecastClient { - return NewForecastClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewForecastClientWithBaseURI creates an instance of the ForecastClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewForecastClientWithBaseURI(baseURI string, subscriptionID string) ForecastClient { - return ForecastClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ExternalCloudProviderUsage lists the forecast charges for external cloud provider type defined. -// Parameters: -// externalCloudProviderType - the external cloud provider type associated with dimension/query operations. -// This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated -// account. -// externalCloudProviderID - this can be '{externalSubscriptionId}' for linked account or -// '{externalBillingAccountId}' for consolidated account used with dimension/query operations. -// parameters - parameters supplied to the CreateOrUpdate Forecast Config operation. -// filter - may be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or -// properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support -// 'ne', 'or', or 'not'. -func (client ForecastClient) ExternalCloudProviderUsage(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters ForecastDefinition, filter string) (result QueryResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ForecastClient.ExternalCloudProviderUsage") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TimePeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.Dataset", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Or", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - {Target: "parameters.Dataset.Filter.Tag", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.ForecastClient", "ExternalCloudProviderUsage", err.Error()) - } - - req, err := client.ExternalCloudProviderUsagePreparer(ctx, externalCloudProviderType, externalCloudProviderID, parameters, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ForecastClient", "ExternalCloudProviderUsage", nil, "Failure preparing request") - return - } - - resp, err := client.ExternalCloudProviderUsageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ForecastClient", "ExternalCloudProviderUsage", resp, "Failure sending request") - return - } - - result, err = client.ExternalCloudProviderUsageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ForecastClient", "ExternalCloudProviderUsage", resp, "Failure responding to request") - return - } - - return -} - -// ExternalCloudProviderUsagePreparer prepares the ExternalCloudProviderUsage request. -func (client ForecastClient) ExternalCloudProviderUsagePreparer(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters ForecastDefinition, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "externalCloudProviderId": autorest.Encode("path", externalCloudProviderID), - "externalCloudProviderType": autorest.Encode("path", externalCloudProviderType), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExternalCloudProviderUsageSender sends the ExternalCloudProviderUsage request. The method will close the -// http.Response Body if it receives an error. -func (client ForecastClient) ExternalCloudProviderUsageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ExternalCloudProviderUsageResponder handles the response to the ExternalCloudProviderUsage request. The method always -// closes the http.Response Body. -func (client ForecastClient) ExternalCloudProviderUsageResponder(resp *http.Response) (result QueryResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Usage lists the forecast charges for scope defined. -// Parameters: -// scope - the scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for -// subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// parameters - parameters supplied to the CreateOrUpdate Forecast Config operation. -// filter - may be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or -// properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support -// 'ne', 'or', or 'not'. -func (client ForecastClient) Usage(ctx context.Context, scope string, parameters ForecastDefinition, filter string) (result QueryResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ForecastClient.Usage") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TimePeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.Dataset", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Or", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - {Target: "parameters.Dataset.Filter.Tag", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.ForecastClient", "Usage", err.Error()) - } - - req, err := client.UsagePreparer(ctx, scope, parameters, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ForecastClient", "Usage", nil, "Failure preparing request") - return - } - - resp, err := client.UsageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ForecastClient", "Usage", resp, "Failure sending request") - return - } - - result, err = client.UsageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ForecastClient", "Usage", resp, "Failure responding to request") - return - } - - return -} - -// UsagePreparer prepares the Usage request. -func (client ForecastClient) UsagePreparer(ctx context.Context, scope string, parameters ForecastDefinition, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/forecast", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UsageSender sends the Usage request. The method will close the -// http.Response Body if it receives an error. -func (client ForecastClient) UsageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UsageResponder handles the response to the Usage request. The method always -// closes the http.Response Body. -func (client ForecastClient) UsageResponder(resp *http.Response) (result QueryResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/models.go deleted file mode 100644 index c7d565ccb0654..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/models.go +++ /dev/null @@ -1,1773 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "github.com/shopspring/decimal" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement" - -// Alert an individual alert. -type Alert struct { - autorest.Response `json:"-"` - *AlertProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Tags - READ-ONLY; Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Alert. -func (a Alert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.AlertProperties != nil { - objectMap["properties"] = a.AlertProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Alert struct. -func (a *Alert) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var alertProperties AlertProperties - err = json.Unmarshal(*v, &alertProperties) - if err != nil { - return err - } - a.AlertProperties = &alertProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - a.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - a.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - a.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags - } - } - } - - return nil -} - -// AlertProperties ... -type AlertProperties struct { - // Definition - defines the type of alert - Definition *AlertPropertiesDefinition `json:"definition,omitempty"` - // Description - Alert description - Description *string `json:"description,omitempty"` - // Source - Source of alert. Possible values include: 'Preset', 'User' - Source AlertSource `json:"source,omitempty"` - // Details - Alert details - Details *AlertPropertiesDetails `json:"details,omitempty"` - // CostEntityID - related budget - CostEntityID *string `json:"costEntityId,omitempty"` - // Status - alert status. Possible values include: 'AlertStatusNone', 'AlertStatusActive', 'AlertStatusOverridden', 'AlertStatusResolved', 'AlertStatusDismissed' - Status AlertStatus `json:"status,omitempty"` - // CreationTime - dateTime in which alert was created - CreationTime *string `json:"creationTime,omitempty"` - // CloseTime - dateTime in which alert was closed - CloseTime *string `json:"closeTime,omitempty"` - // ModificationTime - dateTime in which alert was last modified - ModificationTime *string `json:"modificationTime,omitempty"` - StatusModificationUserName *string `json:"statusModificationUserName,omitempty"` - // StatusModificationTime - dateTime in which the alert status was last modified - StatusModificationTime *string `json:"statusModificationTime,omitempty"` -} - -// AlertPropertiesDefinition defines the type of alert -type AlertPropertiesDefinition struct { - // Type - type of alert. Possible values include: 'Budget', 'Invoice', 'Credit', 'Quota', 'General', 'XCloud', 'BudgetForecast' - Type AlertType `json:"type,omitempty"` - // Category - Alert category. Possible values include: 'Cost', 'Usage', 'Billing', 'System' - Category AlertCategory `json:"category,omitempty"` - // Criteria - Criteria that triggered alert. Possible values include: 'CostThresholdExceeded', 'UsageThresholdExceeded', 'CreditThresholdApproaching', 'CreditThresholdReached', 'QuotaThresholdApproaching', 'QuotaThresholdReached', 'MultiCurrency', 'ForecastCostThresholdExceeded', 'ForecastUsageThresholdExceeded', 'InvoiceDueDateApproaching', 'InvoiceDueDateReached', 'CrossCloudNewDataAvailable', 'CrossCloudCollectionError', 'GeneralThresholdError' - Criteria AlertCriteria `json:"criteria,omitempty"` -} - -// AlertPropertiesDetails alert details -type AlertPropertiesDetails struct { - // TimeGrainType - Type of timegrain cadence. Possible values include: 'AlertTimeGrainTypeNone', 'AlertTimeGrainTypeMonthly', 'AlertTimeGrainTypeQuarterly', 'AlertTimeGrainTypeAnnually', 'AlertTimeGrainTypeBillingMonth', 'AlertTimeGrainTypeBillingQuarter', 'AlertTimeGrainTypeBillingAnnual' - TimeGrainType AlertTimeGrainType `json:"timeGrainType,omitempty"` - // PeriodStartDate - datetime of periodStartDate - PeriodStartDate *string `json:"periodStartDate,omitempty"` - // TriggeredBy - notificationId that triggered this alert - TriggeredBy *string `json:"triggeredBy,omitempty"` - // ResourceGroupFilter - array of resourceGroups to filter by - ResourceGroupFilter *[]interface{} `json:"resourceGroupFilter,omitempty"` - // ResourceFilter - array of resources to filter by - ResourceFilter *[]interface{} `json:"resourceFilter,omitempty"` - // MeterFilter - array of meters to filter by - MeterFilter *[]interface{} `json:"meterFilter,omitempty"` - // TagFilter - tags to filter by - TagFilter interface{} `json:"tagFilter,omitempty"` - // Threshold - notification threshold percentage as a decimal which activated this alert - Threshold *decimal.Decimal `json:"threshold,omitempty"` - // Operator - operator used to compare currentSpend with amount. Possible values include: 'None', 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo', 'LessThan', 'LessThanOrEqualTo' - Operator AlertOperator `json:"operator,omitempty"` - // Amount - budget threshold amount - Amount *decimal.Decimal `json:"amount,omitempty"` - // Unit - unit of currency being used - Unit *string `json:"unit,omitempty"` - // CurrentSpend - current spend - CurrentSpend *decimal.Decimal `json:"currentSpend,omitempty"` - // ContactEmails - list of emails to contact - ContactEmails *[]string `json:"contactEmails,omitempty"` - // ContactGroups - list of action groups to broadcast to - ContactGroups *[]string `json:"contactGroups,omitempty"` - // ContactRoles - list of contact roles - ContactRoles *[]string `json:"contactRoles,omitempty"` - // OverridingAlert - overriding alert - OverridingAlert *string `json:"overridingAlert,omitempty"` -} - -// AlertsResult result of alerts. -type AlertsResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List of alerts. - Value *[]Alert `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of alerts results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AlertsResult. -func (ar AlertsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CommonExportProperties the common properties of the export. -type CommonExportProperties struct { - // Format - The format of the export being delivered. Currently only 'Csv' is supported. Possible values include: 'Csv' - Format FormatType `json:"format,omitempty"` - // DeliveryInfo - Has delivery information for the export. - DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` - // Definition - Has the definition for the export. - Definition *ExportDefinition `json:"definition,omitempty"` - // RunHistory - If requested, has the most recent execution history for the export. - RunHistory *ExportExecutionListResult `json:"runHistory,omitempty"` - // NextRunTimeEstimate - READ-ONLY; If the export has an active schedule, provides an estimate of the next execution time. - NextRunTimeEstimate *date.Time `json:"nextRunTimeEstimate,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommonExportProperties. -func (cep CommonExportProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cep.Format != "" { - objectMap["format"] = cep.Format - } - if cep.DeliveryInfo != nil { - objectMap["deliveryInfo"] = cep.DeliveryInfo - } - if cep.Definition != nil { - objectMap["definition"] = cep.Definition - } - if cep.RunHistory != nil { - objectMap["runHistory"] = cep.RunHistory - } - return json.Marshal(objectMap) -} - -// Dimension ... -type Dimension struct { - *DimensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Tags - READ-ONLY; Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Dimension. -func (d Dimension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.DimensionProperties != nil { - objectMap["properties"] = d.DimensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Dimension struct. -func (d *Dimension) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dimensionProperties DimensionProperties - err = json.Unmarshal(*v, &dimensionProperties) - if err != nil { - return err - } - d.DimensionProperties = &dimensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - d.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - d.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - d.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - d.Tags = tags - } - } - } - - return nil -} - -// DimensionProperties ... -type DimensionProperties struct { - // Description - READ-ONLY; Dimension description. - Description *string `json:"description,omitempty"` - // FilterEnabled - READ-ONLY; Filter enabled. - FilterEnabled *bool `json:"filterEnabled,omitempty"` - // GroupingEnabled - READ-ONLY; Grouping enabled. - GroupingEnabled *bool `json:"groupingEnabled,omitempty"` - Data *[]string `json:"data,omitempty"` - // Total - READ-ONLY; Total number of data for the dimension. - Total *int32 `json:"total,omitempty"` - // Category - READ-ONLY; Dimension category. - Category *string `json:"category,omitempty"` - // UsageStart - READ-ONLY; Usage start. - UsageStart *date.Time `json:"usageStart,omitempty"` - // UsageEnd - READ-ONLY; Usage end. - UsageEnd *date.Time `json:"usageEnd,omitempty"` - // NextLink - READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for DimensionProperties. -func (dp DimensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.Data != nil { - objectMap["data"] = dp.Data - } - return json.Marshal(objectMap) -} - -// DimensionsListResult result of listing dimensions. It contains a list of available dimensions. -type DimensionsListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of dimensions. - Value *[]Dimension `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for DimensionsListResult. -func (dlr DimensionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DismissAlertPayload the request payload to update an alert -type DismissAlertPayload struct { - *AlertProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for DismissAlertPayload. -func (dap DismissAlertPayload) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dap.AlertProperties != nil { - objectMap["properties"] = dap.AlertProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DismissAlertPayload struct. -func (dap *DismissAlertPayload) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var alertProperties AlertProperties - err = json.Unmarshal(*v, &alertProperties) - if err != nil { - return err - } - dap.AlertProperties = &alertProperties - } - } - } - - return nil -} - -// ErrorDetails the details of the error. -type ErrorDetails struct { - // Code - READ-ONLY; Error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Error message indicating why the operation failed. - Message *string `json:"message,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetails. -func (ed ErrorDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse error response indicates that the service is not able to process the incoming request. The -// reason is provided in the error message. -// -// Some Error responses: -// -// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the -// "x-ms-ratelimit-microsoft.consumption-retry-after" header. -// -// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time -// specified in the "Retry-After" header. -type ErrorResponse struct { - // Error - The details of the error. - Error *ErrorDetails `json:"error,omitempty"` -} - -// Export an export resource. -type Export struct { - autorest.Response `json:"-"` - *ExportProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for Export. -func (e Export) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if e.ExportProperties != nil { - objectMap["properties"] = e.ExportProperties - } - if e.ETag != nil { - objectMap["eTag"] = e.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Export struct. -func (e *Export) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var exportProperties ExportProperties - err = json.Unmarshal(*v, &exportProperties) - if err != nil { - return err - } - e.ExportProperties = &exportProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - e.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - e.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - e.Type = &typeVar - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - e.ETag = &eTag - } - } - } - - return nil -} - -// ExportDataset the definition for data in the export. -type ExportDataset struct { - // Granularity - The granularity of rows in the export. Currently only 'Daily' is supported. Possible values include: 'Daily' - Granularity GranularityType `json:"granularity,omitempty"` - // Configuration - The export dataset configuration. - Configuration *ExportDatasetConfiguration `json:"configuration,omitempty"` -} - -// ExportDatasetConfiguration the export dataset configuration. Allows columns to be selected for the -// export. If not provided then the export will include all available columns. -type ExportDatasetConfiguration struct { - // Columns - Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples). - Columns *[]string `json:"columns,omitempty"` -} - -// ExportDefinition the definition of an export. -type ExportDefinition struct { - // Type - The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. Possible values include: 'ExportTypeUsage', 'ExportTypeActualCost', 'ExportTypeAmortizedCost' - Type ExportType `json:"type,omitempty"` - // Timeframe - The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: 'TimeframeTypeMonthToDate', 'TimeframeTypeBillingMonthToDate', 'TimeframeTypeTheLastMonth', 'TimeframeTypeTheLastBillingMonth', 'TimeframeTypeWeekToDate', 'TimeframeTypeCustom' - Timeframe TimeframeType `json:"timeframe,omitempty"` - // TimePeriod - Has time period for pulling data for the export. - TimePeriod *ExportTimePeriod `json:"timePeriod,omitempty"` - // DataSet - The definition for data in the export. - DataSet *ExportDataset `json:"dataSet,omitempty"` -} - -// ExportDeliveryDestination the destination information for the delivery of the export. To allow access to -// a storage account, you must register the account's subscription with the Microsoft.CostManagementExports -// resource provider. This is required once per subscription. When creating an export in the Azure portal, -// it is done automatically, however API users need to register the subscription. For more information see -// https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services . -type ExportDeliveryDestination struct { - // ResourceID - The resource id of the storage account where exports will be delivered. - ResourceID *string `json:"resourceId,omitempty"` - // Container - The name of the container where exports will be uploaded. - Container *string `json:"container,omitempty"` - // RootFolderPath - The name of the directory where exports will be uploaded. - RootFolderPath *string `json:"rootFolderPath,omitempty"` -} - -// ExportDeliveryInfo the delivery information associated with a export. -type ExportDeliveryInfo struct { - // Destination - Has destination for the export being delivered. - Destination *ExportDeliveryDestination `json:"destination,omitempty"` -} - -// ExportExecution an export execution. -type ExportExecution struct { - *ExportExecutionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExportExecution. -func (ee ExportExecution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ee.ExportExecutionProperties != nil { - objectMap["properties"] = ee.ExportExecutionProperties - } - if ee.ETag != nil { - objectMap["eTag"] = ee.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExportExecution struct. -func (ee *ExportExecution) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var exportExecutionProperties ExportExecutionProperties - err = json.Unmarshal(*v, &exportExecutionProperties) - if err != nil { - return err - } - ee.ExportExecutionProperties = &exportExecutionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ee.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ee.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ee.Type = &typeVar - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - ee.ETag = &eTag - } - } - } - - return nil -} - -// ExportExecutionListResult result of listing the execution history of an export. -type ExportExecutionListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; A list of export executions. - Value *[]ExportExecution `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExportExecutionListResult. -func (eelr ExportExecutionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExportExecutionProperties the properties of the export execution. -type ExportExecutionProperties struct { - // ExecutionType - The type of the export execution. Possible values include: 'OnDemand', 'Scheduled' - ExecutionType ExecutionType `json:"executionType,omitempty"` - // Status - The last known status of the export execution. Possible values include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', 'NewDataNotAvailable', 'DataNotAvailable' - Status ExecutionStatus `json:"status,omitempty"` - // SubmittedBy - The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'. - SubmittedBy *string `json:"submittedBy,omitempty"` - // SubmittedTime - The time when export was queued to be executed. - SubmittedTime *date.Time `json:"submittedTime,omitempty"` - // ProcessingStartTime - The time when export was picked up to be executed. - ProcessingStartTime *date.Time `json:"processingStartTime,omitempty"` - // ProcessingEndTime - The time when the export execution finished. - ProcessingEndTime *date.Time `json:"processingEndTime,omitempty"` - // FileName - The name of the exported file. - FileName *string `json:"fileName,omitempty"` - // RunSettings - The export settings that were in effect for this execution. - RunSettings *CommonExportProperties `json:"runSettings,omitempty"` - // Error - The details of any error. - Error *ErrorDetails `json:"error,omitempty"` -} - -// ExportListResult result of listing exports. It contains a list of available exports in the scope -// provided. -type ExportListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of exports. - Value *[]Export `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExportListResult. -func (elr ExportListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExportProperties the properties of the export. -type ExportProperties struct { - // Schedule - Has schedule information for the export. - Schedule *ExportSchedule `json:"schedule,omitempty"` - // Format - The format of the export being delivered. Currently only 'Csv' is supported. Possible values include: 'Csv' - Format FormatType `json:"format,omitempty"` - // DeliveryInfo - Has delivery information for the export. - DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` - // Definition - Has the definition for the export. - Definition *ExportDefinition `json:"definition,omitempty"` - // RunHistory - If requested, has the most recent execution history for the export. - RunHistory *ExportExecutionListResult `json:"runHistory,omitempty"` - // NextRunTimeEstimate - READ-ONLY; If the export has an active schedule, provides an estimate of the next execution time. - NextRunTimeEstimate *date.Time `json:"nextRunTimeEstimate,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExportProperties. -func (ep ExportProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ep.Schedule != nil { - objectMap["schedule"] = ep.Schedule - } - if ep.Format != "" { - objectMap["format"] = ep.Format - } - if ep.DeliveryInfo != nil { - objectMap["deliveryInfo"] = ep.DeliveryInfo - } - if ep.Definition != nil { - objectMap["definition"] = ep.Definition - } - if ep.RunHistory != nil { - objectMap["runHistory"] = ep.RunHistory - } - return json.Marshal(objectMap) -} - -// ExportRecurrencePeriod the start and end date for recurrence schedule. -type ExportRecurrencePeriod struct { - // From - The start date of recurrence. - From *date.Time `json:"from,omitempty"` - // To - The end date of recurrence. - To *date.Time `json:"to,omitempty"` -} - -// ExportSchedule the schedule associated with the export. -type ExportSchedule struct { - // Status - The status of the export's schedule. If 'Inactive', the export's schedule is paused. Possible values include: 'Active', 'Inactive' - Status StatusType `json:"status,omitempty"` - // Recurrence - The schedule recurrence. Possible values include: 'RecurrenceTypeDaily', 'RecurrenceTypeWeekly', 'RecurrenceTypeMonthly', 'RecurrenceTypeAnnually' - Recurrence RecurrenceType `json:"recurrence,omitempty"` - // RecurrencePeriod - Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - RecurrencePeriod *ExportRecurrencePeriod `json:"recurrencePeriod,omitempty"` -} - -// ExportTimePeriod the date range for data in the export. This should only be specified with timeFrame set -// to 'Custom'. The maximum date range is 3 months. -type ExportTimePeriod struct { - // From - The start date for export data. - From *date.Time `json:"from,omitempty"` - // To - The end date for export data. - To *date.Time `json:"to,omitempty"` -} - -// ForecastDataset the definition of data present in the forecast. -type ForecastDataset struct { - // Granularity - The granularity of rows in the forecast. Possible values include: 'Daily' - Granularity GranularityType `json:"granularity,omitempty"` - // Configuration - Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - Configuration *QueryDatasetConfiguration `json:"configuration,omitempty"` - // Aggregation - Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses. - Aggregation map[string]*QueryAggregation `json:"aggregation"` - // Filter - Has filter expression to use in the forecast. - Filter *QueryFilter `json:"filter,omitempty"` -} - -// MarshalJSON is the custom marshaler for ForecastDataset. -func (fd ForecastDataset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fd.Granularity != "" { - objectMap["granularity"] = fd.Granularity - } - if fd.Configuration != nil { - objectMap["configuration"] = fd.Configuration - } - if fd.Aggregation != nil { - objectMap["aggregation"] = fd.Aggregation - } - if fd.Filter != nil { - objectMap["filter"] = fd.Filter - } - return json.Marshal(objectMap) -} - -// ForecastDefinition the definition of a forecast. -type ForecastDefinition struct { - // Type - The type of the forecast. Possible values include: 'ForecastTypeUsage', 'ForecastTypeActualCost', 'ForecastTypeAmortizedCost' - Type ForecastType `json:"type,omitempty"` - // Timeframe - The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. Possible values include: 'MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBillingMonth', 'WeekToDate', 'Custom' - Timeframe ForecastTimeframeType `json:"timeframe,omitempty"` - // TimePeriod - Has time period for pulling data for the forecast. - TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"` - // Dataset - Has definition for data in this forecast. - Dataset *ForecastDataset `json:"dataset,omitempty"` - // IncludeActualCost - a boolean determining if actualCost will be included - IncludeActualCost *bool `json:"includeActualCost,omitempty"` - // IncludeFreshPartialCost - a boolean determining if FreshPartialCost will be included - IncludeFreshPartialCost *bool `json:"includeFreshPartialCost,omitempty"` -} - -// KpiProperties each KPI must contain a 'type' and 'enabled' key. -type KpiProperties struct { - // Type - KPI type (Forecast, Budget). Possible values include: 'KpiTypeTypeForecast', 'KpiTypeTypeBudget' - Type KpiTypeType `json:"type,omitempty"` - // ID - ID of resource related to metric (budget). - ID *string `json:"id,omitempty"` - // Enabled - show the KPI in the UI? - Enabled *bool `json:"enabled,omitempty"` -} - -// Operation a Cost management REST API operation. -type Operation struct { - // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. - Name *string `json:"name,omitempty"` - // Display - The object that represents the operation. - Display *OperationDisplay `json:"display,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Display != nil { - objectMap["display"] = o.Display - } - return json.Marshal(objectMap) -} - -// OperationDisplay the object that represents the operation. -type OperationDisplay struct { - // Provider - READ-ONLY; Service provider: Microsoft.CostManagement. - Provider *string `json:"provider,omitempty"` - // Resource - READ-ONLY; Resource on which the operation is performed: Dimensions, Query. - Resource *string `json:"resource,omitempty"` - // Operation - READ-ONLY; Operation type: Read, write, delete, etc. - Operation *string `json:"operation,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationListResult result of listing cost management operations. It contains a list of operations and a -// URL link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List of cost management operations supported by the Microsoft.CostManagement resource provider. - Value *[]Operation `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationListResultIterator provides access to a complete listing of Operation values. -type OperationListResultIterator struct { - i int - page OperationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter OperationListResultIterator) Response() OperationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter OperationListResultIterator) Value() Operation { - if !iter.page.NotDone() { - return Operation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationListResultIterator type. -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return OperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (olr OperationListResult) IsEmpty() bool { - return olr.Value == nil || len(*olr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (olr OperationListResult) hasNextLink() bool { - return olr.NextLink != nil && len(*olr.NextLink) != 0 -} - -// operationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !olr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(olr.NextLink))) -} - -// OperationListResultPage contains a page of Operation values. -type OperationListResultPage struct { - fn func(context.Context, OperationListResult) (OperationListResult, error) - olr OperationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.olr) - if err != nil { - return err - } - page.olr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListResultPage) NotDone() bool { - return !page.olr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationListResultPage) Response() OperationListResult { - return page.olr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListResultPage) Values() []Operation { - if page.olr.IsEmpty() { - return nil - } - return *page.olr.Value -} - -// Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{ - fn: getNextPage, - olr: cur, - } -} - -// PivotProperties each pivot must contain a 'type' and 'name'. -type PivotProperties struct { - // Type - Data type to show in view. Possible values include: 'PivotTypeTypeDimension', 'PivotTypeTypeTagKey' - Type PivotTypeType `json:"type,omitempty"` - // Name - Data field to show in view. - Name *string `json:"name,omitempty"` -} - -// ProxyResource the Resource model definition. -type ProxyResource struct { - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pr.ETag != nil { - objectMap["eTag"] = pr.ETag - } - return json.Marshal(objectMap) -} - -// QueryAggregation the aggregation expression to be used in the query. -type QueryAggregation struct { - // Name - The name of the column to aggregate. - Name *string `json:"name,omitempty"` - // Function - The name of the aggregation function to use. - Function *string `json:"function,omitempty"` -} - -// QueryColumn ... -type QueryColumn struct { - // Name - The name of column. - Name *string `json:"name,omitempty"` - // Type - The type of column. - Type *string `json:"type,omitempty"` -} - -// QueryComparisonExpression the comparison expression to be used in the query. -type QueryComparisonExpression struct { - // Name - The name of the column to use in comparison. - Name *string `json:"name,omitempty"` - // Operator - The operator to use for comparison. - Operator *string `json:"operator,omitempty"` - // Values - Array of values to use for comparison - Values *[]string `json:"values,omitempty"` -} - -// QueryDataset the definition of data present in the query. -type QueryDataset struct { - // Granularity - The granularity of rows in the query. Possible values include: 'Daily' - Granularity GranularityType `json:"granularity,omitempty"` - // Configuration - Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - Configuration *QueryDatasetConfiguration `json:"configuration,omitempty"` - // Aggregation - Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - Aggregation map[string]*QueryAggregation `json:"aggregation"` - // Grouping - Array of group by expression to use in the query. Query can have up to 2 group by clauses. - Grouping *[]QueryGrouping `json:"grouping,omitempty"` - // Filter - Has filter expression to use in the query. - Filter *QueryFilter `json:"filter,omitempty"` -} - -// MarshalJSON is the custom marshaler for QueryDataset. -func (qd QueryDataset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if qd.Granularity != "" { - objectMap["granularity"] = qd.Granularity - } - if qd.Configuration != nil { - objectMap["configuration"] = qd.Configuration - } - if qd.Aggregation != nil { - objectMap["aggregation"] = qd.Aggregation - } - if qd.Grouping != nil { - objectMap["grouping"] = qd.Grouping - } - if qd.Filter != nil { - objectMap["filter"] = qd.Filter - } - return json.Marshal(objectMap) -} - -// QueryDatasetConfiguration the configuration of dataset in the query. -type QueryDatasetConfiguration struct { - // Columns - Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns. - Columns *[]string `json:"columns,omitempty"` -} - -// QueryDefinition the definition of a query. -type QueryDefinition struct { - // Type - The type of the query. Possible values include: 'ExportTypeUsage', 'ExportTypeActualCost', 'ExportTypeAmortizedCost' - Type ExportType `json:"type,omitempty"` - // Timeframe - The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: 'TimeframeTypeMonthToDate', 'TimeframeTypeBillingMonthToDate', 'TimeframeTypeTheLastMonth', 'TimeframeTypeTheLastBillingMonth', 'TimeframeTypeWeekToDate', 'TimeframeTypeCustom' - Timeframe TimeframeType `json:"timeframe,omitempty"` - // TimePeriod - Has time period for pulling data for the query. - TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"` - // Dataset - Has definition for data in this query. - Dataset *QueryDataset `json:"dataset,omitempty"` -} - -// QueryFilter the filter expression to be used in the export. -type QueryFilter struct { - // And - The logical "AND" expression. Must have at least 2 items. - And *[]QueryFilter `json:"and,omitempty"` - // Or - The logical "OR" expression. Must have at least 2 items. - Or *[]QueryFilter `json:"or,omitempty"` - // Not - The logical "NOT" expression. - Not *QueryFilter `json:"not,omitempty"` - // Dimension - Has comparison expression for a dimension - Dimension *QueryComparisonExpression `json:"dimension,omitempty"` - // Tag - Has comparison expression for a tag - Tag *QueryComparisonExpression `json:"tag,omitempty"` -} - -// QueryGrouping the group by expression to be used in the query. -type QueryGrouping struct { - // Type - Has type of the column to group. Possible values include: 'QueryColumnTypeTag', 'QueryColumnTypeDimension' - Type QueryColumnType `json:"type,omitempty"` - // Name - The name of the column to group. - Name *string `json:"name,omitempty"` -} - -// QueryProperties ... -type QueryProperties struct { - // NextLink - The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty"` - // Columns - Array of columns - Columns *[]QueryColumn `json:"columns,omitempty"` - // Rows - Array of rows - Rows *[][]interface{} `json:"rows,omitempty"` -} - -// QueryResult result of query. It contains all columns listed under groupings and aggregation. -type QueryResult struct { - autorest.Response `json:"-"` - *QueryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Tags - READ-ONLY; Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for QueryResult. -func (qr QueryResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if qr.QueryProperties != nil { - objectMap["properties"] = qr.QueryProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for QueryResult struct. -func (qr *QueryResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var queryProperties QueryProperties - err = json.Unmarshal(*v, &queryProperties) - if err != nil { - return err - } - qr.QueryProperties = &queryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - qr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - qr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - qr.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - qr.Tags = tags - } - } - } - - return nil -} - -// QueryTimePeriod the start and end date for pulling data for the query. -type QueryTimePeriod struct { - // From - The start date to pull data from. - From *date.Time `json:"from,omitempty"` - // To - The end date to pull data to. - To *date.Time `json:"to,omitempty"` -} - -// ReportConfigAggregation the aggregation expression to be used in the report. -type ReportConfigAggregation struct { - // Name - The name of the column to aggregate. - Name *string `json:"name,omitempty"` - // Function - The name of the aggregation function to use. - Function *string `json:"function,omitempty"` -} - -// ReportConfigComparisonExpression the comparison expression to be used in the report. -type ReportConfigComparisonExpression struct { - // Name - The name of the column to use in comparison. - Name *string `json:"name,omitempty"` - // Operator - The operator to use for comparison. Possible values include: 'In', 'Contains' - Operator OperatorType `json:"operator,omitempty"` - // Values - Array of values to use for comparison - Values *[]string `json:"values,omitempty"` -} - -// ReportConfigDataset the definition of data present in the report. -type ReportConfigDataset struct { - // Granularity - The granularity of rows in the report. Possible values include: 'ReportGranularityTypeDaily', 'ReportGranularityTypeMonthly' - Granularity ReportGranularityType `json:"granularity,omitempty"` - // Configuration - Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided. - Configuration *ReportConfigDatasetConfiguration `json:"configuration,omitempty"` - // Aggregation - Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses. - Aggregation map[string]*ReportConfigAggregation `json:"aggregation"` - // Grouping - Array of group by expression to use in the report. Report can have up to 2 group by clauses. - Grouping *[]ReportConfigGrouping `json:"grouping,omitempty"` - // Sorting - Array of order by expression to use in the report. - Sorting *[]ReportConfigSorting `json:"sorting,omitempty"` - // Filter - Has filter expression to use in the report. - Filter *ReportConfigFilter `json:"filter,omitempty"` -} - -// MarshalJSON is the custom marshaler for ReportConfigDataset. -func (rcd ReportConfigDataset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rcd.Granularity != "" { - objectMap["granularity"] = rcd.Granularity - } - if rcd.Configuration != nil { - objectMap["configuration"] = rcd.Configuration - } - if rcd.Aggregation != nil { - objectMap["aggregation"] = rcd.Aggregation - } - if rcd.Grouping != nil { - objectMap["grouping"] = rcd.Grouping - } - if rcd.Sorting != nil { - objectMap["sorting"] = rcd.Sorting - } - if rcd.Filter != nil { - objectMap["filter"] = rcd.Filter - } - return json.Marshal(objectMap) -} - -// ReportConfigDatasetConfiguration the configuration of dataset in the report. -type ReportConfigDatasetConfiguration struct { - // Columns - Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns. - Columns *[]string `json:"columns,omitempty"` -} - -// ReportConfigDefinition the definition of a report config. -type ReportConfigDefinition struct { - // Type - The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. - Type *string `json:"type,omitempty"` - // Timeframe - The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible values include: 'ReportTimeframeTypeWeekToDate', 'ReportTimeframeTypeMonthToDate', 'ReportTimeframeTypeYearToDate', 'ReportTimeframeTypeCustom' - Timeframe ReportTimeframeType `json:"timeframe,omitempty"` - // TimePeriod - Has time period for pulling data for the report. - TimePeriod *ReportConfigTimePeriod `json:"timePeriod,omitempty"` - // Dataset - Has definition for data in this report config. - Dataset *ReportConfigDataset `json:"dataset,omitempty"` -} - -// ReportConfigFilter the filter expression to be used in the report. -type ReportConfigFilter struct { - // And - The logical "AND" expression. Must have at least 2 items. - And *[]ReportConfigFilter `json:"and,omitempty"` - // Or - The logical "OR" expression. Must have at least 2 items. - Or *[]ReportConfigFilter `json:"or,omitempty"` - // Not - The logical "NOT" expression. - Not *ReportConfigFilter `json:"not,omitempty"` - // Dimension - Has comparison expression for a dimension - Dimension *ReportConfigComparisonExpression `json:"dimension,omitempty"` - // Tag - Has comparison expression for a tag - Tag *ReportConfigComparisonExpression `json:"tag,omitempty"` -} - -// ReportConfigGrouping the group by expression to be used in the report. -type ReportConfigGrouping struct { - // Type - Has type of the column to group. Possible values include: 'ReportConfigColumnTypeTag', 'ReportConfigColumnTypeDimension' - Type ReportConfigColumnType `json:"type,omitempty"` - // Name - The name of the column to group. This version supports subscription lowest possible grain. - Name *string `json:"name,omitempty"` -} - -// ReportConfigSorting the order by expression to be used in the report. -type ReportConfigSorting struct { - // Direction - Direction of sort. Possible values include: 'Ascending', 'Descending' - Direction Direction `json:"direction,omitempty"` - // Name - The name of the column to sort. - Name *string `json:"name,omitempty"` -} - -// ReportConfigTimePeriod the start and end date for pulling data for the report. -type ReportConfigTimePeriod struct { - // From - The start date to pull data from. - From *date.Time `json:"from,omitempty"` - // To - The end date to pull data to. - To *date.Time `json:"to,omitempty"` -} - -// Resource the Resource model definition. -type Resource struct { - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Tags - READ-ONLY; Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// View states and configurations of Cost Analysis. -type View struct { - autorest.Response `json:"-"` - *ViewProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for View. -func (vVar View) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vVar.ViewProperties != nil { - objectMap["properties"] = vVar.ViewProperties - } - if vVar.ETag != nil { - objectMap["eTag"] = vVar.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for View struct. -func (vVar *View) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var viewProperties ViewProperties - err = json.Unmarshal(*v, &viewProperties) - if err != nil { - return err - } - vVar.ViewProperties = &viewProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vVar.Type = &typeVar - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - vVar.ETag = &eTag - } - } - } - - return nil -} - -// ViewListResult result of listing views. It contains a list of available views. -type ViewListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of views. - Value *[]View `json:"value,omitempty"` - // NextLink - READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ViewListResult. -func (vlr ViewListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ViewListResultIterator provides access to a complete listing of View values. -type ViewListResultIterator struct { - i int - page ViewListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ViewListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ViewListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ViewListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ViewListResultIterator) Response() ViewListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ViewListResultIterator) Value() View { - if !iter.page.NotDone() { - return View{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ViewListResultIterator type. -func NewViewListResultIterator(page ViewListResultPage) ViewListResultIterator { - return ViewListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vlr ViewListResult) IsEmpty() bool { - return vlr.Value == nil || len(*vlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vlr ViewListResult) hasNextLink() bool { - return vlr.NextLink != nil && len(*vlr.NextLink) != 0 -} - -// viewListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vlr ViewListResult) viewListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vlr.NextLink))) -} - -// ViewListResultPage contains a page of View values. -type ViewListResultPage struct { - fn func(context.Context, ViewListResult) (ViewListResult, error) - vlr ViewListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ViewListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vlr) - if err != nil { - return err - } - page.vlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ViewListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ViewListResultPage) NotDone() bool { - return !page.vlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ViewListResultPage) Response() ViewListResult { - return page.vlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ViewListResultPage) Values() []View { - if page.vlr.IsEmpty() { - return nil - } - return *page.vlr.Value -} - -// Creates a new instance of the ViewListResultPage type. -func NewViewListResultPage(cur ViewListResult, getNextPage func(context.Context, ViewListResult) (ViewListResult, error)) ViewListResultPage { - return ViewListResultPage{ - fn: getNextPage, - vlr: cur, - } -} - -// ViewProperties the properties of the view. -type ViewProperties struct { - // DisplayName - User input name of the view. Required. - DisplayName *string `json:"displayName,omitempty"` - // Scope - Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope. - Scope *string `json:"scope,omitempty"` - // CreatedOn - READ-ONLY; Date the user created this view. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; Date when the user last modified this view. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ReportConfigDefinition - Query body configuration. Required. - *ReportConfigDefinition `json:"query,omitempty"` - // Chart - Chart type of the main view in Cost Analysis. Required. Possible values include: 'Area', 'Line', 'StackedColumn', 'GroupedColumn', 'Table' - Chart ChartType `json:"chart,omitempty"` - // Accumulated - Show costs accumulated over time. Possible values include: 'True', 'False' - Accumulated AccumulatedType `json:"accumulated,omitempty"` - // Metric - Metric to use when displaying costs. Possible values include: 'ActualCost', 'AmortizedCost', 'AHUB' - Metric MetricType `json:"metric,omitempty"` - // Kpis - List of KPIs to show in Cost Analysis UI. - Kpis *[]KpiProperties `json:"kpis,omitempty"` - // Pivots - Configuration of 3 sub-views in the Cost Analysis UI. - Pivots *[]PivotProperties `json:"pivots,omitempty"` -} - -// MarshalJSON is the custom marshaler for ViewProperties. -func (vp ViewProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vp.DisplayName != nil { - objectMap["displayName"] = vp.DisplayName - } - if vp.Scope != nil { - objectMap["scope"] = vp.Scope - } - if vp.ReportConfigDefinition != nil { - objectMap["query"] = vp.ReportConfigDefinition - } - if vp.Chart != "" { - objectMap["chart"] = vp.Chart - } - if vp.Accumulated != "" { - objectMap["accumulated"] = vp.Accumulated - } - if vp.Metric != "" { - objectMap["metric"] = vp.Metric - } - if vp.Kpis != nil { - objectMap["kpis"] = vp.Kpis - } - if vp.Pivots != nil { - objectMap["pivots"] = vp.Pivots - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ViewProperties struct. -func (vp *ViewProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "displayName": - if v != nil { - var displayName string - err = json.Unmarshal(*v, &displayName) - if err != nil { - return err - } - vp.DisplayName = &displayName - } - case "scope": - if v != nil { - var scope string - err = json.Unmarshal(*v, &scope) - if err != nil { - return err - } - vp.Scope = &scope - } - case "createdOn": - if v != nil { - var createdOn date.Time - err = json.Unmarshal(*v, &createdOn) - if err != nil { - return err - } - vp.CreatedOn = &createdOn - } - case "modifiedOn": - if v != nil { - var modifiedOn date.Time - err = json.Unmarshal(*v, &modifiedOn) - if err != nil { - return err - } - vp.ModifiedOn = &modifiedOn - } - case "query": - if v != nil { - var reportConfigDefinition ReportConfigDefinition - err = json.Unmarshal(*v, &reportConfigDefinition) - if err != nil { - return err - } - vp.ReportConfigDefinition = &reportConfigDefinition - } - case "chart": - if v != nil { - var chart ChartType - err = json.Unmarshal(*v, &chart) - if err != nil { - return err - } - vp.Chart = chart - } - case "accumulated": - if v != nil { - var accumulated AccumulatedType - err = json.Unmarshal(*v, &accumulated) - if err != nil { - return err - } - vp.Accumulated = accumulated - } - case "metric": - if v != nil { - var metric MetricType - err = json.Unmarshal(*v, &metric) - if err != nil { - return err - } - vp.Metric = metric - } - case "kpis": - if v != nil { - var kpis []KpiProperties - err = json.Unmarshal(*v, &kpis) - if err != nil { - return err - } - vp.Kpis = &kpis - } - case "pivots": - if v != nil { - var pivots []PivotProperties - err = json.Unmarshal(*v, &pivots) - if err != nil { - return err - } - vp.Pivots = &pivots - } - } - } - - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/operations.go deleted file mode 100644 index c70a4aac3fdc7..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/operations.go +++ /dev/null @@ -1,140 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the client for the Operations methods of the Costmanagement service. -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available cost management REST API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.olr.Response.Response != nil { - sc = result.olr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.olr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.olr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.olr.hasNextLink() && result.olr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.CostManagement/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { - req, err := lastResults.operationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "costmanagement.OperationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "costmanagement.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.OperationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/query.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/query.go deleted file mode 100644 index 0b92b9093f7e9..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/query.go +++ /dev/null @@ -1,267 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// QueryClient is the client for the Query methods of the Costmanagement service. -type QueryClient struct { - BaseClient -} - -// NewQueryClient creates an instance of the QueryClient client. -func NewQueryClient(subscriptionID string) QueryClient { - return NewQueryClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewQueryClientWithBaseURI creates an instance of the QueryClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewQueryClientWithBaseURI(baseURI string, subscriptionID string) QueryClient { - return QueryClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Usage query the usage data for scope defined. -// Parameters: -// scope - the scope associated with query and export operations. This includes -// '/subscriptions/{subscriptionId}/' for subscription scope, -// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for -// Management Group scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// billingProfile scope, -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' -// for invoiceSection scope, and -// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for -// partners. -// parameters - parameters supplied to the CreateOrUpdate Query Config operation. -func (client QueryClient) Usage(ctx context.Context, scope string, parameters QueryDefinition) (result QueryResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryClient.Usage") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TimePeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.Dataset", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.MaxItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Or", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - {Target: "parameters.Dataset.Filter.Tag", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.QueryClient", "Usage", err.Error()) - } - - req, err := client.UsagePreparer(ctx, scope, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "Usage", nil, "Failure preparing request") - return - } - - resp, err := client.UsageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "Usage", resp, "Failure sending request") - return - } - - result, err = client.UsageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "Usage", resp, "Failure responding to request") - return - } - - return -} - -// UsagePreparer prepares the Usage request. -func (client QueryClient) UsagePreparer(ctx context.Context, scope string, parameters QueryDefinition) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/query", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UsageSender sends the Usage request. The method will close the -// http.Response Body if it receives an error. -func (client QueryClient) UsageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UsageResponder handles the response to the Usage request. The method always -// closes the http.Response Body. -func (client QueryClient) UsageResponder(resp *http.Response) (result QueryResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UsageByExternalCloudProviderType query the usage data for external cloud provider type defined. -// Parameters: -// externalCloudProviderType - the external cloud provider type associated with dimension/query operations. -// This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated -// account. -// externalCloudProviderID - this can be '{externalSubscriptionId}' for linked account or -// '{externalBillingAccountId}' for consolidated account used with dimension/query operations. -// parameters - parameters supplied to the CreateOrUpdate Query Config operation. -func (client QueryClient) UsageByExternalCloudProviderType(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters QueryDefinition) (result QueryResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryClient.UsageByExternalCloudProviderType") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TimePeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.Dataset", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Grouping", Name: validation.MaxItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Or", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - {Target: "parameters.Dataset.Filter.Tag", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Operator", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.QueryClient", "UsageByExternalCloudProviderType", err.Error()) - } - - req, err := client.UsageByExternalCloudProviderTypePreparer(ctx, externalCloudProviderType, externalCloudProviderID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "UsageByExternalCloudProviderType", nil, "Failure preparing request") - return - } - - resp, err := client.UsageByExternalCloudProviderTypeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "UsageByExternalCloudProviderType", resp, "Failure sending request") - return - } - - result, err = client.UsageByExternalCloudProviderTypeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.QueryClient", "UsageByExternalCloudProviderType", resp, "Failure responding to request") - return - } - - return -} - -// UsageByExternalCloudProviderTypePreparer prepares the UsageByExternalCloudProviderType request. -func (client QueryClient) UsageByExternalCloudProviderTypePreparer(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters QueryDefinition) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "externalCloudProviderId": autorest.Encode("path", externalCloudProviderID), - "externalCloudProviderType": autorest.Encode("path", externalCloudProviderType), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UsageByExternalCloudProviderTypeSender sends the UsageByExternalCloudProviderType request. The method will close the -// http.Response Body if it receives an error. -func (client QueryClient) UsageByExternalCloudProviderTypeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UsageByExternalCloudProviderTypeResponder handles the response to the UsageByExternalCloudProviderType request. The method always -// closes the http.Response Body. -func (client QueryClient) UsageByExternalCloudProviderTypeResponder(resp *http.Response) (result QueryResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/version.go deleted file mode 100644 index 73ddda88b113e..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package costmanagement - -import "github.com/Azure/azure-sdk-for-go/version" - -// 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. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " costmanagement/2020-06-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/views.go b/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/views.go deleted file mode 100644 index 0d02fc01e558a..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement/views.go +++ /dev/null @@ -1,832 +0,0 @@ -package costmanagement - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ViewsClient is the client for the Views methods of the Costmanagement service. -type ViewsClient struct { - BaseClient -} - -// NewViewsClient creates an instance of the ViewsClient client. -func NewViewsClient(subscriptionID string) ViewsClient { - return NewViewsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewViewsClientWithBaseURI creates an instance of the ViewsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewViewsClientWithBaseURI(baseURI string, subscriptionID string) ViewsClient { - return ViewsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update a view. Update operation requires latest eTag to be set in the -// request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -// Parameters: -// viewName - view name -// parameters - parameters supplied to the CreateOrUpdate View operation. -func (client ViewsClient) CreateOrUpdate(ctx context.Context, viewName string, parameters View) (result View, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ViewProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Type", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.TimePeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Grouping", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Grouping", Name: validation.MaxItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.And", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Or", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.ViewsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, viewName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ViewsClient) CreateOrUpdatePreparer(ctx context.Context, viewName string, parameters View) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "viewName": autorest.Encode("path", viewName), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.CostManagement/views/{viewName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ViewsClient) CreateOrUpdateResponder(resp *http.Response) (result View, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdateByScope the operation to create or update a view. Update operation requires latest eTag to be set in -// the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -// Parameters: -// scope - the scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for -// subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// BillingProfile scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for -// InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management -// Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for -// External Billing Account scope and -// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External -// Subscription scope. -// viewName - view name -// parameters - parameters supplied to the CreateOrUpdate View operation. -func (client ViewsClient) CreateOrUpdateByScope(ctx context.Context, scope string, viewName string, parameters View) (result View, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.CreateOrUpdateByScope") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ViewProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Type", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.TimePeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.TimePeriod.From", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.TimePeriod.To", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Grouping", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Grouping", Name: validation.MaxItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.And", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.And", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Or", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Or", Name: validation.MinItems, Rule: 2, Chain: nil}}}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Not", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Dimension.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag.Values", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ViewProperties.ReportConfigDefinition.Dataset.Filter.Tag.Values", Name: validation.MinItems, Rule: 1, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("costmanagement.ViewsClient", "CreateOrUpdateByScope", err.Error()) - } - - req, err := client.CreateOrUpdateByScopePreparer(ctx, scope, viewName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "CreateOrUpdateByScope", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateByScopeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "CreateOrUpdateByScope", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateByScopeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "CreateOrUpdateByScope", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdateByScopePreparer prepares the CreateOrUpdateByScope request. -func (client ViewsClient) CreateOrUpdateByScopePreparer(ctx context.Context, scope string, viewName string, parameters View) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": autorest.Encode("path", scope), - "viewName": autorest.Encode("path", viewName), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/views/{viewName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateByScopeSender sends the CreateOrUpdateByScope request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) CreateOrUpdateByScopeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateByScopeResponder handles the response to the CreateOrUpdateByScope request. The method always -// closes the http.Response Body. -func (client ViewsClient) CreateOrUpdateByScopeResponder(resp *http.Response) (result View, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete a view. -// Parameters: -// viewName - view name -func (client ViewsClient) Delete(ctx context.Context, viewName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, viewName) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ViewsClient) DeletePreparer(ctx context.Context, viewName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "viewName": autorest.Encode("path", viewName), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.CostManagement/views/{viewName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ViewsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteByScope the operation to delete a view. -// Parameters: -// scope - the scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for -// subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// BillingProfile scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for -// InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management -// Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for -// External Billing Account scope and -// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External -// Subscription scope. -// viewName - view name -func (client ViewsClient) DeleteByScope(ctx context.Context, scope string, viewName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.DeleteByScope") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeleteByScopePreparer(ctx, scope, viewName) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "DeleteByScope", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteByScopeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "DeleteByScope", resp, "Failure sending request") - return - } - - result, err = client.DeleteByScopeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "DeleteByScope", resp, "Failure responding to request") - return - } - - return -} - -// DeleteByScopePreparer prepares the DeleteByScope request. -func (client ViewsClient) DeleteByScopePreparer(ctx context.Context, scope string, viewName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": autorest.Encode("path", scope), - "viewName": autorest.Encode("path", viewName), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/views/{viewName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteByScopeSender sends the DeleteByScope request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) DeleteByScopeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteByScopeResponder handles the response to the DeleteByScope request. The method always -// closes the http.Response Body. -func (client ViewsClient) DeleteByScopeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the view by view name. -// Parameters: -// viewName - view name -func (client ViewsClient) Get(ctx context.Context, viewName string) (result View, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, viewName) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ViewsClient) GetPreparer(ctx context.Context, viewName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "viewName": autorest.Encode("path", viewName), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.CostManagement/views/{viewName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ViewsClient) GetResponder(resp *http.Response) (result View, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByScope gets the view for the defined scope by view name. -// Parameters: -// scope - the scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for -// subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// BillingProfile scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for -// InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management -// Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for -// External Billing Account scope and -// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External -// Subscription scope. -// viewName - view name -func (client ViewsClient) GetByScope(ctx context.Context, scope string, viewName string) (result View, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.GetByScope") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetByScopePreparer(ctx, scope, viewName) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "GetByScope", nil, "Failure preparing request") - return - } - - resp, err := client.GetByScopeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "GetByScope", resp, "Failure sending request") - return - } - - result, err = client.GetByScopeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "GetByScope", resp, "Failure responding to request") - return - } - - return -} - -// GetByScopePreparer prepares the GetByScope request. -func (client ViewsClient) GetByScopePreparer(ctx context.Context, scope string, viewName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": autorest.Encode("path", scope), - "viewName": autorest.Encode("path", viewName), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/views/{viewName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByScopeSender sends the GetByScope request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) GetByScopeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetByScopeResponder handles the response to the GetByScope request. The method always -// closes the http.Response Body. -func (client ViewsClient) GetByScopeResponder(resp *http.Response) (result View, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all views by tenant and object. -func (client ViewsClient) List(ctx context.Context) (result ViewListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.List") - defer func() { - sc := -1 - if result.vlr.Response.Response != nil { - sc = result.vlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "List", resp, "Failure sending request") - return - } - - result.vlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "List", resp, "Failure responding to request") - return - } - if result.vlr.hasNextLink() && result.vlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ViewsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.CostManagement/views"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ViewsClient) ListResponder(resp *http.Response) (result ViewListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ViewsClient) listNextResults(ctx context.Context, lastResults ViewListResult) (result ViewListResult, err error) { - req, err := lastResults.viewListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ViewsClient) ListComplete(ctx context.Context) (result ViewListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByScope lists all views at the given scope. -// Parameters: -// scope - the scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for -// subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup -// scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department -// scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' -// for EnrollmentAccount scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for -// BillingProfile scope, -// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for -// InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management -// Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for -// External Billing Account scope and -// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External -// Subscription scope. -func (client ViewsClient) ListByScope(ctx context.Context, scope string) (result ViewListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.ListByScope") - defer func() { - sc := -1 - if result.vlr.Response.Response != nil { - sc = result.vlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByScopeNextResults - req, err := client.ListByScopePreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "ListByScope", nil, "Failure preparing request") - return - } - - resp, err := client.ListByScopeSender(req) - if err != nil { - result.vlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "ListByScope", resp, "Failure sending request") - return - } - - result.vlr, err = client.ListByScopeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "ListByScope", resp, "Failure responding to request") - return - } - if result.vlr.hasNextLink() && result.vlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByScopePreparer prepares the ListByScope request. -func (client ViewsClient) ListByScopePreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": autorest.Encode("path", scope), - } - - const APIVersion = "2020-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.CostManagement/views", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByScopeSender sends the ListByScope request. The method will close the -// http.Response Body if it receives an error. -func (client ViewsClient) ListByScopeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListByScopeResponder handles the response to the ListByScope request. The method always -// closes the http.Response Body. -func (client ViewsClient) ListByScopeResponder(resp *http.Response) (result ViewListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByScopeNextResults retrieves the next set of results, if any. -func (client ViewsClient) listByScopeNextResults(ctx context.Context, lastResults ViewListResult) (result ViewListResult, err error) { - req, err := lastResults.viewListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "listByScopeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByScopeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "listByScopeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByScopeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "costmanagement.ViewsClient", "listByScopeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByScopeComplete enumerates all values, automatically crossing page boundaries as required. -func (client ViewsClient) ListByScopeComplete(ctx context.Context, scope string) (result ViewListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ViewsClient.ListByScope") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByScope(ctx, scope) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4c..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/_meta.json deleted file mode 100644 index d12ba48ee2665..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/mariadb/resource-manager/readme.md", - "tag": "package-2018-06-01", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2018-06-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/mariadb/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/advisors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/advisors.go deleted file mode 100644 index 16f9345aa28d7..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/advisors.go +++ /dev/null @@ -1,250 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AdvisorsClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and configurations with -// new business model. -type AdvisorsClient struct { - BaseClient -} - -// NewAdvisorsClient creates an instance of the AdvisorsClient client. -func NewAdvisorsClient(subscriptionID string) AdvisorsClient { - return NewAdvisorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAdvisorsClientWithBaseURI creates an instance of the AdvisorsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAdvisorsClientWithBaseURI(baseURI string, subscriptionID string) AdvisorsClient { - return AdvisorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a recommendation action advisor. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// advisorName - the advisor name for recommendation action. -func (client AdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string) (result Advisor, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.AdvisorsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, advisorName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AdvisorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, advisorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "advisorName": autorest.Encode("path", advisorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AdvisorsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AdvisorsClient) GetResponder(resp *http.Response) (result Advisor, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer list recommendation action advisors. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client AdvisorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result AdvisorsResultListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsClient.ListByServer") - defer func() { - sc := -1 - if result.arl.Response.Response != nil { - sc = result.arl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.AdvisorsClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.arl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.arl, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.arl.hasNextLink() && result.arl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client AdvisorsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client AdvisorsClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client AdvisorsClient) ListByServerResponder(resp *http.Response) (result AdvisorsResultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client AdvisorsClient) listByServerNextResults(ctx context.Context, lastResults AdvisorsResultList) (result AdvisorsResultList, err error) { - req, err := lastResults.advisorsResultListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.AdvisorsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client AdvisorsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result AdvisorsResultListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/checknameavailability.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/checknameavailability.go deleted file mode 100644 index ad22179861674..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/checknameavailability.go +++ /dev/null @@ -1,118 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CheckNameAvailabilityClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type CheckNameAvailabilityClient struct { - BaseClient -} - -// NewCheckNameAvailabilityClient creates an instance of the CheckNameAvailabilityClient client. -func NewCheckNameAvailabilityClient(subscriptionID string) CheckNameAvailabilityClient { - return NewCheckNameAvailabilityClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCheckNameAvailabilityClientWithBaseURI creates an instance of the CheckNameAvailabilityClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewCheckNameAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) CheckNameAvailabilityClient { - return CheckNameAvailabilityClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Execute check the availability of name for resource -// Parameters: -// nameAvailabilityRequest - the required parameters for checking if resource name is available. -func (client CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest) (result NameAvailability, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CheckNameAvailabilityClient.Execute") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: nameAvailabilityRequest, - Constraints: []validation.Constraint{{Target: "nameAvailabilityRequest.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.CheckNameAvailabilityClient", "Execute", err.Error()) - } - - req, err := client.ExecutePreparer(ctx, nameAvailabilityRequest) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.CheckNameAvailabilityClient", "Execute", nil, "Failure preparing request") - return - } - - resp, err := client.ExecuteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.CheckNameAvailabilityClient", "Execute", resp, "Failure sending request") - return - } - - result, err = client.ExecuteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.CheckNameAvailabilityClient", "Execute", resp, "Failure responding to request") - return - } - - return -} - -// ExecutePreparer prepares the Execute request. -func (client CheckNameAvailabilityClient) ExecutePreparer(ctx context.Context, nameAvailabilityRequest NameAvailabilityRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForMariaDB/checkNameAvailability", pathParameters), - autorest.WithJSON(nameAvailabilityRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExecuteSender sends the Execute request. The method will close the -// http.Response Body if it receives an error. -func (client CheckNameAvailabilityClient) ExecuteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ExecuteResponder handles the response to the Execute request. The method always -// closes the http.Response Body. -func (client CheckNameAvailabilityClient) ExecuteResponder(resp *http.Response) (result NameAvailability, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/client.go deleted file mode 100644 index b4d263e8cfc49..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/client.go +++ /dev/null @@ -1,140 +0,0 @@ -// Package mariadb implements the Azure ARM Mariadb service API version 2018-06-01. -// -// The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MariaDB -// resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business -// model. -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -const ( - // DefaultBaseURI is the default URI used for the service Mariadb - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Mariadb. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} - -// CreateRecommendedActionSession create recommendation action session for the advisor. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// advisorName - the advisor name for recommendation action. -// databaseName - the name of the database. -func (client BaseClient) CreateRecommendedActionSession(ctx context.Context, resourceGroupName string, serverName string, advisorName string, databaseName string) (result CreateRecommendedActionSessionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateRecommendedActionSession") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.BaseClient", "CreateRecommendedActionSession", err.Error()) - } - - req, err := client.CreateRecommendedActionSessionPreparer(ctx, resourceGroupName, serverName, advisorName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.BaseClient", "CreateRecommendedActionSession", nil, "Failure preparing request") - return - } - - result, err = client.CreateRecommendedActionSessionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.BaseClient", "CreateRecommendedActionSession", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateRecommendedActionSessionPreparer prepares the CreateRecommendedActionSession request. -func (client BaseClient) CreateRecommendedActionSessionPreparer(ctx context.Context, resourceGroupName string, serverName string, advisorName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "advisorName": autorest.Encode("path", advisorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "databaseName": autorest.Encode("query", databaseName), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/createRecommendedActionSession", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateRecommendedActionSessionSender sends the CreateRecommendedActionSession request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) CreateRecommendedActionSessionSender(req *http.Request) (future CreateRecommendedActionSessionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateRecommendedActionSessionResponder handles the response to the CreateRecommendedActionSession request. The method always -// closes the http.Response Body. -func (client BaseClient) CreateRecommendedActionSessionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/configurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/configurations.go deleted file mode 100644 index b694af5930fa8..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/configurations.go +++ /dev/null @@ -1,302 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConfigurationsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type ConfigurationsClient struct { - BaseClient -} - -// NewConfigurationsClient creates an instance of the ConfigurationsClient client. -func NewConfigurationsClient(subscriptionID string) ConfigurationsClient { - return NewConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConfigurationsClientWithBaseURI creates an instance of the ConfigurationsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationsClient { - return ConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate updates a configuration of a server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// configurationName - the name of the server configuration. -// parameters - the required parameters for updating a server configuration. -func (client ConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration) (result ConfigurationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ConfigurationsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, configurationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/configurations/{configurationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future ConfigurationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result Configuration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets information about a configuration of server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// configurationName - the name of the server configuration. -func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, configurationName string) (result Configuration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ConfigurationsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/configurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ConfigurationsClient) GetResponder(resp *http.Response) (result Configuration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer list all the configurations in a given server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client ConfigurationsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ConfigurationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationsClient.ListByServer") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ConfigurationsClient", "ListByServer", err.Error()) - } - - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "ListByServer", resp, "Failure sending request") - return - } - - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsClient", "ListByServer", resp, "Failure responding to request") - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client ConfigurationsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/configurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client ConfigurationsClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client ConfigurationsClient) ListByServerResponder(resp *http.Response) (result ConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/databases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/databases.go deleted file mode 100644 index a913836a84771..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/databases.go +++ /dev/null @@ -1,392 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DatabasesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and configurations -// with new business model. -type DatabasesClient struct { - BaseClient -} - -// NewDatabasesClient creates an instance of the DatabasesClient client. -func NewDatabasesClient(subscriptionID string) DatabasesClient { - return NewDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDatabasesClientWithBaseURI creates an instance of the DatabasesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { - return DatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new database or updates an existing database. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// databaseName - the name of the database. -// parameters - the required parameters for creating or updating a database. -func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database) (result DatabasesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.DatabasesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (result Database, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a database. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// databaseName - the name of the database. -func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.DatabasesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DatabasesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a database. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// databaseName - the name of the database. -func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result Database, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.DatabasesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DatabasesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "databaseName": autorest.Encode("path", databaseName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DatabasesClient) GetResponder(resp *http.Response) (result Database, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer list all the databases in a given server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client DatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result DatabaseListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListByServer") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.DatabasesClient", "ListByServer", err.Error()) - } - - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "ListByServer", resp, "Failure sending request") - return - } - - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesClient", "ListByServer", resp, "Failure responding to request") - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client DatabasesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client DatabasesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client DatabasesClient) ListByServerResponder(resp *http.Response) (result DatabaseListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/enums.go deleted file mode 100644 index e7858d2d7c9ef..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/enums.go +++ /dev/null @@ -1,245 +0,0 @@ -package mariadb - -// 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. - -// CreateMode enumerates the values for create mode. -type CreateMode string - -const ( - // CreateModeDefault ... - CreateModeDefault CreateMode = "Default" - // CreateModeGeoRestore ... - CreateModeGeoRestore CreateMode = "GeoRestore" - // CreateModePointInTimeRestore ... - CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" - // CreateModeReplica ... - CreateModeReplica CreateMode = "Replica" - // CreateModeServerPropertiesForCreate ... - CreateModeServerPropertiesForCreate CreateMode = "ServerPropertiesForCreate" -) - -// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. -func PossibleCreateModeValues() []CreateMode { - return []CreateMode{CreateModeDefault, CreateModeGeoRestore, CreateModePointInTimeRestore, CreateModeReplica, CreateModeServerPropertiesForCreate} -} - -// GeoRedundantBackup enumerates the values for geo redundant backup. -type GeoRedundantBackup string - -const ( - // Disabled ... - Disabled GeoRedundantBackup = "Disabled" - // Enabled ... - Enabled GeoRedundantBackup = "Enabled" -) - -// PossibleGeoRedundantBackupValues returns an array of possible values for the GeoRedundantBackup const type. -func PossibleGeoRedundantBackupValues() []GeoRedundantBackup { - return []GeoRedundantBackup{Disabled, Enabled} -} - -// OperationOrigin enumerates the values for operation origin. -type OperationOrigin string - -const ( - // NotSpecified ... - NotSpecified OperationOrigin = "NotSpecified" - // System ... - System OperationOrigin = "system" - // User ... - User OperationOrigin = "user" -) - -// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. -func PossibleOperationOriginValues() []OperationOrigin { - return []OperationOrigin{NotSpecified, System, User} -} - -// PrivateEndpointProvisioningState enumerates the values for private endpoint provisioning state. -type PrivateEndpointProvisioningState string - -const ( - // Approving ... - Approving PrivateEndpointProvisioningState = "Approving" - // Dropping ... - Dropping PrivateEndpointProvisioningState = "Dropping" - // Failed ... - Failed PrivateEndpointProvisioningState = "Failed" - // Ready ... - Ready PrivateEndpointProvisioningState = "Ready" - // Rejecting ... - Rejecting PrivateEndpointProvisioningState = "Rejecting" -) - -// PossiblePrivateEndpointProvisioningStateValues returns an array of possible values for the PrivateEndpointProvisioningState const type. -func PossiblePrivateEndpointProvisioningStateValues() []PrivateEndpointProvisioningState { - return []PrivateEndpointProvisioningState{Approving, Dropping, Failed, Ready, Rejecting} -} - -// PrivateLinkServiceConnectionStateActionsRequire enumerates the values for private link service connection -// state actions require. -type PrivateLinkServiceConnectionStateActionsRequire string - -const ( - // None ... - None PrivateLinkServiceConnectionStateActionsRequire = "None" -) - -// PossiblePrivateLinkServiceConnectionStateActionsRequireValues returns an array of possible values for the PrivateLinkServiceConnectionStateActionsRequire const type. -func PossiblePrivateLinkServiceConnectionStateActionsRequireValues() []PrivateLinkServiceConnectionStateActionsRequire { - return []PrivateLinkServiceConnectionStateActionsRequire{None} -} - -// PrivateLinkServiceConnectionStateStatus enumerates the values for private link service connection state -// status. -type PrivateLinkServiceConnectionStateStatus string - -const ( - // Approved ... - Approved PrivateLinkServiceConnectionStateStatus = "Approved" - // Disconnected ... - Disconnected PrivateLinkServiceConnectionStateStatus = "Disconnected" - // Pending ... - Pending PrivateLinkServiceConnectionStateStatus = "Pending" - // Rejected ... - Rejected PrivateLinkServiceConnectionStateStatus = "Rejected" -) - -// PossiblePrivateLinkServiceConnectionStateStatusValues returns an array of possible values for the PrivateLinkServiceConnectionStateStatus const type. -func PossiblePrivateLinkServiceConnectionStateStatusValues() []PrivateLinkServiceConnectionStateStatus { - return []PrivateLinkServiceConnectionStateStatus{Approved, Disconnected, Pending, Rejected} -} - -// PublicNetworkAccessEnum enumerates the values for public network access enum. -type PublicNetworkAccessEnum string - -const ( - // PublicNetworkAccessEnumDisabled ... - PublicNetworkAccessEnumDisabled PublicNetworkAccessEnum = "Disabled" - // PublicNetworkAccessEnumEnabled ... - PublicNetworkAccessEnumEnabled PublicNetworkAccessEnum = "Enabled" -) - -// PossiblePublicNetworkAccessEnumValues returns an array of possible values for the PublicNetworkAccessEnum const type. -func PossiblePublicNetworkAccessEnumValues() []PublicNetworkAccessEnum { - return []PublicNetworkAccessEnum{PublicNetworkAccessEnumDisabled, PublicNetworkAccessEnumEnabled} -} - -// ServerSecurityAlertPolicyState enumerates the values for server security alert policy state. -type ServerSecurityAlertPolicyState string - -const ( - // ServerSecurityAlertPolicyStateDisabled ... - ServerSecurityAlertPolicyStateDisabled ServerSecurityAlertPolicyState = "Disabled" - // ServerSecurityAlertPolicyStateEnabled ... - ServerSecurityAlertPolicyStateEnabled ServerSecurityAlertPolicyState = "Enabled" -) - -// PossibleServerSecurityAlertPolicyStateValues returns an array of possible values for the ServerSecurityAlertPolicyState const type. -func PossibleServerSecurityAlertPolicyStateValues() []ServerSecurityAlertPolicyState { - return []ServerSecurityAlertPolicyState{ServerSecurityAlertPolicyStateDisabled, ServerSecurityAlertPolicyStateEnabled} -} - -// ServerState enumerates the values for server state. -type ServerState string - -const ( - // ServerStateDisabled ... - ServerStateDisabled ServerState = "Disabled" - // ServerStateDropping ... - ServerStateDropping ServerState = "Dropping" - // ServerStateReady ... - ServerStateReady ServerState = "Ready" -) - -// PossibleServerStateValues returns an array of possible values for the ServerState const type. -func PossibleServerStateValues() []ServerState { - return []ServerState{ServerStateDisabled, ServerStateDropping, ServerStateReady} -} - -// ServerVersion enumerates the values for server version. -type ServerVersion string - -const ( - // FiveFullStopSeven ... - FiveFullStopSeven ServerVersion = "5.7" - // FiveFullStopSix ... - FiveFullStopSix ServerVersion = "5.6" -) - -// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. -func PossibleServerVersionValues() []ServerVersion { - return []ServerVersion{FiveFullStopSeven, FiveFullStopSix} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Basic ... - Basic SkuTier = "Basic" - // GeneralPurpose ... - GeneralPurpose SkuTier = "GeneralPurpose" - // MemoryOptimized ... - MemoryOptimized SkuTier = "MemoryOptimized" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Basic, GeneralPurpose, MemoryOptimized} -} - -// SslEnforcementEnum enumerates the values for ssl enforcement enum. -type SslEnforcementEnum string - -const ( - // SslEnforcementEnumDisabled ... - SslEnforcementEnumDisabled SslEnforcementEnum = "Disabled" - // SslEnforcementEnumEnabled ... - SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" -) - -// PossibleSslEnforcementEnumValues returns an array of possible values for the SslEnforcementEnum const type. -func PossibleSslEnforcementEnumValues() []SslEnforcementEnum { - return []SslEnforcementEnum{SslEnforcementEnumDisabled, SslEnforcementEnumEnabled} -} - -// StorageAutogrow enumerates the values for storage autogrow. -type StorageAutogrow string - -const ( - // StorageAutogrowDisabled ... - StorageAutogrowDisabled StorageAutogrow = "Disabled" - // StorageAutogrowEnabled ... - StorageAutogrowEnabled StorageAutogrow = "Enabled" -) - -// PossibleStorageAutogrowValues returns an array of possible values for the StorageAutogrow const type. -func PossibleStorageAutogrowValues() []StorageAutogrow { - return []StorageAutogrow{StorageAutogrowDisabled, StorageAutogrowEnabled} -} - -// VirtualNetworkRuleState enumerates the values for virtual network rule state. -type VirtualNetworkRuleState string - -const ( - // VirtualNetworkRuleStateDeleting ... - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" - // VirtualNetworkRuleStateInitializing ... - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" - // VirtualNetworkRuleStateInProgress ... - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" - // VirtualNetworkRuleStateReady ... - VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" - // VirtualNetworkRuleStateUnknown ... - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" -) - -// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. -func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { - return []VirtualNetworkRuleState{VirtualNetworkRuleStateDeleting, VirtualNetworkRuleStateInitializing, VirtualNetworkRuleStateInProgress, VirtualNetworkRuleStateReady, VirtualNetworkRuleStateUnknown} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/firewallrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/firewallrules.go deleted file mode 100644 index b8fe7610802b6..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/firewallrules.go +++ /dev/null @@ -1,399 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type FirewallRulesClient struct { - BaseClient -} - -// NewFirewallRulesClient creates an instance of the FirewallRulesClient client. -func NewFirewallRulesClient(subscriptionID string) FirewallRulesClient { - return NewFirewallRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallRulesClientWithBaseURI creates an instance of the FirewallRulesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) FirewallRulesClient { - return FirewallRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a new firewall rule or updates an existing firewall rule. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// firewallRuleName - the name of the server firewall rule. -// parameters - the required parameters for creating or updating a firewall rule. -func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule) (result FirewallRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.FirewallRuleProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.StartIPAddress", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.StartIPAddress", Name: validation.Pattern, Rule: `^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`, Chain: nil}}}, - {Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Pattern, Rule: `^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("mariadb.FirewallRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, firewallRuleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallRuleName": autorest.Encode("path", firewallRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallRulesClient) CreateOrUpdateSender(req *http.Request) (future FirewallRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a server firewall rule. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// firewallRuleName - the name of the server firewall rule. -func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.FirewallRulesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, firewallRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FirewallRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallRuleName": autorest.Encode("path", firewallRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallRulesClient) DeleteSender(req *http.Request) (future FirewallRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a server firewall rule. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// firewallRuleName - the name of the server firewall rule. -func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.FirewallRulesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, firewallRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FirewallRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallRuleName": autorest.Encode("path", firewallRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FirewallRulesClient) GetResponder(resp *http.Response) (result FirewallRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer list all the firewall rules in a given server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client FirewallRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result FirewallRuleListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRulesClient.ListByServer") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.FirewallRulesClient", "ListByServer", err.Error()) - } - - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "ListByServer", resp, "Failure sending request") - return - } - - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesClient", "ListByServer", resp, "Failure responding to request") - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client FirewallRulesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client FirewallRulesClient) ListByServerResponder(resp *http.Response) (result FirewallRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedperformancetier.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedperformancetier.go deleted file mode 100644 index 3448215540174..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedperformancetier.go +++ /dev/null @@ -1,115 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LocationBasedPerformanceTierClient is the the Microsoft Azure management API provides create, read, update, and -// delete functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files -// and configurations with new business model. -type LocationBasedPerformanceTierClient struct { - BaseClient -} - -// NewLocationBasedPerformanceTierClient creates an instance of the LocationBasedPerformanceTierClient client. -func NewLocationBasedPerformanceTierClient(subscriptionID string) LocationBasedPerformanceTierClient { - return NewLocationBasedPerformanceTierClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLocationBasedPerformanceTierClientWithBaseURI creates an instance of the LocationBasedPerformanceTierClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewLocationBasedPerformanceTierClientWithBaseURI(baseURI string, subscriptionID string) LocationBasedPerformanceTierClient { - return LocationBasedPerformanceTierClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list all the performance tiers at specified location in a given subscription. -// Parameters: -// locationName - the name of the location. -func (client LocationBasedPerformanceTierClient) List(ctx context.Context, locationName string) (result PerformanceTierListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocationBasedPerformanceTierClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.LocationBasedPerformanceTierClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, locationName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedPerformanceTierClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedPerformanceTierClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedPerformanceTierClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LocationBasedPerformanceTierClient) ListPreparer(ctx context.Context, locationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForMariaDB/locations/{locationName}/performanceTiers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LocationBasedPerformanceTierClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LocationBasedPerformanceTierClient) ListResponder(resp *http.Response) (result PerformanceTierListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedrecommendedactionsessionsoperationstatus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedrecommendedactionsessionsoperationstatus.go deleted file mode 100644 index b1ad76e271969..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedrecommendedactionsessionsoperationstatus.go +++ /dev/null @@ -1,118 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LocationBasedRecommendedActionSessionsOperationStatusClient is the the Microsoft Azure management API provides -// create, read, update, and delete functionality for Azure MariaDB resources including servers, databases, firewall -// rules, VNET rules, log files and configurations with new business model. -type LocationBasedRecommendedActionSessionsOperationStatusClient struct { - BaseClient -} - -// NewLocationBasedRecommendedActionSessionsOperationStatusClient creates an instance of the -// LocationBasedRecommendedActionSessionsOperationStatusClient client. -func NewLocationBasedRecommendedActionSessionsOperationStatusClient(subscriptionID string) LocationBasedRecommendedActionSessionsOperationStatusClient { - return NewLocationBasedRecommendedActionSessionsOperationStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLocationBasedRecommendedActionSessionsOperationStatusClientWithBaseURI creates an instance of the -// LocationBasedRecommendedActionSessionsOperationStatusClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLocationBasedRecommendedActionSessionsOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) LocationBasedRecommendedActionSessionsOperationStatusClient { - return LocationBasedRecommendedActionSessionsOperationStatusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get recommendation action session operation status. -// Parameters: -// locationName - the name of the location. -// operationID - the operation identifier. -func (client LocationBasedRecommendedActionSessionsOperationStatusClient) Get(ctx context.Context, locationName string, operationID string) (result RecommendedActionSessionsOperationStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocationBasedRecommendedActionSessionsOperationStatusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.LocationBasedRecommendedActionSessionsOperationStatusClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, locationName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsOperationStatusClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsOperationStatusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsOperationStatusClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LocationBasedRecommendedActionSessionsOperationStatusClient) GetPreparer(ctx context.Context, locationName string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "operationId": autorest.Encode("path", operationID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/locations/{locationName}/recommendedActionSessionsAzureAsyncOperation/{operationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LocationBasedRecommendedActionSessionsOperationStatusClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LocationBasedRecommendedActionSessionsOperationStatusClient) GetResponder(resp *http.Response) (result RecommendedActionSessionsOperationStatus, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedrecommendedactionsessionsresult.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedrecommendedactionsessionsresult.go deleted file mode 100644 index ed1f515670caa..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/locationbasedrecommendedactionsessionsresult.go +++ /dev/null @@ -1,160 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LocationBasedRecommendedActionSessionsResultClient is the the Microsoft Azure management API provides create, read, -// update, and delete functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET -// rules, log files and configurations with new business model. -type LocationBasedRecommendedActionSessionsResultClient struct { - BaseClient -} - -// NewLocationBasedRecommendedActionSessionsResultClient creates an instance of the -// LocationBasedRecommendedActionSessionsResultClient client. -func NewLocationBasedRecommendedActionSessionsResultClient(subscriptionID string) LocationBasedRecommendedActionSessionsResultClient { - return NewLocationBasedRecommendedActionSessionsResultClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLocationBasedRecommendedActionSessionsResultClientWithBaseURI creates an instance of the -// LocationBasedRecommendedActionSessionsResultClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLocationBasedRecommendedActionSessionsResultClientWithBaseURI(baseURI string, subscriptionID string) LocationBasedRecommendedActionSessionsResultClient { - return LocationBasedRecommendedActionSessionsResultClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List recommendation action session operation result. -// Parameters: -// locationName - the name of the location. -// operationID - the operation identifier. -func (client LocationBasedRecommendedActionSessionsResultClient) List(ctx context.Context, locationName string, operationID string) (result RecommendationActionsResultListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocationBasedRecommendedActionSessionsResultClient.List") - defer func() { - sc := -1 - if result.rarl.Response.Response != nil { - sc = result.rarl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.LocationBasedRecommendedActionSessionsResultClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, locationName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsResultClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rarl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsResultClient", "List", resp, "Failure sending request") - return - } - - result.rarl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsResultClient", "List", resp, "Failure responding to request") - return - } - if result.rarl.hasNextLink() && result.rarl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LocationBasedRecommendedActionSessionsResultClient) ListPreparer(ctx context.Context, locationName string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "operationId": autorest.Encode("path", operationID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/locations/{locationName}/recommendedActionSessionsOperationResults/{operationId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LocationBasedRecommendedActionSessionsResultClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LocationBasedRecommendedActionSessionsResultClient) ListResponder(resp *http.Response) (result RecommendationActionsResultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LocationBasedRecommendedActionSessionsResultClient) listNextResults(ctx context.Context, lastResults RecommendationActionsResultList) (result RecommendationActionsResultList, err error) { - req, err := lastResults.recommendationActionsResultListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsResultClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsResultClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LocationBasedRecommendedActionSessionsResultClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LocationBasedRecommendedActionSessionsResultClient) ListComplete(ctx context.Context, locationName string, operationID string) (result RecommendationActionsResultListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocationBasedRecommendedActionSessionsResultClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, locationName, operationID) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/logfiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/logfiles.go deleted file mode 100644 index d4bace6ef7871..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/logfiles.go +++ /dev/null @@ -1,120 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LogFilesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and configurations with -// new business model. -type LogFilesClient struct { - BaseClient -} - -// NewLogFilesClient creates an instance of the LogFilesClient client. -func NewLogFilesClient(subscriptionID string) LogFilesClient { - return NewLogFilesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLogFilesClientWithBaseURI creates an instance of the LogFilesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLogFilesClientWithBaseURI(baseURI string, subscriptionID string) LogFilesClient { - return LogFilesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByServer list all the log files in a given server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client LogFilesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result LogFileListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogFilesClient.ListByServer") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.LogFilesClient", "ListByServer", err.Error()) - } - - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LogFilesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.LogFilesClient", "ListByServer", resp, "Failure sending request") - return - } - - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.LogFilesClient", "ListByServer", resp, "Failure responding to request") - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client LogFilesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/logFiles", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client LogFilesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client LogFilesClient) ListByServerResponder(resp *http.Response) (result LogFileListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/models.go deleted file mode 100644 index 6f7ac5dd7f23e..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/models.go +++ /dev/null @@ -1,4337 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb" - -// Advisor represents a recommendation action advisor. -type Advisor struct { - autorest.Response `json:"-"` - // Properties - The properties of a recommendation action advisor. - Properties interface{} `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Advisor. -func (a Advisor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.Properties != nil { - objectMap["properties"] = a.Properties - } - return json.Marshal(objectMap) -} - -// AdvisorsResultList a list of query statistics. -type AdvisorsResultList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of recommendation action advisors. - Value *[]Advisor `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AdvisorsResultList. -func (arl AdvisorsResultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AdvisorsResultListIterator provides access to a complete listing of Advisor values. -type AdvisorsResultListIterator struct { - i int - page AdvisorsResultListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AdvisorsResultListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsResultListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AdvisorsResultListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AdvisorsResultListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AdvisorsResultListIterator) Response() AdvisorsResultList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AdvisorsResultListIterator) Value() Advisor { - if !iter.page.NotDone() { - return Advisor{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AdvisorsResultListIterator type. -func NewAdvisorsResultListIterator(page AdvisorsResultListPage) AdvisorsResultListIterator { - return AdvisorsResultListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (arl AdvisorsResultList) IsEmpty() bool { - return arl.Value == nil || len(*arl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (arl AdvisorsResultList) hasNextLink() bool { - return arl.NextLink != nil && len(*arl.NextLink) != 0 -} - -// advisorsResultListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (arl AdvisorsResultList) advisorsResultListPreparer(ctx context.Context) (*http.Request, error) { - if !arl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(arl.NextLink))) -} - -// AdvisorsResultListPage contains a page of Advisor values. -type AdvisorsResultListPage struct { - fn func(context.Context, AdvisorsResultList) (AdvisorsResultList, error) - arl AdvisorsResultList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AdvisorsResultListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsResultListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.arl) - if err != nil { - return err - } - page.arl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AdvisorsResultListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AdvisorsResultListPage) NotDone() bool { - return !page.arl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AdvisorsResultListPage) Response() AdvisorsResultList { - return page.arl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AdvisorsResultListPage) Values() []Advisor { - if page.arl.IsEmpty() { - return nil - } - return *page.arl.Value -} - -// Creates a new instance of the AdvisorsResultListPage type. -func NewAdvisorsResultListPage(cur AdvisorsResultList, getNextPage func(context.Context, AdvisorsResultList) (AdvisorsResultList, error)) AdvisorsResultListPage { - return AdvisorsResultListPage{ - fn: getNextPage, - arl: cur, - } -} - -// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. -type AzureEntityResource struct { - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureEntityResource. -func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudError an error response from the Batch service. -type CloudError struct { - Error *ErrorResponse `json:"error,omitempty"` -} - -// Configuration represents a Configuration. -type Configuration struct { - autorest.Response `json:"-"` - // ConfigurationProperties - The properties of a configuration. - *ConfigurationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Configuration. -func (c Configuration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ConfigurationProperties != nil { - objectMap["properties"] = c.ConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Configuration struct. -func (c *Configuration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var configurationProperties ConfigurationProperties - err = json.Unmarshal(*v, &configurationProperties) - if err != nil { - return err - } - c.ConfigurationProperties = &configurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } - - return nil -} - -// ConfigurationListResult a list of server configurations. -type ConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - The list of server configurations. - Value *[]Configuration `json:"value,omitempty"` -} - -// ConfigurationProperties the properties of a configuration. -type ConfigurationProperties struct { - // Value - Value of the configuration. - Value *string `json:"value,omitempty"` - // Description - READ-ONLY; Description of the configuration. - Description *string `json:"description,omitempty"` - // DefaultValue - READ-ONLY; Default value of the configuration. - DefaultValue *string `json:"defaultValue,omitempty"` - // DataType - READ-ONLY; Data type of the configuration. - DataType *string `json:"dataType,omitempty"` - // AllowedValues - READ-ONLY; Allowed values of the configuration. - AllowedValues *string `json:"allowedValues,omitempty"` - // Source - Source of the configuration. - Source *string `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConfigurationProperties. -func (cp ConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.Value != nil { - objectMap["value"] = cp.Value - } - if cp.Source != nil { - objectMap["source"] = cp.Source - } - return json.Marshal(objectMap) -} - -// ConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ConfigurationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConfigurationsClient) (Configuration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConfigurationsCreateOrUpdateFuture.Result. -func (future *ConfigurationsCreateOrUpdateFuture) result(client ConfigurationsClient) (c Configuration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - c.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.ConfigurationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { - c, err = client.CreateOrUpdateResponder(c.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ConfigurationsCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") - } - } - return -} - -// CreateRecommendedActionSessionFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CreateRecommendedActionSessionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CreateRecommendedActionSessionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CreateRecommendedActionSessionFuture.Result. -func (future *CreateRecommendedActionSessionFuture) result(client BaseClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.CreateRecommendedActionSessionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.CreateRecommendedActionSessionFuture") - return - } - ar.Response = future.Response() - return -} - -// Database represents a Database. -type Database struct { - autorest.Response `json:"-"` - // DatabaseProperties - The properties of a database. - *DatabaseProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Database. -func (d Database) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.DatabaseProperties != nil { - objectMap["properties"] = d.DatabaseProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Database struct. -func (d *Database) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var databaseProperties DatabaseProperties - err = json.Unmarshal(*v, &databaseProperties) - if err != nil { - return err - } - d.DatabaseProperties = &databaseProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - d.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - d.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - d.Type = &typeVar - } - } - } - - return nil -} - -// DatabaseListResult a List of databases. -type DatabaseListResult struct { - autorest.Response `json:"-"` - // Value - The list of databases housed in a server - Value *[]Database `json:"value,omitempty"` -} - -// DatabaseProperties the properties of a database. -type DatabaseProperties struct { - // Charset - The charset of the database. - Charset *string `json:"charset,omitempty"` - // Collation - The collation of the database. - Collation *string `json:"collation,omitempty"` -} - -// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DatabasesClient) (Database, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DatabasesCreateOrUpdateFuture.Result. -func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (d Database, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.DatabasesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.CreateOrUpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DatabasesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DatabasesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DatabasesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DatabasesDeleteFuture.Result. -func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.DatabasesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ErrorAdditionalInfo the resource management error additional info. -type ErrorAdditionalInfo struct { - // Type - READ-ONLY; The additional info type. - Type *string `json:"type,omitempty"` - // Info - READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. -func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for -// failed operations. (This also follows the OData error response format.) -type ErrorResponse struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The error target. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; The error details. - Details *[]ErrorResponse `json:"details,omitempty"` - // AdditionalInfo - READ-ONLY; The error additional info. - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorResponse. -func (er ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// FirewallRule represents a server firewall rule. -type FirewallRule struct { - autorest.Response `json:"-"` - // FirewallRuleProperties - The properties of a firewall rule. - *FirewallRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallRule. -func (fr FirewallRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fr.FirewallRuleProperties != nil { - objectMap["properties"] = fr.FirewallRuleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallRule struct. -func (fr *FirewallRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var firewallRuleProperties FirewallRuleProperties - err = json.Unmarshal(*v, &firewallRuleProperties) - if err != nil { - return err - } - fr.FirewallRuleProperties = &firewallRuleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fr.Type = &typeVar - } - } - } - - return nil -} - -// FirewallRuleListResult a list of firewall rules. -type FirewallRuleListResult struct { - autorest.Response `json:"-"` - // Value - The list of firewall rules in a server. - Value *[]FirewallRule `json:"value,omitempty"` -} - -// FirewallRuleProperties the properties of a server firewall rule. -type FirewallRuleProperties struct { - // StartIPAddress - The start IP address of the server firewall rule. Must be IPv4 format. - StartIPAddress *string `json:"startIpAddress,omitempty"` - // EndIPAddress - The end IP address of the server firewall rule. Must be IPv4 format. - EndIPAddress *string `json:"endIpAddress,omitempty"` -} - -// FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FirewallRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallRulesClient) (FirewallRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallRulesCreateOrUpdateFuture.Result. -func (future *FirewallRulesCreateOrUpdateFuture) result(client FirewallRulesClient) (fr FirewallRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.FirewallRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fr.Response.Response, err = future.GetResult(sender); err == nil && fr.Response.Response.StatusCode != http.StatusNoContent { - fr, err = client.CreateOrUpdateResponder(fr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesCreateOrUpdateFuture", "Result", fr.Response.Response, "Failure responding to request") - } - } - return -} - -// FirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FirewallRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallRulesDeleteFuture.Result. -func (future *FirewallRulesDeleteFuture) result(client FirewallRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.FirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.FirewallRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LogFile represents a log file. -type LogFile struct { - // LogFileProperties - The properties of the log file. - *LogFileProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogFile. -func (lf LogFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lf.LogFileProperties != nil { - objectMap["properties"] = lf.LogFileProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LogFile struct. -func (lf *LogFile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var logFileProperties LogFileProperties - err = json.Unmarshal(*v, &logFileProperties) - if err != nil { - return err - } - lf.LogFileProperties = &logFileProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lf.Type = &typeVar - } - } - } - - return nil -} - -// LogFileListResult a list of log files. -type LogFileListResult struct { - autorest.Response `json:"-"` - // Value - The list of log files. - Value *[]LogFile `json:"value,omitempty"` -} - -// LogFileProperties the properties of a log file. -type LogFileProperties struct { - // SizeInKB - Size of the log file. - SizeInKB *int64 `json:"sizeInKB,omitempty"` - // CreatedTime - READ-ONLY; Creation timestamp of the log file. - CreatedTime *date.Time `json:"createdTime,omitempty"` - // LastModifiedTime - READ-ONLY; Last modified timestamp of the log file. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Type - Type of the log file. - Type *string `json:"type,omitempty"` - // URL - READ-ONLY; The url to download the log file from. - URL *string `json:"url,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogFileProperties. -func (lfp LogFileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lfp.SizeInKB != nil { - objectMap["sizeInKB"] = lfp.SizeInKB - } - if lfp.Type != nil { - objectMap["type"] = lfp.Type - } - return json.Marshal(objectMap) -} - -// NameAvailability represents a resource name availability. -type NameAvailability struct { - autorest.Response `json:"-"` - // Message - Error Message. - Message *string `json:"message,omitempty"` - // NameAvailable - Indicates whether the resource name is available. - NameAvailable *bool `json:"nameAvailable,omitempty"` - // Reason - Reason for name being unavailable. - Reason *string `json:"reason,omitempty"` -} - -// NameAvailabilityRequest request from client to check resource name availability. -type NameAvailabilityRequest struct { - // Name - Resource name to verify. - Name *string `json:"name,omitempty"` - // Type - Resource type used for verification. - Type *string `json:"type,omitempty"` -} - -// Operation REST API operation definition. -type Operation struct { - // Name - READ-ONLY; The name of the operation being performed on this particular object. - Name *string `json:"name,omitempty"` - // Display - READ-ONLY; The localized display information for this particular operation or action. - Display *OperationDisplay `json:"display,omitempty"` - // Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'NotSpecified', 'User', 'System' - Origin OperationOrigin `json:"origin,omitempty"` - // Properties - READ-ONLY; Additional descriptions for the operation. - Properties map[string]interface{} `json:"properties"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationDisplay display metadata associated with the operation. -type OperationDisplay struct { - // Provider - READ-ONLY; Operation resource provider name. - Provider *string `json:"provider,omitempty"` - // Resource - READ-ONLY; Resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` - // Operation - READ-ONLY; Localized friendly name for the operation. - Operation *string `json:"operation,omitempty"` - // Description - READ-ONLY; Operation description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationDisplay. -func (od OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationListResult a list of resource provider operations. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - The list of resource provider operations. - Value *[]Operation `json:"value,omitempty"` -} - -// PerformanceTierListResult a list of performance tiers. -type PerformanceTierListResult struct { - autorest.Response `json:"-"` - // Value - The list of performance tiers - Value *[]PerformanceTierProperties `json:"value,omitempty"` -} - -// PerformanceTierProperties performance tier properties -type PerformanceTierProperties struct { - // ID - ID of the performance tier. - ID *string `json:"id,omitempty"` - // ServiceLevelObjectives - Service level objectives associated with the performance tier - ServiceLevelObjectives *[]PerformanceTierServiceLevelObjectives `json:"serviceLevelObjectives,omitempty"` -} - -// PerformanceTierServiceLevelObjectives service level objectives for performance tier. -type PerformanceTierServiceLevelObjectives struct { - // ID - ID for the service level objective. - ID *string `json:"id,omitempty"` - // Edition - Edition of the performance tier. - Edition *string `json:"edition,omitempty"` - // VCore - vCore associated with the service level objective - VCore *int32 `json:"vCore,omitempty"` - // HardwareGeneration - Hardware generation associated with the service level objective - HardwareGeneration *string `json:"hardwareGeneration,omitempty"` - // MaxBackupRetentionDays - Maximum Backup retention in days for the performance tier edition - MaxBackupRetentionDays *int32 `json:"maxBackupRetentionDays,omitempty"` - // MinBackupRetentionDays - Minimum Backup retention in days for the performance tier edition - MinBackupRetentionDays *int32 `json:"minBackupRetentionDays,omitempty"` - // MaxStorageMB - Max storage allowed for a server. - MaxStorageMB *int32 `json:"maxStorageMB,omitempty"` - // MinStorageMB - Max storage allowed for a server. - MinStorageMB *int32 `json:"minStorageMB,omitempty"` -} - -// PrivateEndpointConnection a private endpoint connection -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Resource properties. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult a list of private endpoint connections. -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]PrivateEndpointConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult. -func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateEndpointConnectionListResultIterator provides access to a complete listing of -// PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultIterator struct { - i int - page PrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { - if !iter.page.NotDone() { - return PrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. -func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { - return PrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { - return peclr.Value == nil || len(*peclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { - return peclr.NextLink != nil && len(*peclr.NextLink) != 0 -} - -// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !peclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(peclr.NextLink))) -} - -// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultPage struct { - fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) - peclr PrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.peclr) - if err != nil { - return err - } - page.peclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.peclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { - return page.peclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { - if page.peclr.IsEmpty() { - return nil - } - return *page.peclr.Value -} - -// Creates a new instance of the PrivateEndpointConnectionListResultPage type. -func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { - return PrivateEndpointConnectionListResultPage{ - fn: getNextPage, - peclr: cur, - } -} - -// PrivateEndpointConnectionProperties properties of a private endpoint connection. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - Private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; State of the private endpoint connection. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. -func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pecp.PrivateEndpoint != nil { - objectMap["privateEndpoint"] = pecp.PrivateEndpoint - } - if pecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type PrivateEndpointConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. -func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.PrivateEndpointConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.CreateOrUpdateResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. -func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.PrivateEndpointConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateEndpointConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionsUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionsUpdateTagsFuture.Result. -func (future *PrivateEndpointConnectionsUpdateTagsFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.PrivateEndpointConnectionsUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.UpdateTagsResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsUpdateTagsFuture", "Result", pec.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointProperty ... -type PrivateEndpointProperty struct { - // ID - Resource id of the private endpoint. - ID *string `json:"id,omitempty"` -} - -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - autorest.Response `json:"-"` - // Properties - READ-ONLY; The private link resource group id. - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResource. -func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]PrivateLinkResource `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResourceListResult. -func (plrlr PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource -// values. -type PrivateLinkResourceListResultIterator struct { - i int - page PrivateLinkResourceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateLinkResourceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateLinkResourceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { - if !iter.page.NotDone() { - return PrivateLinkResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateLinkResourceListResultIterator type. -func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { - return PrivateLinkResourceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { - return plrlr.Value == nil || len(*plrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (plrlr PrivateLinkResourceListResult) hasNextLink() bool { - return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0 -} - -// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !plrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plrlr.NextLink))) -} - -// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. -type PrivateLinkResourceListResultPage struct { - fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) - plrlr PrivateLinkResourceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.plrlr) - if err != nil { - return err - } - page.plrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateLinkResourceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateLinkResourceListResultPage) NotDone() bool { - return !page.plrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { - return page.plrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { - if page.plrlr.IsEmpty() { - return nil - } - return *page.plrlr.Value -} - -// Creates a new instance of the PrivateLinkResourceListResultPage type. -func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { - return PrivateLinkResourceListResultPage{ - fn: getNextPage, - plrlr: cur, - } -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. -func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionStateProperty ... -type PrivateLinkServiceConnectionStateProperty struct { - // Status - The private link service connection status. - Status *string `json:"status,omitempty"` - // Description - The private link service connection description. - Description *string `json:"description,omitempty"` - // ActionsRequired - READ-ONLY; The actions required for private link service connection. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. -func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plscsp.Status != nil { - objectMap["status"] = plscsp.Status - } - if plscsp.Description != nil { - objectMap["description"] = plscsp.Description - } - return json.Marshal(objectMap) -} - -// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not -// have tags and a location -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// QueryStatistic represents a Query Statistic. -type QueryStatistic struct { - autorest.Response `json:"-"` - // QueryStatisticProperties - The properties of a query statistic. - *QueryStatisticProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for QueryStatistic. -func (qs QueryStatistic) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if qs.QueryStatisticProperties != nil { - objectMap["properties"] = qs.QueryStatisticProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for QueryStatistic struct. -func (qs *QueryStatistic) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var queryStatisticProperties QueryStatisticProperties - err = json.Unmarshal(*v, &queryStatisticProperties) - if err != nil { - return err - } - qs.QueryStatisticProperties = &queryStatisticProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - qs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - qs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - qs.Type = &typeVar - } - } - } - - return nil -} - -// QueryStatisticProperties the properties of a query statistic. -type QueryStatisticProperties struct { - // QueryID - Database query identifier. - QueryID *string `json:"queryId,omitempty"` - // StartTime - Observation start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Observation end time. - EndTime *date.Time `json:"endTime,omitempty"` - // AggregationFunction - Aggregation function name. - AggregationFunction *string `json:"aggregationFunction,omitempty"` - // DatabaseNames - The list of database names. - DatabaseNames *[]string `json:"databaseNames,omitempty"` - // QueryExecutionCount - Number of query executions in this time interval. - QueryExecutionCount *int64 `json:"queryExecutionCount,omitempty"` - // MetricName - Metric name. - MetricName *string `json:"metricName,omitempty"` - // MetricDisplayName - Metric display name. - MetricDisplayName *string `json:"metricDisplayName,omitempty"` - // MetricValue - Metric value. - MetricValue *float64 `json:"metricValue,omitempty"` - // MetricValueUnit - Metric value unit. - MetricValueUnit *string `json:"metricValueUnit,omitempty"` -} - -// QueryText represents a Query Text. -type QueryText struct { - autorest.Response `json:"-"` - // QueryTextProperties - The properties of a query text. - *QueryTextProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for QueryText. -func (qt QueryText) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if qt.QueryTextProperties != nil { - objectMap["properties"] = qt.QueryTextProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for QueryText struct. -func (qt *QueryText) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var queryTextProperties QueryTextProperties - err = json.Unmarshal(*v, &queryTextProperties) - if err != nil { - return err - } - qt.QueryTextProperties = &queryTextProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - qt.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - qt.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - qt.Type = &typeVar - } - } - } - - return nil -} - -// QueryTextProperties the properties of a query text. -type QueryTextProperties struct { - // QueryID - Query identifier unique to the server. - QueryID *string `json:"queryId,omitempty"` - // QueryText - Query text. - QueryText *string `json:"queryText,omitempty"` -} - -// QueryTextsResultList a list of query texts. -type QueryTextsResultList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of query texts. - Value *[]QueryText `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for QueryTextsResultList. -func (qtrl QueryTextsResultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// QueryTextsResultListIterator provides access to a complete listing of QueryText values. -type QueryTextsResultListIterator struct { - i int - page QueryTextsResultListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *QueryTextsResultListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsResultListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *QueryTextsResultListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter QueryTextsResultListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter QueryTextsResultListIterator) Response() QueryTextsResultList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter QueryTextsResultListIterator) Value() QueryText { - if !iter.page.NotDone() { - return QueryText{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the QueryTextsResultListIterator type. -func NewQueryTextsResultListIterator(page QueryTextsResultListPage) QueryTextsResultListIterator { - return QueryTextsResultListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (qtrl QueryTextsResultList) IsEmpty() bool { - return qtrl.Value == nil || len(*qtrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (qtrl QueryTextsResultList) hasNextLink() bool { - return qtrl.NextLink != nil && len(*qtrl.NextLink) != 0 -} - -// queryTextsResultListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (qtrl QueryTextsResultList) queryTextsResultListPreparer(ctx context.Context) (*http.Request, error) { - if !qtrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(qtrl.NextLink))) -} - -// QueryTextsResultListPage contains a page of QueryText values. -type QueryTextsResultListPage struct { - fn func(context.Context, QueryTextsResultList) (QueryTextsResultList, error) - qtrl QueryTextsResultList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *QueryTextsResultListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsResultListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.qtrl) - if err != nil { - return err - } - page.qtrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *QueryTextsResultListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page QueryTextsResultListPage) NotDone() bool { - return !page.qtrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page QueryTextsResultListPage) Response() QueryTextsResultList { - return page.qtrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page QueryTextsResultListPage) Values() []QueryText { - if page.qtrl.IsEmpty() { - return nil - } - return *page.qtrl.Value -} - -// Creates a new instance of the QueryTextsResultListPage type. -func NewQueryTextsResultListPage(cur QueryTextsResultList, getNextPage func(context.Context, QueryTextsResultList) (QueryTextsResultList, error)) QueryTextsResultListPage { - return QueryTextsResultListPage{ - fn: getNextPage, - qtrl: cur, - } -} - -// RecommendationAction represents a Recommendation Action. -type RecommendationAction struct { - autorest.Response `json:"-"` - // RecommendationActionProperties - The properties of a recommendation action. - *RecommendationActionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecommendationAction. -func (ra RecommendationAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ra.RecommendationActionProperties != nil { - objectMap["properties"] = ra.RecommendationActionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecommendationAction struct. -func (ra *RecommendationAction) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var recommendationActionProperties RecommendationActionProperties - err = json.Unmarshal(*v, &recommendationActionProperties) - if err != nil { - return err - } - ra.RecommendationActionProperties = &recommendationActionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ra.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ra.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ra.Type = &typeVar - } - } - } - - return nil -} - -// RecommendationActionProperties the properties of a recommendation action. -type RecommendationActionProperties struct { - // AdvisorName - Advisor name. - AdvisorName *string `json:"advisorName,omitempty"` - // SessionID - Recommendation action session identifier. - SessionID *string `json:"sessionId,omitempty"` - // ActionID - Recommendation action identifier. - ActionID *int32 `json:"actionId,omitempty"` - // CreatedTime - Recommendation action creation time. - CreatedTime *date.Time `json:"createdTime,omitempty"` - // ExpirationTime - Recommendation action expiration time. - ExpirationTime *date.Time `json:"expirationTime,omitempty"` - // Reason - Recommendation action reason. - Reason *string `json:"reason,omitempty"` - // RecommendationType - Recommendation action type. - RecommendationType *string `json:"recommendationType,omitempty"` - // Details - Recommendation action details. - Details map[string]*string `json:"details"` -} - -// MarshalJSON is the custom marshaler for RecommendationActionProperties. -func (rap RecommendationActionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rap.AdvisorName != nil { - objectMap["advisorName"] = rap.AdvisorName - } - if rap.SessionID != nil { - objectMap["sessionId"] = rap.SessionID - } - if rap.ActionID != nil { - objectMap["actionId"] = rap.ActionID - } - if rap.CreatedTime != nil { - objectMap["createdTime"] = rap.CreatedTime - } - if rap.ExpirationTime != nil { - objectMap["expirationTime"] = rap.ExpirationTime - } - if rap.Reason != nil { - objectMap["reason"] = rap.Reason - } - if rap.RecommendationType != nil { - objectMap["recommendationType"] = rap.RecommendationType - } - if rap.Details != nil { - objectMap["details"] = rap.Details - } - return json.Marshal(objectMap) -} - -// RecommendationActionsResultList a list of recommendation actions. -type RecommendationActionsResultList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of recommendation action advisors. - Value *[]RecommendationAction `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecommendationActionsResultList. -func (rarl RecommendationActionsResultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RecommendationActionsResultListIterator provides access to a complete listing of RecommendationAction -// values. -type RecommendationActionsResultListIterator struct { - i int - page RecommendationActionsResultListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RecommendationActionsResultListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationActionsResultListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RecommendationActionsResultListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RecommendationActionsResultListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RecommendationActionsResultListIterator) Response() RecommendationActionsResultList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RecommendationActionsResultListIterator) Value() RecommendationAction { - if !iter.page.NotDone() { - return RecommendationAction{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RecommendationActionsResultListIterator type. -func NewRecommendationActionsResultListIterator(page RecommendationActionsResultListPage) RecommendationActionsResultListIterator { - return RecommendationActionsResultListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rarl RecommendationActionsResultList) IsEmpty() bool { - return rarl.Value == nil || len(*rarl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rarl RecommendationActionsResultList) hasNextLink() bool { - return rarl.NextLink != nil && len(*rarl.NextLink) != 0 -} - -// recommendationActionsResultListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rarl RecommendationActionsResultList) recommendationActionsResultListPreparer(ctx context.Context) (*http.Request, error) { - if !rarl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rarl.NextLink))) -} - -// RecommendationActionsResultListPage contains a page of RecommendationAction values. -type RecommendationActionsResultListPage struct { - fn func(context.Context, RecommendationActionsResultList) (RecommendationActionsResultList, error) - rarl RecommendationActionsResultList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RecommendationActionsResultListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationActionsResultListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rarl) - if err != nil { - return err - } - page.rarl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RecommendationActionsResultListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RecommendationActionsResultListPage) NotDone() bool { - return !page.rarl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RecommendationActionsResultListPage) Response() RecommendationActionsResultList { - return page.rarl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RecommendationActionsResultListPage) Values() []RecommendationAction { - if page.rarl.IsEmpty() { - return nil - } - return *page.rarl.Value -} - -// Creates a new instance of the RecommendationActionsResultListPage type. -func NewRecommendationActionsResultListPage(cur RecommendationActionsResultList, getNextPage func(context.Context, RecommendationActionsResultList) (RecommendationActionsResultList, error)) RecommendationActionsResultListPage { - return RecommendationActionsResultListPage{ - fn: getNextPage, - rarl: cur, - } -} - -// RecommendedActionSessionsOperationStatus recommendation action session operation status. -type RecommendedActionSessionsOperationStatus struct { - autorest.Response `json:"-"` - // Name - Operation identifier. - Name *string `json:"name,omitempty"` - // StartTime - Operation start time. - StartTime *date.Time `json:"startTime,omitempty"` - // Status - Operation status. - Status *string `json:"status,omitempty"` -} - -// Resource common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SecurityAlertPolicyProperties properties of a security alert policy. -type SecurityAlertPolicyProperties struct { - // State - Specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'ServerSecurityAlertPolicyStateEnabled', 'ServerSecurityAlertPolicyStateDisabled' - State ServerSecurityAlertPolicyState `json:"state,omitempty"` - // DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly - DisabledAlerts *[]string `json:"disabledAlerts,omitempty"` - // EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent. - EmailAddresses *[]string `json:"emailAddresses,omitempty"` - // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. - EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"` - // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. - StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. - StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` - // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. - RetentionDays *int32 `json:"retentionDays,omitempty"` -} - -// Server represents a server. -type Server struct { - autorest.Response `json:"-"` - // Sku - The SKU (pricing tier) of the server. - Sku *Sku `json:"sku,omitempty"` - // ServerProperties - Properties of the server. - *ServerProperties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Server. -func (s Server) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Sku != nil { - objectMap["sku"] = s.Sku - } - if s.ServerProperties != nil { - objectMap["properties"] = s.ServerProperties - } - if s.Tags != nil { - objectMap["tags"] = s.Tags - } - if s.Location != nil { - objectMap["location"] = s.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Server struct. -func (s *Server) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - s.Sku = &sku - } - case "properties": - if v != nil { - var serverProperties ServerProperties - err = json.Unmarshal(*v, &serverProperties) - if err != nil { - return err - } - s.ServerProperties = &serverProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - s.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - s.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - s.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - s.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - } - } - - return nil -} - -// ServerForCreate represents a server to be created. -type ServerForCreate struct { - // Sku - The SKU (pricing tier) of the server. - Sku *Sku `json:"sku,omitempty"` - // Properties - Properties of the server. - Properties BasicServerPropertiesForCreate `json:"properties,omitempty"` - // Location - The location the resource resides in. - Location *string `json:"location,omitempty"` - // Tags - Application-specific metadata in the form of key-value pairs. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ServerForCreate. -func (sfc ServerForCreate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sfc.Sku != nil { - objectMap["sku"] = sfc.Sku - } - objectMap["properties"] = sfc.Properties - if sfc.Location != nil { - objectMap["location"] = sfc.Location - } - if sfc.Tags != nil { - objectMap["tags"] = sfc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerForCreate struct. -func (sfc *ServerForCreate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - sfc.Sku = &sku - } - case "properties": - if v != nil { - properties, err := unmarshalBasicServerPropertiesForCreate(*v) - if err != nil { - return err - } - sfc.Properties = properties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sfc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sfc.Tags = tags - } - } - } - - return nil -} - -// ServerListResult a list of servers. -type ServerListResult struct { - autorest.Response `json:"-"` - // Value - The list of servers - Value *[]Server `json:"value,omitempty"` -} - -// ServerPrivateEndpointConnection a private endpoint connection under a server -type ServerPrivateEndpointConnection struct { - // ID - READ-ONLY; Resource Id of the private endpoint connection. - ID *string `json:"id,omitempty"` - // Properties - READ-ONLY; Private endpoint connection properties - Properties *ServerPrivateEndpointConnectionProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerPrivateEndpointConnection. -func (spec ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ServerPrivateEndpointConnectionProperties properties of a private endpoint connection. -type ServerPrivateEndpointConnectionProperties struct { - // PrivateEndpoint - Private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. - PrivateLinkServiceConnectionState *ServerPrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', 'Rejecting' - ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerPrivateEndpointConnectionProperties. -func (specp ServerPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if specp.PrivateEndpoint != nil { - objectMap["privateEndpoint"] = specp.PrivateEndpoint - } - if specp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = specp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// ServerPrivateLinkServiceConnectionStateProperty ... -type ServerPrivateLinkServiceConnectionStateProperty struct { - // Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected' - Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"` - // Description - The private link service connection description. - Description *string `json:"description,omitempty"` - // ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'None' - ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerPrivateLinkServiceConnectionStateProperty. -func (splscsp ServerPrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if splscsp.Status != "" { - objectMap["status"] = splscsp.Status - } - if splscsp.Description != nil { - objectMap["description"] = splscsp.Description - } - return json.Marshal(objectMap) -} - -// ServerProperties the properties of a server. -type ServerProperties struct { - // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' - Version ServerVersion `json:"version,omitempty"` - // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' - SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // UserVisibleState - A state of a server that is visible to user. Possible values include: 'ServerStateReady', 'ServerStateDropping', 'ServerStateDisabled' - UserVisibleState ServerState `json:"userVisibleState,omitempty"` - // FullyQualifiedDomainName - The fully qualified domain name of a server. - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` - // EarliestRestoreDate - Earliest restore point creation time (ISO8601 format) - EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` - // StorageProfile - Storage profile of a server. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // ReplicationRole - The replication role of the server. - ReplicationRole *string `json:"replicationRole,omitempty"` - // MasterServerID - The master server id of a replica server. - MasterServerID *string `json:"masterServerId,omitempty"` - // ReplicaCapacity - The maximum number of replicas that a master server can have. - ReplicaCapacity *int32 `json:"replicaCapacity,omitempty"` - // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' - PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` - // PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server - PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerProperties. -func (sp ServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.AdministratorLogin != nil { - objectMap["administratorLogin"] = sp.AdministratorLogin - } - if sp.Version != "" { - objectMap["version"] = sp.Version - } - if sp.SslEnforcement != "" { - objectMap["sslEnforcement"] = sp.SslEnforcement - } - if sp.UserVisibleState != "" { - objectMap["userVisibleState"] = sp.UserVisibleState - } - if sp.FullyQualifiedDomainName != nil { - objectMap["fullyQualifiedDomainName"] = sp.FullyQualifiedDomainName - } - if sp.EarliestRestoreDate != nil { - objectMap["earliestRestoreDate"] = sp.EarliestRestoreDate - } - if sp.StorageProfile != nil { - objectMap["storageProfile"] = sp.StorageProfile - } - if sp.ReplicationRole != nil { - objectMap["replicationRole"] = sp.ReplicationRole - } - if sp.MasterServerID != nil { - objectMap["masterServerId"] = sp.MasterServerID - } - if sp.ReplicaCapacity != nil { - objectMap["replicaCapacity"] = sp.ReplicaCapacity - } - if sp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess - } - return json.Marshal(objectMap) -} - -// BasicServerPropertiesForCreate the properties used to create a new server. -type BasicServerPropertiesForCreate interface { - AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) - AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) - AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) - AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) - AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) -} - -// ServerPropertiesForCreate the properties used to create a new server. -type ServerPropertiesForCreate struct { - // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' - Version ServerVersion `json:"version,omitempty"` - // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' - SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' - PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` - // StorageProfile - Storage profile of a server. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' - CreateMode CreateMode `json:"createMode,omitempty"` -} - -func unmarshalBasicServerPropertiesForCreate(body []byte) (BasicServerPropertiesForCreate, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["createMode"] { - case string(CreateModeDefault): - var spfdc ServerPropertiesForDefaultCreate - err := json.Unmarshal(body, &spfdc) - return spfdc, err - case string(CreateModePointInTimeRestore): - var spfr ServerPropertiesForRestore - err := json.Unmarshal(body, &spfr) - return spfr, err - case string(CreateModeGeoRestore): - var spfgr ServerPropertiesForGeoRestore - err := json.Unmarshal(body, &spfgr) - return spfgr, err - case string(CreateModeReplica): - var spfr ServerPropertiesForReplica - err := json.Unmarshal(body, &spfr) - return spfr, err - default: - var spfc ServerPropertiesForCreate - err := json.Unmarshal(body, &spfc) - return spfc, err - } -} -func unmarshalBasicServerPropertiesForCreateArray(body []byte) ([]BasicServerPropertiesForCreate, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - spfcArray := make([]BasicServerPropertiesForCreate, len(rawMessages)) - - for index, rawMessage := range rawMessages { - spfc, err := unmarshalBasicServerPropertiesForCreate(*rawMessage) - if err != nil { - return nil, err - } - spfcArray[index] = spfc - } - return spfcArray, nil -} - -// MarshalJSON is the custom marshaler for ServerPropertiesForCreate. -func (spfc ServerPropertiesForCreate) MarshalJSON() ([]byte, error) { - spfc.CreateMode = CreateModeServerPropertiesForCreate - objectMap := make(map[string]interface{}) - if spfc.Version != "" { - objectMap["version"] = spfc.Version - } - if spfc.SslEnforcement != "" { - objectMap["sslEnforcement"] = spfc.SslEnforcement - } - if spfc.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = spfc.PublicNetworkAccess - } - if spfc.StorageProfile != nil { - objectMap["storageProfile"] = spfc.StorageProfile - } - if spfc.CreateMode != "" { - objectMap["createMode"] = spfc.CreateMode - } - return json.Marshal(objectMap) -} - -// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. -func (spfc ServerPropertiesForCreate) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { - return nil, false -} - -// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. -func (spfc ServerPropertiesForCreate) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { - return nil, false -} - -// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. -func (spfc ServerPropertiesForCreate) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { - return nil, false -} - -// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. -func (spfc ServerPropertiesForCreate) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { - return nil, false -} - -// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. -func (spfc ServerPropertiesForCreate) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { - return &spfc, true -} - -// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. -func (spfc ServerPropertiesForCreate) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { - return &spfc, true -} - -// ServerPropertiesForDefaultCreate the properties used to create a new server. -type ServerPropertiesForDefaultCreate struct { - // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the administrator login. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' - Version ServerVersion `json:"version,omitempty"` - // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' - SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' - PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` - // StorageProfile - Storage profile of a server. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' - CreateMode CreateMode `json:"createMode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerPropertiesForDefaultCreate. -func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { - spfdc.CreateMode = CreateModeDefault - objectMap := make(map[string]interface{}) - if spfdc.AdministratorLogin != nil { - objectMap["administratorLogin"] = spfdc.AdministratorLogin - } - if spfdc.AdministratorLoginPassword != nil { - objectMap["administratorLoginPassword"] = spfdc.AdministratorLoginPassword - } - if spfdc.Version != "" { - objectMap["version"] = spfdc.Version - } - if spfdc.SslEnforcement != "" { - objectMap["sslEnforcement"] = spfdc.SslEnforcement - } - if spfdc.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = spfdc.PublicNetworkAccess - } - if spfdc.StorageProfile != nil { - objectMap["storageProfile"] = spfdc.StorageProfile - } - if spfdc.CreateMode != "" { - objectMap["createMode"] = spfdc.CreateMode - } - return json.Marshal(objectMap) -} - -// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. -func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { - return &spfdc, true -} - -// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. -func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { - return nil, false -} - -// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. -func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { - return nil, false -} - -// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. -func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { - return nil, false -} - -// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. -func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { - return nil, false -} - -// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. -func (spfdc ServerPropertiesForDefaultCreate) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { - return &spfdc, true -} - -// ServerPropertiesForGeoRestore the properties used to create a new server by restoring to a different -// region from a geo replicated backup. -type ServerPropertiesForGeoRestore struct { - // SourceServerID - The source server id to restore from. - SourceServerID *string `json:"sourceServerId,omitempty"` - // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' - Version ServerVersion `json:"version,omitempty"` - // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' - SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' - PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` - // StorageProfile - Storage profile of a server. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' - CreateMode CreateMode `json:"createMode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerPropertiesForGeoRestore. -func (spfgr ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) { - spfgr.CreateMode = CreateModeGeoRestore - objectMap := make(map[string]interface{}) - if spfgr.SourceServerID != nil { - objectMap["sourceServerId"] = spfgr.SourceServerID - } - if spfgr.Version != "" { - objectMap["version"] = spfgr.Version - } - if spfgr.SslEnforcement != "" { - objectMap["sslEnforcement"] = spfgr.SslEnforcement - } - if spfgr.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = spfgr.PublicNetworkAccess - } - if spfgr.StorageProfile != nil { - objectMap["storageProfile"] = spfgr.StorageProfile - } - if spfgr.CreateMode != "" { - objectMap["createMode"] = spfgr.CreateMode - } - return json.Marshal(objectMap) -} - -// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. -func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { - return nil, false -} - -// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. -func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { - return nil, false -} - -// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. -func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { - return &spfgr, true -} - -// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. -func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { - return nil, false -} - -// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. -func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { - return nil, false -} - -// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. -func (spfgr ServerPropertiesForGeoRestore) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { - return &spfgr, true -} - -// ServerPropertiesForReplica the properties to create a new replica. -type ServerPropertiesForReplica struct { - // SourceServerID - The master server id to create replica from. - SourceServerID *string `json:"sourceServerId,omitempty"` - // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' - Version ServerVersion `json:"version,omitempty"` - // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' - SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' - PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` - // StorageProfile - Storage profile of a server. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' - CreateMode CreateMode `json:"createMode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerPropertiesForReplica. -func (spfr ServerPropertiesForReplica) MarshalJSON() ([]byte, error) { - spfr.CreateMode = CreateModeReplica - objectMap := make(map[string]interface{}) - if spfr.SourceServerID != nil { - objectMap["sourceServerId"] = spfr.SourceServerID - } - if spfr.Version != "" { - objectMap["version"] = spfr.Version - } - if spfr.SslEnforcement != "" { - objectMap["sslEnforcement"] = spfr.SslEnforcement - } - if spfr.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = spfr.PublicNetworkAccess - } - if spfr.StorageProfile != nil { - objectMap["storageProfile"] = spfr.StorageProfile - } - if spfr.CreateMode != "" { - objectMap["createMode"] = spfr.CreateMode - } - return json.Marshal(objectMap) -} - -// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. -func (spfr ServerPropertiesForReplica) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { - return nil, false -} - -// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. -func (spfr ServerPropertiesForReplica) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { - return nil, false -} - -// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. -func (spfr ServerPropertiesForReplica) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { - return nil, false -} - -// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. -func (spfr ServerPropertiesForReplica) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { - return &spfr, true -} - -// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. -func (spfr ServerPropertiesForReplica) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { - return nil, false -} - -// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. -func (spfr ServerPropertiesForReplica) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { - return &spfr, true -} - -// ServerPropertiesForRestore the properties used to create a new server by restoring from a backup. -type ServerPropertiesForRestore struct { - // SourceServerID - The source server id to restore from. - SourceServerID *string `json:"sourceServerId,omitempty"` - // RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` - // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' - Version ServerVersion `json:"version,omitempty"` - // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' - SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' - PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` - // StorageProfile - Storage profile of a server. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' - CreateMode CreateMode `json:"createMode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerPropertiesForRestore. -func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { - spfr.CreateMode = CreateModePointInTimeRestore - objectMap := make(map[string]interface{}) - if spfr.SourceServerID != nil { - objectMap["sourceServerId"] = spfr.SourceServerID - } - if spfr.RestorePointInTime != nil { - objectMap["restorePointInTime"] = spfr.RestorePointInTime - } - if spfr.Version != "" { - objectMap["version"] = spfr.Version - } - if spfr.SslEnforcement != "" { - objectMap["sslEnforcement"] = spfr.SslEnforcement - } - if spfr.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = spfr.PublicNetworkAccess - } - if spfr.StorageProfile != nil { - objectMap["storageProfile"] = spfr.StorageProfile - } - if spfr.CreateMode != "" { - objectMap["createMode"] = spfr.CreateMode - } - return json.Marshal(objectMap) -} - -// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. -func (spfr ServerPropertiesForRestore) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { - return nil, false -} - -// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. -func (spfr ServerPropertiesForRestore) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { - return &spfr, true -} - -// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. -func (spfr ServerPropertiesForRestore) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { - return nil, false -} - -// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. -func (spfr ServerPropertiesForRestore) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { - return nil, false -} - -// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. -func (spfr ServerPropertiesForRestore) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { - return nil, false -} - -// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. -func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { - return &spfr, true -} - -// ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServersClient) (Server, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServersCreateFuture.Result. -func (future *ServersCreateFuture) result(client ServersClient) (s Server, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.ServersCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersCreateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServersDeleteFuture.Result. -func (future *ServersDeleteFuture) result(client ServersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.ServersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServerSecurityAlertPoliciesCreateOrUpdateFuture.Result. -func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ssap.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.ServerSecurityAlertPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent { - ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerSecurityAlertPolicy a server security alert policy. -type ServerSecurityAlertPolicy struct { - autorest.Response `json:"-"` - // SecurityAlertPolicyProperties - Resource properties. - *SecurityAlertPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy. -func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ssap.SecurityAlertPolicyProperties != nil { - objectMap["properties"] = ssap.SecurityAlertPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct. -func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityAlertPolicyProperties SecurityAlertPolicyProperties - err = json.Unmarshal(*v, &securityAlertPolicyProperties) - if err != nil { - return err - } - ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ssap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ssap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ssap.Type = &typeVar - } - } - } - - return nil -} - -// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServersRestartFuture.Result. -func (future *ServersRestartFuture) result(client ServersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.ServersRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServersUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServersClient) (Server, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServersUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServersUpdateFuture.Result. -func (future *ServersUpdateFuture) result(client ServersClient) (s Server, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.ServersUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// ServerUpdateParameters parameters allowed to update for a server. -type ServerUpdateParameters struct { - // Sku - The SKU (pricing tier) of the server. - Sku *Sku `json:"sku,omitempty"` - // ServerUpdateParametersProperties - The properties that can be updated for a server. - *ServerUpdateParametersProperties `json:"properties,omitempty"` - // Tags - Application-specific metadata in the form of key-value pairs. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ServerUpdateParameters. -func (sup ServerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sup.Sku != nil { - objectMap["sku"] = sup.Sku - } - if sup.ServerUpdateParametersProperties != nil { - objectMap["properties"] = sup.ServerUpdateParametersProperties - } - if sup.Tags != nil { - objectMap["tags"] = sup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServerUpdateParameters struct. -func (sup *ServerUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - sup.Sku = &sku - } - case "properties": - if v != nil { - var serverUpdateParametersProperties ServerUpdateParametersProperties - err = json.Unmarshal(*v, &serverUpdateParametersProperties) - if err != nil { - return err - } - sup.ServerUpdateParametersProperties = &serverUpdateParametersProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sup.Tags = tags - } - } - } - - return nil -} - -// ServerUpdateParametersProperties the properties that can be updated for a server. -type ServerUpdateParametersProperties struct { - // StorageProfile - Storage profile of a server. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdministratorLoginPassword - The password of the administrator login. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // Version - The version of a server. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' - Version ServerVersion `json:"version,omitempty"` - // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' - SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` - // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' - PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` - // ReplicationRole - The replication role of the server. - ReplicationRole *string `json:"replicationRole,omitempty"` -} - -// Sku billing information related properties of a server. -type Sku struct { - // Name - The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. - Name *string `json:"name,omitempty"` - // Tier - The tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - Tier SkuTier `json:"tier,omitempty"` - // Capacity - The scale up/out capacity, representing server's compute units. - Capacity *int32 `json:"capacity,omitempty"` - // Size - The size code, to be interpreted by resource as appropriate. - Size *string `json:"size,omitempty"` - // Family - The family of hardware. - Family *string `json:"family,omitempty"` -} - -// StorageProfile storage Profile properties of a server -type StorageProfile struct { - // BackupRetentionDays - Backup retention days for the server. - BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"` - // GeoRedundantBackup - Enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled' - GeoRedundantBackup GeoRedundantBackup `json:"geoRedundantBackup,omitempty"` - // StorageMB - Max storage allowed for a server. - StorageMB *int32 `json:"storageMB,omitempty"` - // StorageAutogrow - Enable Storage Auto Grow. Possible values include: 'StorageAutogrowEnabled', 'StorageAutogrowDisabled' - StorageAutogrow StorageAutogrow `json:"storageAutogrow,omitempty"` -} - -// TagsObject tags object for patch operations. -type TagsObject struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for TagsObject. -func (toVar TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if toVar.Tags != nil { - objectMap["tags"] = toVar.Tags - } - return json.Marshal(objectMap) -} - -// TopQueryStatisticsInput input to get top query statistics -type TopQueryStatisticsInput struct { - // TopQueryStatisticsInputProperties - The properties of a wait statistics input. - *TopQueryStatisticsInputProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for TopQueryStatisticsInput. -func (tqsi TopQueryStatisticsInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tqsi.TopQueryStatisticsInputProperties != nil { - objectMap["properties"] = tqsi.TopQueryStatisticsInputProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TopQueryStatisticsInput struct. -func (tqsi *TopQueryStatisticsInput) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var topQueryStatisticsInputProperties TopQueryStatisticsInputProperties - err = json.Unmarshal(*v, &topQueryStatisticsInputProperties) - if err != nil { - return err - } - tqsi.TopQueryStatisticsInputProperties = &topQueryStatisticsInputProperties - } - } - } - - return nil -} - -// TopQueryStatisticsInputProperties the properties for input to get top query statistics -type TopQueryStatisticsInputProperties struct { - // NumberOfTopQueries - Max number of top queries to return. - NumberOfTopQueries *int32 `json:"numberOfTopQueries,omitempty"` - // AggregationFunction - Aggregation function name. - AggregationFunction *string `json:"aggregationFunction,omitempty"` - // ObservedMetric - Observed metric name. - ObservedMetric *string `json:"observedMetric,omitempty"` - // ObservationStartTime - Observation start time. - ObservationStartTime *date.Time `json:"observationStartTime,omitempty"` - // ObservationEndTime - Observation end time. - ObservationEndTime *date.Time `json:"observationEndTime,omitempty"` - // AggregationWindow - Aggregation interval type in ISO 8601 format. - AggregationWindow *string `json:"aggregationWindow,omitempty"` -} - -// TopQueryStatisticsResultList a list of query statistics. -type TopQueryStatisticsResultList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of top query statistics. - Value *[]QueryStatistic `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for TopQueryStatisticsResultList. -func (tqsrl TopQueryStatisticsResultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// TopQueryStatisticsResultListIterator provides access to a complete listing of QueryStatistic values. -type TopQueryStatisticsResultListIterator struct { - i int - page TopQueryStatisticsResultListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *TopQueryStatisticsResultListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsResultListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *TopQueryStatisticsResultListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter TopQueryStatisticsResultListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter TopQueryStatisticsResultListIterator) Response() TopQueryStatisticsResultList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter TopQueryStatisticsResultListIterator) Value() QueryStatistic { - if !iter.page.NotDone() { - return QueryStatistic{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the TopQueryStatisticsResultListIterator type. -func NewTopQueryStatisticsResultListIterator(page TopQueryStatisticsResultListPage) TopQueryStatisticsResultListIterator { - return TopQueryStatisticsResultListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (tqsrl TopQueryStatisticsResultList) IsEmpty() bool { - return tqsrl.Value == nil || len(*tqsrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (tqsrl TopQueryStatisticsResultList) hasNextLink() bool { - return tqsrl.NextLink != nil && len(*tqsrl.NextLink) != 0 -} - -// topQueryStatisticsResultListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (tqsrl TopQueryStatisticsResultList) topQueryStatisticsResultListPreparer(ctx context.Context) (*http.Request, error) { - if !tqsrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(tqsrl.NextLink))) -} - -// TopQueryStatisticsResultListPage contains a page of QueryStatistic values. -type TopQueryStatisticsResultListPage struct { - fn func(context.Context, TopQueryStatisticsResultList) (TopQueryStatisticsResultList, error) - tqsrl TopQueryStatisticsResultList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *TopQueryStatisticsResultListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsResultListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.tqsrl) - if err != nil { - return err - } - page.tqsrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *TopQueryStatisticsResultListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page TopQueryStatisticsResultListPage) NotDone() bool { - return !page.tqsrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page TopQueryStatisticsResultListPage) Response() TopQueryStatisticsResultList { - return page.tqsrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page TopQueryStatisticsResultListPage) Values() []QueryStatistic { - if page.tqsrl.IsEmpty() { - return nil - } - return *page.tqsrl.Value -} - -// Creates a new instance of the TopQueryStatisticsResultListPage type. -func NewTopQueryStatisticsResultListPage(cur TopQueryStatisticsResultList, getNextPage func(context.Context, TopQueryStatisticsResultList) (TopQueryStatisticsResultList, error)) TopQueryStatisticsResultListPage { - return TopQueryStatisticsResultListPage{ - fn: getNextPage, - tqsrl: cur, - } -} - -// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource -// which has 'tags' and a 'location' -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} - -// VirtualNetworkRule a virtual network rule. -type VirtualNetworkRule struct { - autorest.Response `json:"-"` - // VirtualNetworkRuleProperties - Resource properties. - *VirtualNetworkRuleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkRule. -func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnr.VirtualNetworkRuleProperties != nil { - objectMap["properties"] = vnr.VirtualNetworkRuleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. -func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkRuleProperties VirtualNetworkRuleProperties - err = json.Unmarshal(*v, &virtualNetworkRuleProperties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar - } - } - } - - return nil -} - -// VirtualNetworkRuleListResult a list of virtual network rules. -type VirtualNetworkRuleListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; Array of results. - Value *[]VirtualNetworkRule `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkRuleListResult. -func (vnrlr VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. -type VirtualNetworkRuleListResultIterator struct { - i int - page VirtualNetworkRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { - if !iter.page.NotDone() { - return VirtualNetworkRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkRuleListResultIterator type. -func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator { - return VirtualNetworkRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { - return vnrlr.Value == nil || len(*vnrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnrlr VirtualNetworkRuleListResult) hasNextLink() bool { - return vnrlr.NextLink != nil && len(*vnrlr.NextLink) != 0 -} - -// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnrlr.NextLink))) -} - -// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. -type VirtualNetworkRuleListResultPage struct { - fn func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) - vnrlr VirtualNetworkRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnrlr) - if err != nil { - return err - } - page.vnrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkRuleListResultPage) NotDone() bool { - return !page.vnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { - return page.vnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { - if page.vnrlr.IsEmpty() { - return nil - } - return *page.vnrlr.Value -} - -// Creates a new instance of the VirtualNetworkRuleListResultPage type. -func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { - return VirtualNetworkRuleListResultPage{ - fn: getNextPage, - vnrlr: cur, - } -} - -// VirtualNetworkRuleProperties properties of a virtual network rule. -type VirtualNetworkRuleProperties struct { - // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` - // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` - // State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' - State VirtualNetworkRuleState `json:"state,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkRuleProperties. -func (vnrp VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnrp.VirtualNetworkSubnetID != nil { - objectMap["virtualNetworkSubnetId"] = vnrp.VirtualNetworkSubnetID - } - if vnrp.IgnoreMissingVnetServiceEndpoint != nil { - objectMap["ignoreMissingVnetServiceEndpoint"] = vnrp.IgnoreMissingVnetServiceEndpoint - } - return json.Marshal(objectMap) -} - -// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkRulesClient) (VirtualNetworkRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkRulesCreateOrUpdateFuture.Result. -func (future *VirtualNetworkRulesCreateOrUpdateFuture) result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vnr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.VirtualNetworkRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vnr.Response.Response, err = future.GetResult(sender); err == nil && vnr.Response.Response.StatusCode != http.StatusNoContent { - vnr, err = client.CreateOrUpdateResponder(vnr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesCreateOrUpdateFuture", "Result", vnr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkRulesDeleteFuture.Result. -func (future *VirtualNetworkRulesDeleteFuture) result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("mariadb.VirtualNetworkRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// WaitStatistic represents a Wait Statistic. -type WaitStatistic struct { - autorest.Response `json:"-"` - // WaitStatisticProperties - The properties of a wait statistic. - *WaitStatisticProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for WaitStatistic. -func (ws WaitStatistic) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ws.WaitStatisticProperties != nil { - objectMap["properties"] = ws.WaitStatisticProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WaitStatistic struct. -func (ws *WaitStatistic) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var waitStatisticProperties WaitStatisticProperties - err = json.Unmarshal(*v, &waitStatisticProperties) - if err != nil { - return err - } - ws.WaitStatisticProperties = &waitStatisticProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ws.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ws.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ws.Type = &typeVar - } - } - } - - return nil -} - -// WaitStatisticProperties the properties of a wait statistic. -type WaitStatisticProperties struct { - // StartTime - Observation start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Observation end time. - EndTime *date.Time `json:"endTime,omitempty"` - // EventName - Wait event name. - EventName *string `json:"eventName,omitempty"` - // EventTypeName - Wait event type name. - EventTypeName *string `json:"eventTypeName,omitempty"` - // QueryID - Database query identifier. - QueryID *int64 `json:"queryId,omitempty"` - // DatabaseName - Database Name. - DatabaseName *string `json:"databaseName,omitempty"` - // UserID - Database user identifier. - UserID *int64 `json:"userId,omitempty"` - // Count - Wait event count observed in this time interval. - Count *int64 `json:"count,omitempty"` - // TotalTimeInMs - Total time of wait in milliseconds in this time interval. - TotalTimeInMs *float64 `json:"totalTimeInMs,omitempty"` -} - -// WaitStatisticsInput input to get wait statistics -type WaitStatisticsInput struct { - // WaitStatisticsInputProperties - The properties of a wait statistics input. - *WaitStatisticsInputProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for WaitStatisticsInput. -func (wsi WaitStatisticsInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wsi.WaitStatisticsInputProperties != nil { - objectMap["properties"] = wsi.WaitStatisticsInputProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WaitStatisticsInput struct. -func (wsi *WaitStatisticsInput) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var waitStatisticsInputProperties WaitStatisticsInputProperties - err = json.Unmarshal(*v, &waitStatisticsInputProperties) - if err != nil { - return err - } - wsi.WaitStatisticsInputProperties = &waitStatisticsInputProperties - } - } - } - - return nil -} - -// WaitStatisticsInputProperties the properties for input to get wait statistics -type WaitStatisticsInputProperties struct { - // ObservationStartTime - Observation start time. - ObservationStartTime *date.Time `json:"observationStartTime,omitempty"` - // ObservationEndTime - Observation end time. - ObservationEndTime *date.Time `json:"observationEndTime,omitempty"` - // AggregationWindow - Aggregation interval type in ISO 8601 format. - AggregationWindow *string `json:"aggregationWindow,omitempty"` -} - -// WaitStatisticsResultList a list of wait statistics. -type WaitStatisticsResultList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of wait statistics. - Value *[]WaitStatistic `json:"value,omitempty"` - // NextLink - READ-ONLY; Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for WaitStatisticsResultList. -func (wsrl WaitStatisticsResultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// WaitStatisticsResultListIterator provides access to a complete listing of WaitStatistic values. -type WaitStatisticsResultListIterator struct { - i int - page WaitStatisticsResultListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *WaitStatisticsResultListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsResultListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WaitStatisticsResultListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WaitStatisticsResultListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter WaitStatisticsResultListIterator) Response() WaitStatisticsResultList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter WaitStatisticsResultListIterator) Value() WaitStatistic { - if !iter.page.NotDone() { - return WaitStatistic{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WaitStatisticsResultListIterator type. -func NewWaitStatisticsResultListIterator(page WaitStatisticsResultListPage) WaitStatisticsResultListIterator { - return WaitStatisticsResultListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wsrl WaitStatisticsResultList) IsEmpty() bool { - return wsrl.Value == nil || len(*wsrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wsrl WaitStatisticsResultList) hasNextLink() bool { - return wsrl.NextLink != nil && len(*wsrl.NextLink) != 0 -} - -// waitStatisticsResultListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wsrl WaitStatisticsResultList) waitStatisticsResultListPreparer(ctx context.Context) (*http.Request, error) { - if !wsrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wsrl.NextLink))) -} - -// WaitStatisticsResultListPage contains a page of WaitStatistic values. -type WaitStatisticsResultListPage struct { - fn func(context.Context, WaitStatisticsResultList) (WaitStatisticsResultList, error) - wsrl WaitStatisticsResultList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *WaitStatisticsResultListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsResultListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wsrl) - if err != nil { - return err - } - page.wsrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *WaitStatisticsResultListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WaitStatisticsResultListPage) NotDone() bool { - return !page.wsrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WaitStatisticsResultListPage) Response() WaitStatisticsResultList { - return page.wsrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WaitStatisticsResultListPage) Values() []WaitStatistic { - if page.wsrl.IsEmpty() { - return nil - } - return *page.wsrl.Value -} - -// Creates a new instance of the WaitStatisticsResultListPage type. -func NewWaitStatisticsResultListPage(cur WaitStatisticsResultList, getNextPage func(context.Context, WaitStatisticsResultList) (WaitStatisticsResultList, error)) WaitStatisticsResultListPage { - return WaitStatisticsResultListPage{ - fn: getNextPage, - wsrl: cur, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/operations.go deleted file mode 100644 index 46b3fc07f95f2..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/operations.go +++ /dev/null @@ -1,100 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and configurations -// with new business model. -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available REST API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.OperationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.OperationsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.DBForMariaDB/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/privateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/privateendpointconnections.go deleted file mode 100644 index c3b83dc4828e0..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/privateendpointconnections.go +++ /dev/null @@ -1,532 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateEndpointConnectionsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type PrivateEndpointConnectionsClient struct { - BaseClient -} - -// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. -func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { - return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { - return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate approve or reject a private endpoint connection with a given name. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState.Status", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState.Description", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a private endpoint connection with a given name. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.PrivateEndpointConnectionsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a private endpoint connection. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// privateEndpointConnectionName - the name of the private endpoint connection. -func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.PrivateEndpointConnectionsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets all private endpoint connections on a server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client PrivateEndpointConnectionsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result PrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByServer") - defer func() { - sc := -1 - if result.peclr.Response.Response != nil { - sc = result.peclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.PrivateEndpointConnectionsClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.peclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.peclr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.peclr.hasNextLink() && result.peclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client PrivateEndpointConnectionsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) ListByServerResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client PrivateEndpointConnectionsClient) listByServerNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { - req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateEndpointConnectionsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result PrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -} - -// UpdateTags updates private endpoint connection with the specified tags. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// parameters - parameters supplied to the Update private endpoint connection Tags operation. -func (client PrivateEndpointConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject) (result PrivateEndpointConnectionsUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.PrivateEndpointConnectionsClient", "UpdateTags", err.Error()) - } - - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateEndpointConnectionsClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client PrivateEndpointConnectionsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) UpdateTagsSender(req *http.Request) (future PrivateEndpointConnectionsUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) UpdateTagsResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/privatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/privatelinkresources.go deleted file mode 100644 index 64801789e0c8d..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/privatelinkresources.go +++ /dev/null @@ -1,251 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateLinkResourcesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type PrivateLinkResourcesClient struct { - BaseClient -} - -// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. -func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { - return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { - return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a private link resource for MariaDB server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// groupName - the name of the private link resource. -func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, serverName string, groupName string) (result PrivateLinkResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.PrivateLinkResourcesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, groupName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, groupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "groupName": autorest.Encode("path", groupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateLinkResources/{groupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets the private link resources for MariaDB server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client PrivateLinkResourcesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result PrivateLinkResourceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByServer") - defer func() { - sc := -1 - if result.plrlr.Response.Response != nil { - sc = result.plrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.PrivateLinkResourcesClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.plrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.plrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.plrlr.hasNextLink() && result.plrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client PrivateLinkResourcesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateLinkResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkResourcesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client PrivateLinkResourcesClient) ListByServerResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client PrivateLinkResourcesClient) listByServerNextResults(ctx context.Context, lastResults PrivateLinkResourceListResult) (result PrivateLinkResourceListResult, err error) { - req, err := lastResults.privateLinkResourceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.PrivateLinkResourcesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkResourcesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result PrivateLinkResourceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/querytexts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/querytexts.go deleted file mode 100644 index a627580963b39..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/querytexts.go +++ /dev/null @@ -1,254 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// QueryTextsClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and configurations -// with new business model. -type QueryTextsClient struct { - BaseClient -} - -// NewQueryTextsClient creates an instance of the QueryTextsClient client. -func NewQueryTextsClient(subscriptionID string) QueryTextsClient { - return NewQueryTextsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewQueryTextsClientWithBaseURI creates an instance of the QueryTextsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewQueryTextsClientWithBaseURI(baseURI string, subscriptionID string) QueryTextsClient { - return QueryTextsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the Query-Store query texts for the queryId. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// queryID - the Query-Store query identifier. -func (client QueryTextsClient) Get(ctx context.Context, resourceGroupName string, serverName string, queryID string) (result QueryText, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.QueryTextsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, queryID) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client QueryTextsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, queryID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "queryId": autorest.Encode("path", queryID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/queryTexts/{queryId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client QueryTextsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client QueryTextsClient) GetResponder(resp *http.Response) (result QueryText, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer retrieve the Query-Store query texts for specified queryIds. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// queryIds - the query identifiers -func (client QueryTextsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, queryIds []string) (result QueryTextsResultListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsClient.ListByServer") - defer func() { - sc := -1 - if result.qtrl.Response.Response != nil { - sc = result.qtrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: queryIds, - Constraints: []validation.Constraint{{Target: "queryIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.QueryTextsClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName, queryIds) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.qtrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.qtrl, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.qtrl.hasNextLink() && result.qtrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client QueryTextsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string, queryIds []string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "queryIds": queryIds, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/queryTexts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client QueryTextsClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client QueryTextsClient) ListByServerResponder(resp *http.Response) (result QueryTextsResultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client QueryTextsClient) listByServerNextResults(ctx context.Context, lastResults QueryTextsResultList) (result QueryTextsResultList, err error) { - req, err := lastResults.queryTextsResultListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.QueryTextsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client QueryTextsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, queryIds []string) (result QueryTextsResultListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName, queryIds) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/recommendedactions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/recommendedactions.go deleted file mode 100644 index cfbd8f46bfa05..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/recommendedactions.go +++ /dev/null @@ -1,259 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RecommendedActionsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type RecommendedActionsClient struct { - BaseClient -} - -// NewRecommendedActionsClient creates an instance of the RecommendedActionsClient client. -func NewRecommendedActionsClient(subscriptionID string) RecommendedActionsClient { - return NewRecommendedActionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRecommendedActionsClientWithBaseURI creates an instance of the RecommendedActionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewRecommendedActionsClientWithBaseURI(baseURI string, subscriptionID string) RecommendedActionsClient { - return RecommendedActionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve recommended actions from the advisor. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// advisorName - the advisor name for recommendation action. -// recommendedActionName - the recommended action name. -func (client RecommendedActionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string, recommendedActionName string) (result RecommendationAction, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendedActionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.RecommendedActionsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, advisorName, recommendedActionName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RecommendedActionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, advisorName string, recommendedActionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "advisorName": autorest.Encode("path", advisorName), - "recommendedActionName": autorest.Encode("path", recommendedActionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RecommendedActionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RecommendedActionsClient) GetResponder(resp *http.Response) (result RecommendationAction, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer retrieve recommended actions from the advisor. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// advisorName - the advisor name for recommendation action. -// sessionID - the recommendation action session identifier. -func (client RecommendedActionsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, advisorName string, sessionID string) (result RecommendationActionsResultListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendedActionsClient.ListByServer") - defer func() { - sc := -1 - if result.rarl.Response.Response != nil { - sc = result.rarl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.RecommendedActionsClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName, advisorName, sessionID) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.rarl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.rarl, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.rarl.hasNextLink() && result.rarl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client RecommendedActionsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string, advisorName string, sessionID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "advisorName": autorest.Encode("path", advisorName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(sessionID) > 0 { - queryParameters["sessionId"] = autorest.Encode("query", sessionID) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/recommendedActions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client RecommendedActionsClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client RecommendedActionsClient) ListByServerResponder(resp *http.Response) (result RecommendationActionsResultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client RecommendedActionsClient) listByServerNextResults(ctx context.Context, lastResults RecommendationActionsResultList) (result RecommendationActionsResultList, err error) { - req, err := lastResults.recommendationActionsResultListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.RecommendedActionsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client RecommendedActionsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, advisorName string, sessionID string) (result RecommendationActionsResultListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecommendedActionsClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName, advisorName, sessionID) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/replicas.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/replicas.go deleted file mode 100644 index 93ce74925a16b..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/replicas.go +++ /dev/null @@ -1,120 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ReplicasClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and configurations with -// new business model. -type ReplicasClient struct { - BaseClient -} - -// NewReplicasClient creates an instance of the ReplicasClient client. -func NewReplicasClient(subscriptionID string) ReplicasClient { - return NewReplicasClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewReplicasClientWithBaseURI creates an instance of the ReplicasClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewReplicasClientWithBaseURI(baseURI string, subscriptionID string) ReplicasClient { - return ReplicasClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByServer list all the replicas for a given server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client ReplicasClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ReplicasClient.ListByServer") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ReplicasClient", "ListByServer", err.Error()) - } - - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ReplicasClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.ReplicasClient", "ListByServer", resp, "Failure sending request") - return - } - - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ReplicasClient", "ListByServer", resp, "Failure responding to request") - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client ReplicasClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/replicas", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client ReplicasClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client ReplicasClient) ListByServerResponder(resp *http.Response) (result ServerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/servers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/servers.go deleted file mode 100644 index b13535358ce54..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/servers.go +++ /dev/null @@ -1,649 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServersClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and configurations with -// new business model. -type ServersClient struct { - BaseClient -} - -// NewServersClient creates an instance of the ServersClient client. -func NewServersClient(subscriptionID string) ServersClient { - return NewServersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServersClientWithBaseURI creates an instance of the ServersClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersClient { - return ServersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a new server or updates an existing server. The update action will overwrite the existing server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// parameters - the required parameters for creating or updating a server. -func (client ServersClient) Create(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate) (result ServersCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - }}, - {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServersClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ServersClient) CreatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) CreateSender(req *http.Request) (future ServersCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client ServersClient) CreateResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client ServersClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServersClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServersClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) DeleteSender(req *http.Request) (future ServersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ServersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result Server, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServersClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServersClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServersClient) GetResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all the servers in a given subscription. -func (client ServersClient) List(ctx context.Context) (result ServerListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServersClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBForMariaDB/servers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServersClient) ListResponder(resp *http.Response) (result ServerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup list all the servers in a given resource group. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServerListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServersClient", "ListByResourceGroup", err.Error()) - } - - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ServersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (result ServerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Restart restarts a server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client ServersClient) Restart(ctx context.Context, resourceGroupName string, serverName string) (result ServersRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServersClient", "Restart", err.Error()) - } - - req, err := client.RestartPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client ServersClient) RestartPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) RestartSender(req *http.Request) (future ServersRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client ServersClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates an existing server. The request body can contain one to many of the properties present in the normal -// server definition. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// parameters - the required parameters for updating a server. -func (client ServersClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters) (result ServersUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServersClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServersClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServersClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ServersClient) UpdateSender(req *http.Request) (future ServersUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ServersClient) UpdateResponder(resp *http.Response) (result Server, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/serversecurityalertpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/serversecurityalertpolicies.go deleted file mode 100644 index 8d934a4e58bd1..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/serversecurityalertpolicies.go +++ /dev/null @@ -1,215 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServerSecurityAlertPoliciesClient is the the Microsoft Azure management API provides create, read, update, and -// delete functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files -// and configurations with new business model. -type ServerSecurityAlertPoliciesClient struct { - BaseClient -} - -// NewServerSecurityAlertPoliciesClient creates an instance of the ServerSecurityAlertPoliciesClient client. -func NewServerSecurityAlertPoliciesClient(subscriptionID string) ServerSecurityAlertPoliciesClient { - return NewServerSecurityAlertPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServerSecurityAlertPoliciesClientWithBaseURI creates an instance of the ServerSecurityAlertPoliciesClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewServerSecurityAlertPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerSecurityAlertPoliciesClient { - return ServerSecurityAlertPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a threat detection policy. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// parameters - the server security alert policy. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerSecurityAlertPolicy) (result ServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServerSecurityAlertPoliciesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServerSecurityAlertPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServerSecurityAlertPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerSecurityAlertPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "Default"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServerSecurityAlertPoliciesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ServerSecurityAlertPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get get a server's security alert policy. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerSecurityAlertPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServerSecurityAlertPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.ServerSecurityAlertPoliciesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServerSecurityAlertPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.ServerSecurityAlertPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServerSecurityAlertPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", "Default"), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ServerSecurityAlertPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServerSecurityAlertPoliciesClient) GetResponder(resp *http.Response) (result ServerSecurityAlertPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/topquerystatistics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/topquerystatistics.go deleted file mode 100644 index 01fbea398d8e0..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/topquerystatistics.go +++ /dev/null @@ -1,263 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// TopQueryStatisticsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type TopQueryStatisticsClient struct { - BaseClient -} - -// NewTopQueryStatisticsClient creates an instance of the TopQueryStatisticsClient client. -func NewTopQueryStatisticsClient(subscriptionID string) TopQueryStatisticsClient { - return NewTopQueryStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewTopQueryStatisticsClientWithBaseURI creates an instance of the TopQueryStatisticsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewTopQueryStatisticsClientWithBaseURI(baseURI string, subscriptionID string) TopQueryStatisticsClient { - return TopQueryStatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the query statistic for specified identifier. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// queryStatisticID - the Query Statistic identifier. -func (client TopQueryStatisticsClient) Get(ctx context.Context, resourceGroupName string, serverName string, queryStatisticID string) (result QueryStatistic, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.TopQueryStatisticsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, queryStatisticID) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client TopQueryStatisticsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, queryStatisticID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "queryStatisticId": autorest.Encode("path", queryStatisticID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/topQueryStatistics/{queryStatisticId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client TopQueryStatisticsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client TopQueryStatisticsClient) GetResponder(resp *http.Response) (result QueryStatistic, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer retrieve the Query-Store top queries for specified metric and aggregation. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// parameters - the required parameters for retrieving top query statistics. -func (client TopQueryStatisticsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, parameters TopQueryStatisticsInput) (result TopQueryStatisticsResultListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsClient.ListByServer") - defer func() { - sc := -1 - if result.tqsrl.Response.Response != nil { - sc = result.tqsrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TopQueryStatisticsInputProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.TopQueryStatisticsInputProperties.NumberOfTopQueries", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TopQueryStatisticsInputProperties.AggregationFunction", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TopQueryStatisticsInputProperties.ObservedMetric", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TopQueryStatisticsInputProperties.ObservationStartTime", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TopQueryStatisticsInputProperties.ObservationEndTime", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TopQueryStatisticsInputProperties.AggregationWindow", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("mariadb.TopQueryStatisticsClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.tqsrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.tqsrl, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.tqsrl.hasNextLink() && result.tqsrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client TopQueryStatisticsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string, parameters TopQueryStatisticsInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/topQueryStatistics", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client TopQueryStatisticsClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client TopQueryStatisticsClient) ListByServerResponder(resp *http.Response) (result TopQueryStatisticsResultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client TopQueryStatisticsClient) listByServerNextResults(ctx context.Context, lastResults TopQueryStatisticsResultList) (result TopQueryStatisticsResultList, err error) { - req, err := lastResults.topQueryStatisticsResultListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.TopQueryStatisticsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client TopQueryStatisticsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, parameters TopQueryStatisticsInput) (result TopQueryStatisticsResultListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName, parameters) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/version.go deleted file mode 100644 index 6490eb48c93d9..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package mariadb - -import "github.com/Azure/azure-sdk-for-go/version" - -// 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. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " mariadb/2018-06-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/virtualnetworkrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/virtualnetworkrules.go deleted file mode 100644 index aa9dfb2aa1c88..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/virtualnetworkrules.go +++ /dev/null @@ -1,438 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type VirtualNetworkRulesClient struct { - BaseClient -} - -// NewVirtualNetworkRulesClient creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient { - return NewVirtualNetworkRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkRulesClientWithBaseURI creates an instance of the VirtualNetworkRulesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient { - return VirtualNetworkRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an existing virtual network rule. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// virtualNetworkRuleName - the name of the virtual network rule. -// parameters - the requested virtual Network Rule Resource state. -func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("mariadb.VirtualNetworkRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the virtual network rule with the given name. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// virtualNetworkRuleName - the name of the virtual network rule. -func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.VirtualNetworkRulesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) DeleteSender(req *http.Request) (future VirtualNetworkRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual network rule. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// virtualNetworkRuleName - the name of the virtual network rule. -func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.VirtualNetworkRulesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of virtual network rules in a server. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.ListByServer") - defer func() { - sc := -1 - if result.vnrlr.Response.Response != nil { - sc = result.vnrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.VirtualNetworkRulesClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.vnrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.vnrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.vnrlr.hasNextLink() && result.vnrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client VirtualNetworkRulesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) ListByServerResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client VirtualNetworkRulesClient) listByServerNextResults(ctx context.Context, lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) { - req, err := lastResults.virtualNetworkRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkRulesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRulesClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/waitstatistics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/waitstatistics.go deleted file mode 100644 index dea80dafff8d1..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb/waitstatistics.go +++ /dev/null @@ -1,259 +0,0 @@ -package mariadb - -// 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. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WaitStatisticsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and -// configurations with new business model. -type WaitStatisticsClient struct { - BaseClient -} - -// NewWaitStatisticsClient creates an instance of the WaitStatisticsClient client. -func NewWaitStatisticsClient(subscriptionID string) WaitStatisticsClient { - return NewWaitStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWaitStatisticsClientWithBaseURI creates an instance of the WaitStatisticsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWaitStatisticsClientWithBaseURI(baseURI string, subscriptionID string) WaitStatisticsClient { - return WaitStatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve wait statistics for specified identifier. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// waitStatisticsID - the Wait Statistic identifier. -func (client WaitStatisticsClient) Get(ctx context.Context, resourceGroupName string, serverName string, waitStatisticsID string) (result WaitStatistic, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("mariadb.WaitStatisticsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, waitStatisticsID) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WaitStatisticsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, waitStatisticsID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "waitStatisticsId": autorest.Encode("path", waitStatisticsID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/waitStatistics/{waitStatisticsId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WaitStatisticsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WaitStatisticsClient) GetResponder(resp *http.Response) (result WaitStatistic, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer retrieve wait statistics for specified aggregation window. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// serverName - the name of the server. -// parameters - the required parameters for retrieving wait statistics. -func (client WaitStatisticsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, parameters WaitStatisticsInput) (result WaitStatisticsResultListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsClient.ListByServer") - defer func() { - sc := -1 - if result.wsrl.Response.Response != nil { - sc = result.wsrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.WaitStatisticsInputProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.WaitStatisticsInputProperties.ObservationStartTime", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.WaitStatisticsInputProperties.ObservationEndTime", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.WaitStatisticsInputProperties.AggregationWindow", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("mariadb.WaitStatisticsClient", "ListByServer", err.Error()) - } - - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.wsrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "ListByServer", resp, "Failure sending request") - return - } - - result.wsrl, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "ListByServer", resp, "Failure responding to request") - return - } - if result.wsrl.hasNextLink() && result.wsrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client WaitStatisticsClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string, parameters WaitStatisticsInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/waitStatistics", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client WaitStatisticsClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client WaitStatisticsClient) ListByServerResponder(resp *http.Response) (result WaitStatisticsResultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client WaitStatisticsClient) listByServerNextResults(ctx context.Context, lastResults WaitStatisticsResultList) (result WaitStatisticsResultList, err error) { - req, err := lastResults.waitStatisticsResultListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mariadb.WaitStatisticsClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client WaitStatisticsClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string, parameters WaitStatisticsInput) (result WaitStatisticsResultListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsClient.ListByServer") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName, parameters) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go b/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go index 69ec44474411a..fe0a538066803 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go @@ -113,7 +113,7 @@ func AzureEnvironmentByNameFromEndpoint(ctx context.Context, endpoint string, en // while the array contains values for _, env := range environments { - if strings.EqualFold(env.Name, environmentName) { + if strings.EqualFold(env.Name, environmentName) || (environmentName == "" && len(environments) == 1) { // if resourceManager endpoint is empty, assume it's the provided endpoint if env.ResourceManager == "" { env.ResourceManager = fmt.Sprintf("https://%s/", endpoint) diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/cloud_services_ip_configuration.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/cloud_services_ip_configuration.go new file mode 100644 index 0000000000000..68c8eb8ed75fb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/cloud_services_ip_configuration.go @@ -0,0 +1,163 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = CloudServicesIPConfigurationId{} + +// CloudServicesIPConfigurationId is a struct representing the Resource ID for a Cloud Services I P Configuration +type CloudServicesIPConfigurationId struct { + SubscriptionId string + ResourceGroup string + CloudServiceName string + RoleInstanceName string + NetworkInterfaceName string + IpConfigurationName string +} + +// NewCloudServicesIPConfigurationID returns a new CloudServicesIPConfigurationId struct +func NewCloudServicesIPConfigurationID(subscriptionId string, resourceGroup string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string) CloudServicesIPConfigurationId { + return CloudServicesIPConfigurationId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + CloudServiceName: cloudServiceName, + RoleInstanceName: roleInstanceName, + NetworkInterfaceName: networkInterfaceName, + IpConfigurationName: ipConfigurationName, + } +} + +// ParseCloudServicesIPConfigurationID parses 'input' into a CloudServicesIPConfigurationId +func ParseCloudServicesIPConfigurationID(input string) (*CloudServicesIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(CloudServicesIPConfigurationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CloudServicesIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.CloudServiceName, ok = parsed.Parsed["cloudServiceName"]; !ok { + return nil, fmt.Errorf("the segment 'cloudServiceName' was not found in the resource id %q", input) + } + + if id.RoleInstanceName, ok = parsed.Parsed["roleInstanceName"]; !ok { + return nil, fmt.Errorf("the segment 'roleInstanceName' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCloudServicesIPConfigurationIDInsensitively parses 'input' case-insensitively into a CloudServicesIPConfigurationId +// note: this method should only be used for API response data and not user input +func ParseCloudServicesIPConfigurationIDInsensitively(input string) (*CloudServicesIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(CloudServicesIPConfigurationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CloudServicesIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.CloudServiceName, ok = parsed.Parsed["cloudServiceName"]; !ok { + return nil, fmt.Errorf("the segment 'cloudServiceName' was not found in the resource id %q", input) + } + + if id.RoleInstanceName, ok = parsed.Parsed["roleInstanceName"]; !ok { + return nil, fmt.Errorf("the segment 'roleInstanceName' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCloudServicesIPConfigurationID checks that 'input' can be parsed as a Cloud Services I P Configuration ID +func ValidateCloudServicesIPConfigurationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCloudServicesIPConfigurationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud Services I P Configuration ID +func (id CloudServicesIPConfigurationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s/roleInstances/%s/networkInterfaces/%s/ipConfigurations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.CloudServiceName, id.RoleInstanceName, id.NetworkInterfaceName, id.IpConfigurationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud Services I P Configuration ID +func (id CloudServicesIPConfigurationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("cloudServices", "cloudServices", "cloudServices"), + resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), + resourceids.StaticSegment("roleInstances", "roleInstances", "roleInstances"), + resourceids.UserSpecifiedSegment("roleInstanceName", "roleInstanceValue"), + resourceids.StaticSegment("networkInterfaces", "networkInterfaces", "networkInterfaces"), + resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), + resourceids.StaticSegment("ipConfigurations", "ipConfigurations", "ipConfigurations"), + resourceids.UserSpecifiedSegment("ipConfigurationName", "ipConfigurationValue"), + } +} + +// String returns a human-readable description of this Cloud Services I P Configuration ID +func (id CloudServicesIPConfigurationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), + fmt.Sprintf("Role Instance Name: %q", id.RoleInstanceName), + fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), + fmt.Sprintf("Ip Configuration Name: %q", id.IpConfigurationName), + } + return fmt.Sprintf("Cloud Services I P Configuration (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/cloud_services_public_ip.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/cloud_services_public_ip.go new file mode 100644 index 0000000000000..2c806cd333d02 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/cloud_services_public_ip.go @@ -0,0 +1,176 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = CloudServicesPublicIPAddressId{} + +// CloudServicesPublicIPAddressId is a struct representing the Resource ID for a Cloud Services Public I P Address +type CloudServicesPublicIPAddressId struct { + SubscriptionId string + ResourceGroup string + CloudServiceName string + RoleInstanceName string + NetworkInterfaceName string + IpConfigurationName string + PublicIPAddressName string +} + +// NewCloudServicesPublicIPAddressID returns a new CloudServicesPublicIPAddressId struct +func NewCloudServicesPublicIPAddressID(subscriptionId string, resourceGroup string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string) CloudServicesPublicIPAddressId { + return CloudServicesPublicIPAddressId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + CloudServiceName: cloudServiceName, + RoleInstanceName: roleInstanceName, + NetworkInterfaceName: networkInterfaceName, + IpConfigurationName: ipConfigurationName, + PublicIPAddressName: publicIPAddressName, + } +} + +// ParseCloudServicesPublicIPAddressID parses 'input' into a CloudServicesPublicIPAddressId +func ParseCloudServicesPublicIPAddressID(input string) (*CloudServicesPublicIPAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(CloudServicesPublicIPAddressId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CloudServicesPublicIPAddressId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.CloudServiceName, ok = parsed.Parsed["cloudServiceName"]; !ok { + return nil, fmt.Errorf("the segment 'cloudServiceName' was not found in the resource id %q", input) + } + + if id.RoleInstanceName, ok = parsed.Parsed["roleInstanceName"]; !ok { + return nil, fmt.Errorf("the segment 'roleInstanceName' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + if id.PublicIPAddressName, ok = parsed.Parsed["publicIPAddressName"]; !ok { + return nil, fmt.Errorf("the segment 'publicIPAddressName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCloudServicesPublicIPAddressIDInsensitively parses 'input' case-insensitively into a CloudServicesPublicIPAddressId +// note: this method should only be used for API response data and not user input +func ParseCloudServicesPublicIPAddressIDInsensitively(input string) (*CloudServicesPublicIPAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(CloudServicesPublicIPAddressId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CloudServicesPublicIPAddressId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.CloudServiceName, ok = parsed.Parsed["cloudServiceName"]; !ok { + return nil, fmt.Errorf("the segment 'cloudServiceName' was not found in the resource id %q", input) + } + + if id.RoleInstanceName, ok = parsed.Parsed["roleInstanceName"]; !ok { + return nil, fmt.Errorf("the segment 'roleInstanceName' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + if id.PublicIPAddressName, ok = parsed.Parsed["publicIPAddressName"]; !ok { + return nil, fmt.Errorf("the segment 'publicIPAddressName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCloudServicesPublicIPAddressID checks that 'input' can be parsed as a Cloud Services Public I P Address ID +func ValidateCloudServicesPublicIPAddressID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCloudServicesPublicIPAddressID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud Services Public I P Address ID +func (id CloudServicesPublicIPAddressId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s/roleInstances/%s/networkInterfaces/%s/ipConfigurations/%s/publicIPAddresses/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.CloudServiceName, id.RoleInstanceName, id.NetworkInterfaceName, id.IpConfigurationName, id.PublicIPAddressName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud Services Public I P Address ID +func (id CloudServicesPublicIPAddressId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("cloudServices", "cloudServices", "cloudServices"), + resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), + resourceids.StaticSegment("roleInstances", "roleInstances", "roleInstances"), + resourceids.UserSpecifiedSegment("roleInstanceName", "roleInstanceValue"), + resourceids.StaticSegment("networkInterfaces", "networkInterfaces", "networkInterfaces"), + resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), + resourceids.StaticSegment("ipConfigurations", "ipConfigurations", "ipConfigurations"), + resourceids.UserSpecifiedSegment("ipConfigurationName", "ipConfigurationValue"), + resourceids.StaticSegment("publicIPAddresses", "publicIPAddresses", "publicIPAddresses"), + resourceids.UserSpecifiedSegment("publicIPAddressName", "publicIPAddressValue"), + } +} + +// String returns a human-readable description of this Cloud Services Public I P Address ID +func (id CloudServicesPublicIPAddressId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), + fmt.Sprintf("Role Instance Name: %q", id.RoleInstanceName), + fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), + fmt.Sprintf("Ip Configuration Name: %q", id.IpConfigurationName), + fmt.Sprintf("Public I P Address Name: %q", id.PublicIPAddressName), + } + return fmt.Sprintf("Cloud Services Public I P Address (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/express_route_circuit_peering.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/express_route_circuit_peering.go new file mode 100644 index 0000000000000..3c95470ad5768 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/express_route_circuit_peering.go @@ -0,0 +1,137 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ExpressRouteCircuitPeeringId{} + +// ExpressRouteCircuitPeeringId is a struct representing the Resource ID for a Express Route Circuit Peering +type ExpressRouteCircuitPeeringId struct { + SubscriptionId string + ResourceGroup string + CircuitName string + PeeringName string +} + +// NewExpressRouteCircuitPeeringID returns a new ExpressRouteCircuitPeeringId struct +func NewExpressRouteCircuitPeeringID(subscriptionId string, resourceGroup string, circuitName string, peeringName string) ExpressRouteCircuitPeeringId { + return ExpressRouteCircuitPeeringId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + CircuitName: circuitName, + PeeringName: peeringName, + } +} + +// ParseExpressRouteCircuitPeeringID parses 'input' into a ExpressRouteCircuitPeeringId +func ParseExpressRouteCircuitPeeringID(input string) (*ExpressRouteCircuitPeeringId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitPeeringId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitPeeringId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.CircuitName, ok = parsed.Parsed["circuitName"]; !ok { + return nil, fmt.Errorf("the segment 'circuitName' was not found in the resource id %q", input) + } + + if id.PeeringName, ok = parsed.Parsed["peeringName"]; !ok { + return nil, fmt.Errorf("the segment 'peeringName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseExpressRouteCircuitPeeringIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitPeeringId +// note: this method should only be used for API response data and not user input +func ParseExpressRouteCircuitPeeringIDInsensitively(input string) (*ExpressRouteCircuitPeeringId, error) { + parser := resourceids.NewParserFromResourceIdType(ExpressRouteCircuitPeeringId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ExpressRouteCircuitPeeringId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.CircuitName, ok = parsed.Parsed["circuitName"]; !ok { + return nil, fmt.Errorf("the segment 'circuitName' was not found in the resource id %q", input) + } + + if id.PeeringName, ok = parsed.Parsed["peeringName"]; !ok { + return nil, fmt.Errorf("the segment 'peeringName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateExpressRouteCircuitPeeringID checks that 'input' can be parsed as a Express Route Circuit Peering ID +func ValidateExpressRouteCircuitPeeringID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseExpressRouteCircuitPeeringID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Express Route Circuit Peering ID +func (id ExpressRouteCircuitPeeringId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.CircuitName, id.PeeringName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit Peering ID +func (id ExpressRouteCircuitPeeringId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("expressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), + resourceids.UserSpecifiedSegment("circuitName", "circuitValue"), + resourceids.StaticSegment("peerings", "peerings", "peerings"), + resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), + } +} + +// String returns a human-readable description of this Express Route Circuit Peering ID +func (id ExpressRouteCircuitPeeringId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Circuit Name: %q", id.CircuitName), + fmt.Sprintf("Peering Name: %q", id.PeeringName), + } + return fmt.Sprintf("Express Route Circuit Peering (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/network_interface.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/network_interface.go new file mode 100644 index 0000000000000..a54f1c25aeac8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/network_interface.go @@ -0,0 +1,124 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetworkInterfaceId{} + +// NetworkInterfaceId is a struct representing the Resource ID for a Network Interface +type NetworkInterfaceId struct { + SubscriptionId string + ResourceGroup string + NetworkInterfaceName string +} + +// NewNetworkInterfaceID returns a new NetworkInterfaceId struct +func NewNetworkInterfaceID(subscriptionId string, resourceGroup string, networkInterfaceName string) NetworkInterfaceId { + return NetworkInterfaceId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + NetworkInterfaceName: networkInterfaceName, + } +} + +// ParseNetworkInterfaceID parses 'input' into a NetworkInterfaceId +func ParseNetworkInterfaceID(input string) (*NetworkInterfaceId, error) { + parser := resourceids.NewParserFromResourceIdType(NetworkInterfaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetworkInterfaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetworkInterfaceIDInsensitively parses 'input' case-insensitively into a NetworkInterfaceId +// note: this method should only be used for API response data and not user input +func ParseNetworkInterfaceIDInsensitively(input string) (*NetworkInterfaceId, error) { + parser := resourceids.NewParserFromResourceIdType(NetworkInterfaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetworkInterfaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetworkInterfaceID checks that 'input' can be parsed as a Network Interface ID +func ValidateNetworkInterfaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetworkInterfaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Network Interface ID +func (id NetworkInterfaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkInterfaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.NetworkInterfaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Network Interface ID +func (id NetworkInterfaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("networkInterfaces", "networkInterfaces", "networkInterfaces"), + resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), + } +} + +// String returns a human-readable description of this Network Interface ID +func (id NetworkInterfaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), + } + return fmt.Sprintf("Network Interface (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/network_interface_ip_configuration.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/network_interface_ip_configuration.go new file mode 100644 index 0000000000000..5f8d41be65ccf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/network_interface_ip_configuration.go @@ -0,0 +1,137 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetworkInterfaceIPConfigurationId{} + +// NetworkInterfaceIPConfigurationId is a struct representing the Resource ID for a Network Interface I P Configuration +type NetworkInterfaceIPConfigurationId struct { + SubscriptionId string + ResourceGroup string + NetworkInterfaceName string + IpConfigurationName string +} + +// NewNetworkInterfaceIPConfigurationID returns a new NetworkInterfaceIPConfigurationId struct +func NewNetworkInterfaceIPConfigurationID(subscriptionId string, resourceGroup string, networkInterfaceName string, ipConfigurationName string) NetworkInterfaceIPConfigurationId { + return NetworkInterfaceIPConfigurationId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + NetworkInterfaceName: networkInterfaceName, + IpConfigurationName: ipConfigurationName, + } +} + +// ParseNetworkInterfaceIPConfigurationID parses 'input' into a NetworkInterfaceIPConfigurationId +func ParseNetworkInterfaceIPConfigurationID(input string) (*NetworkInterfaceIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(NetworkInterfaceIPConfigurationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetworkInterfaceIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetworkInterfaceIPConfigurationIDInsensitively parses 'input' case-insensitively into a NetworkInterfaceIPConfigurationId +// note: this method should only be used for API response data and not user input +func ParseNetworkInterfaceIPConfigurationIDInsensitively(input string) (*NetworkInterfaceIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(NetworkInterfaceIPConfigurationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetworkInterfaceIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetworkInterfaceIPConfigurationID checks that 'input' can be parsed as a Network Interface I P Configuration ID +func ValidateNetworkInterfaceIPConfigurationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetworkInterfaceIPConfigurationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Network Interface I P Configuration ID +func (id NetworkInterfaceIPConfigurationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkInterfaces/%s/ipConfigurations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.NetworkInterfaceName, id.IpConfigurationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Network Interface I P Configuration ID +func (id NetworkInterfaceIPConfigurationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("networkInterfaces", "networkInterfaces", "networkInterfaces"), + resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), + resourceids.StaticSegment("ipConfigurations", "ipConfigurations", "ipConfigurations"), + resourceids.UserSpecifiedSegment("ipConfigurationName", "ipConfigurationValue"), + } +} + +// String returns a human-readable description of this Network Interface I P Configuration ID +func (id NetworkInterfaceIPConfigurationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), + fmt.Sprintf("Ip Configuration Name: %q", id.IpConfigurationName), + } + return fmt.Sprintf("Network Interface I P Configuration (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/public_ip_address.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/public_ip_address.go new file mode 100644 index 0000000000000..6628ac25826f5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/public_ip_address.go @@ -0,0 +1,124 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = PublicIPAddressId{} + +// PublicIPAddressId is a struct representing the Resource ID for a Public I P Address +type PublicIPAddressId struct { + SubscriptionId string + ResourceGroup string + PublicIPAddressesName string +} + +// NewPublicIPAddressID returns a new PublicIPAddressId struct +func NewPublicIPAddressID(subscriptionId string, resourceGroup string, publicIPAddressesName string) PublicIPAddressId { + return PublicIPAddressId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + PublicIPAddressesName: publicIPAddressesName, + } +} + +// ParsePublicIPAddressID parses 'input' into a PublicIPAddressId +func ParsePublicIPAddressID(input string) (*PublicIPAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(PublicIPAddressId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PublicIPAddressId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.PublicIPAddressesName, ok = parsed.Parsed["publicIPAddressesName"]; !ok { + return nil, fmt.Errorf("the segment 'publicIPAddressesName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParsePublicIPAddressIDInsensitively parses 'input' case-insensitively into a PublicIPAddressId +// note: this method should only be used for API response data and not user input +func ParsePublicIPAddressIDInsensitively(input string) (*PublicIPAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(PublicIPAddressId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := PublicIPAddressId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.PublicIPAddressesName, ok = parsed.Parsed["publicIPAddressesName"]; !ok { + return nil, fmt.Errorf("the segment 'publicIPAddressesName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidatePublicIPAddressID checks that 'input' can be parsed as a Public I P Address ID +func ValidatePublicIPAddressID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParsePublicIPAddressID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Public I P Address ID +func (id PublicIPAddressId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.PublicIPAddressesName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Public I P Address ID +func (id PublicIPAddressId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("publicIPAddresses", "publicIPAddresses", "publicIPAddresses"), + resourceids.UserSpecifiedSegment("publicIPAddressesName", "publicIPAddressesValue"), + } +} + +// String returns a human-readable description of this Public I P Address ID +func (id PublicIPAddressId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Public I P Addresses Name: %q", id.PublicIPAddressesName), + } + return fmt.Sprintf("Public I P Address (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_hub_bgp_connection.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_hub_bgp_connection.go new file mode 100644 index 0000000000000..c72f9c7e35a06 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_hub_bgp_connection.go @@ -0,0 +1,137 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualHubBGPConnectionId{} + +// VirtualHubBGPConnectionId is a struct representing the Resource ID for a Virtual Hub B G P Connection +type VirtualHubBGPConnectionId struct { + SubscriptionId string + ResourceGroup string + HubName string + ConnectionName string +} + +// NewVirtualHubBGPConnectionID returns a new VirtualHubBGPConnectionId struct +func NewVirtualHubBGPConnectionID(subscriptionId string, resourceGroup string, hubName string, connectionName string) VirtualHubBGPConnectionId { + return VirtualHubBGPConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + HubName: hubName, + ConnectionName: connectionName, + } +} + +// ParseVirtualHubBGPConnectionID parses 'input' into a VirtualHubBGPConnectionId +func ParseVirtualHubBGPConnectionID(input string) (*VirtualHubBGPConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualHubBGPConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualHubBGPConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.HubName, ok = parsed.Parsed["hubName"]; !ok { + return nil, fmt.Errorf("the segment 'hubName' was not found in the resource id %q", input) + } + + if id.ConnectionName, ok = parsed.Parsed["connectionName"]; !ok { + return nil, fmt.Errorf("the segment 'connectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualHubBGPConnectionIDInsensitively parses 'input' case-insensitively into a VirtualHubBGPConnectionId +// note: this method should only be used for API response data and not user input +func ParseVirtualHubBGPConnectionIDInsensitively(input string) (*VirtualHubBGPConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualHubBGPConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualHubBGPConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.HubName, ok = parsed.Parsed["hubName"]; !ok { + return nil, fmt.Errorf("the segment 'hubName' was not found in the resource id %q", input) + } + + if id.ConnectionName, ok = parsed.Parsed["connectionName"]; !ok { + return nil, fmt.Errorf("the segment 'connectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualHubBGPConnectionID checks that 'input' can be parsed as a Virtual Hub B G P Connection ID +func ValidateVirtualHubBGPConnectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualHubBGPConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Hub B G P Connection ID +func (id VirtualHubBGPConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/bgpConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.HubName, id.ConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Hub B G P Connection ID +func (id VirtualHubBGPConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("virtualHubs", "virtualHubs", "virtualHubs"), + resourceids.UserSpecifiedSegment("hubName", "hubValue"), + resourceids.StaticSegment("bgpConnections", "bgpConnections", "bgpConnections"), + resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), + } +} + +// String returns a human-readable description of this Virtual Hub B G P Connection ID +func (id VirtualHubBGPConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Hub Name: %q", id.HubName), + fmt.Sprintf("Connection Name: %q", id.ConnectionName), + } + return fmt.Sprintf("Virtual Hub B G P Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_hub_ip_configuration.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_hub_ip_configuration.go new file mode 100644 index 0000000000000..fd939b70d7029 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_hub_ip_configuration.go @@ -0,0 +1,137 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualHubIPConfigurationId{} + +// VirtualHubIPConfigurationId is a struct representing the Resource ID for a Virtual Hub I P Configuration +type VirtualHubIPConfigurationId struct { + SubscriptionId string + ResourceGroup string + VirtualHubName string + IpConfigName string +} + +// NewVirtualHubIPConfigurationID returns a new VirtualHubIPConfigurationId struct +func NewVirtualHubIPConfigurationID(subscriptionId string, resourceGroup string, virtualHubName string, ipConfigName string) VirtualHubIPConfigurationId { + return VirtualHubIPConfigurationId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + VirtualHubName: virtualHubName, + IpConfigName: ipConfigName, + } +} + +// ParseVirtualHubIPConfigurationID parses 'input' into a VirtualHubIPConfigurationId +func ParseVirtualHubIPConfigurationID(input string) (*VirtualHubIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualHubIPConfigurationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualHubIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualHubName, ok = parsed.Parsed["virtualHubName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualHubName' was not found in the resource id %q", input) + } + + if id.IpConfigName, ok = parsed.Parsed["ipConfigName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualHubIPConfigurationIDInsensitively parses 'input' case-insensitively into a VirtualHubIPConfigurationId +// note: this method should only be used for API response data and not user input +func ParseVirtualHubIPConfigurationIDInsensitively(input string) (*VirtualHubIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualHubIPConfigurationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualHubIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualHubName, ok = parsed.Parsed["virtualHubName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualHubName' was not found in the resource id %q", input) + } + + if id.IpConfigName, ok = parsed.Parsed["ipConfigName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualHubIPConfigurationID checks that 'input' can be parsed as a Virtual Hub I P Configuration ID +func ValidateVirtualHubIPConfigurationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualHubIPConfigurationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Hub I P Configuration ID +func (id VirtualHubIPConfigurationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/ipConfigurations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.VirtualHubName, id.IpConfigName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Hub I P Configuration ID +func (id VirtualHubIPConfigurationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("virtualHubs", "virtualHubs", "virtualHubs"), + resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), + resourceids.StaticSegment("ipConfigurations", "ipConfigurations", "ipConfigurations"), + resourceids.UserSpecifiedSegment("ipConfigName", "ipConfigValue"), + } +} + +// String returns a human-readable description of this Virtual Hub I P Configuration ID +func (id VirtualHubIPConfigurationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), + fmt.Sprintf("Ip Config Name: %q", id.IpConfigName), + } + return fmt.Sprintf("Virtual Hub I P Configuration (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_ip_configuration.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_ip_configuration.go new file mode 100644 index 0000000000000..a0c7e983c6e87 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_ip_configuration.go @@ -0,0 +1,163 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualMachineScaleSetIPConfigurationId{} + +// VirtualMachineScaleSetIPConfigurationId is a struct representing the Resource ID for a Virtual Machine Scale Set Public I P Address +type VirtualMachineScaleSetIPConfigurationId struct { + SubscriptionId string + ResourceGroup string + VirtualMachineScaleSetName string + VirtualMachineIndex string + NetworkInterfaceName string + IpConfigurationName string +} + +// NewVirtualMachineScaleSetIPConfigurationId returns a new VirtualMachineScaleSetIPConfigurationId struct +func NewVirtualMachineScaleSetIPConfigurationID(subscriptionId string, resourceGroup string, virtualMachineScaleSetName string, virtualMachineIndex string, networkInterfaceName string, ipConfigurationName string) VirtualMachineScaleSetIPConfigurationId { + return VirtualMachineScaleSetIPConfigurationId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + VirtualMachineScaleSetName: virtualMachineScaleSetName, + VirtualMachineIndex: virtualMachineIndex, + NetworkInterfaceName: networkInterfaceName, + IpConfigurationName: ipConfigurationName, + } +} + +// ParseVirtualMachineScaleSetIPConfigurationId parses 'input' into a VirtualMachineScaleSetIPConfigurationId +func ParseVirtualMachineScaleSetIPConfigurationId(input string) (*VirtualMachineScaleSetIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineScaleSetIPConfigurationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineScaleSetIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualMachineScaleSetName, ok = parsed.Parsed["virtualMachineScaleSetName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineScaleSetName' was not found in the resource id %q", input) + } + + if id.VirtualMachineIndex, ok = parsed.Parsed["virtualMachineIndex"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineIndex' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualMachineScaleSetIPConfigurationIdInsensitively parses 'input' case-insensitively into a VirtualMachineScaleSetIPConfigurationId +// note: this method should only be used for API response data and not user input +func ParseVirtualMachineScaleSetIPConfigurationIdInsensitively(input string) (*VirtualMachineScaleSetIPConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineScaleSetIPConfigurationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineScaleSetIPConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualMachineScaleSetName, ok = parsed.Parsed["virtualMachineScaleSetName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineScaleSetName' was not found in the resource id %q", input) + } + + if id.VirtualMachineIndex, ok = parsed.Parsed["virtualMachineIndex"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineIndex' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualMachineScaleSetIPConfigurationId checks that 'input' can be parsed as a Virtual Machine Scale Set Public I P Address ID +func ValidateVirtualMachineScaleSetIPConfigurationId(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualMachineScaleSetIPConfigurationId(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Machine Scale Set Public I P Address ID +func (id VirtualMachineScaleSetIPConfigurationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s/networkInterfaces/%s/ipConfigurations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.VirtualMachineScaleSetName, id.VirtualMachineIndex, id.NetworkInterfaceName, id.IpConfigurationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Scale Set Public I P Address ID +func (id VirtualMachineScaleSetIPConfigurationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("virtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), + resourceids.StaticSegment("virtualMachines", "virtualMachines", "virtualMachines"), + resourceids.UserSpecifiedSegment("virtualMachineIndex", "virtualMachineIndexValue"), + resourceids.StaticSegment("networkInterfaces", "networkInterfaces", "networkInterfaces"), + resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), + resourceids.StaticSegment("ipConfigurations", "ipConfigurations", "ipConfigurations"), + resourceids.UserSpecifiedSegment("ipConfigurationName", "ipConfigurationValue"), + } +} + +// String returns a human-readable description of this Virtual Machine Scale Set Public I P Address ID +func (id VirtualMachineScaleSetIPConfigurationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), + fmt.Sprintf("Virtual Machine Index: %q", id.VirtualMachineIndex), + fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), + fmt.Sprintf("Ip Configuration Name: %q", id.IpConfigurationName), + } + return fmt.Sprintf("Virtual Machine Scale Set IP Configuration (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_network_interface.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_network_interface.go new file mode 100644 index 0000000000000..ba6237064ab43 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_network_interface.go @@ -0,0 +1,150 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualMachineScaleSetNetworkInterfaceId{} + +// VirtualMachineScaleSetNetworkInterfaceId is a struct representing the Resource ID for a Virtual Machine Scale Set Network Interface +type VirtualMachineScaleSetNetworkInterfaceId struct { + SubscriptionId string + ResourceGroup string + VirtualMachineScaleSetName string + VirtualMachineIndex string + NetworkInterfaceName string +} + +// NewVirtualMachineScaleSetNetworkInterfaceID returns a new VirtualMachineScaleSetNetworkInterfaceId struct +func NewVirtualMachineScaleSetNetworkInterfaceID(subscriptionId string, resourceGroup string, virtualMachineScaleSetName string, virtualMachineIndex string, networkInterfaceName string) VirtualMachineScaleSetNetworkInterfaceId { + return VirtualMachineScaleSetNetworkInterfaceId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + VirtualMachineScaleSetName: virtualMachineScaleSetName, + VirtualMachineIndex: virtualMachineIndex, + NetworkInterfaceName: networkInterfaceName, + } +} + +// ParseVirtualMachineScaleSetNetworkInterfaceID parses 'input' into a VirtualMachineScaleSetNetworkInterfaceId +func ParseVirtualMachineScaleSetNetworkInterfaceID(input string) (*VirtualMachineScaleSetNetworkInterfaceId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineScaleSetNetworkInterfaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineScaleSetNetworkInterfaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualMachineScaleSetName, ok = parsed.Parsed["virtualMachineScaleSetName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineScaleSetName' was not found in the resource id %q", input) + } + + if id.VirtualMachineIndex, ok = parsed.Parsed["virtualMachineIndex"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineIndex' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualMachineScaleSetNetworkInterfaceIDInsensitively parses 'input' case-insensitively into a VirtualMachineScaleSetNetworkInterfaceId +// note: this method should only be used for API response data and not user input +func ParseVirtualMachineScaleSetNetworkInterfaceIDInsensitively(input string) (*VirtualMachineScaleSetNetworkInterfaceId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineScaleSetNetworkInterfaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineScaleSetNetworkInterfaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualMachineScaleSetName, ok = parsed.Parsed["virtualMachineScaleSetName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineScaleSetName' was not found in the resource id %q", input) + } + + if id.VirtualMachineIndex, ok = parsed.Parsed["virtualMachineIndex"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineIndex' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualMachineScaleSetNetworkInterfaceID checks that 'input' can be parsed as a Virtual Machine Scale Set Network Interface ID +func ValidateVirtualMachineScaleSetNetworkInterfaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualMachineScaleSetNetworkInterfaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Machine Scale Set Network Interface ID +func (id VirtualMachineScaleSetNetworkInterfaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s/networkInterfaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.VirtualMachineScaleSetName, id.VirtualMachineIndex, id.NetworkInterfaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Scale Set Network Interface ID +func (id VirtualMachineScaleSetNetworkInterfaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("virtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), + resourceids.StaticSegment("virtualMachines", "virtualMachines", "virtualMachines"), + resourceids.UserSpecifiedSegment("virtualMachineIndex", "virtualMachineIndexValue"), + resourceids.StaticSegment("networkInterfaces", "networkInterfaces", "networkInterfaces"), + resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), + } +} + +// String returns a human-readable description of this Virtual Machine Scale Set Network Interface ID +func (id VirtualMachineScaleSetNetworkInterfaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), + fmt.Sprintf("Virtual Machine Index: %q", id.VirtualMachineIndex), + fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), + } + return fmt.Sprintf("Virtual Machine Scale Set Network Interface (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_public_ip_address.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_public_ip_address.go new file mode 100644 index 0000000000000..baf3b011e49b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_machine_scale_set_public_ip_address.go @@ -0,0 +1,176 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualMachineScaleSetPublicIPAddressId{} + +// VirtualMachineScaleSetPublicIPAddressId is a struct representing the Resource ID for a Virtual Machine Scale Set Public I P Address +type VirtualMachineScaleSetPublicIPAddressId struct { + SubscriptionId string + ResourceGroup string + VirtualMachineScaleSetName string + VirtualMachineIndex string + NetworkInterfaceName string + IpConfigurationName string + PublicIpAddressName string +} + +// NewVirtualMachineScaleSetPublicIPAddressID returns a new VirtualMachineScaleSetPublicIPAddressId struct +func NewVirtualMachineScaleSetPublicIPAddressID(subscriptionId string, resourceGroup string, virtualMachineScaleSetName string, virtualMachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIpAddressName string) VirtualMachineScaleSetPublicIPAddressId { + return VirtualMachineScaleSetPublicIPAddressId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + VirtualMachineScaleSetName: virtualMachineScaleSetName, + VirtualMachineIndex: virtualMachineIndex, + NetworkInterfaceName: networkInterfaceName, + IpConfigurationName: ipConfigurationName, + PublicIpAddressName: publicIpAddressName, + } +} + +// ParseVirtualMachineScaleSetPublicIPAddressID parses 'input' into a VirtualMachineScaleSetPublicIPAddressId +func ParseVirtualMachineScaleSetPublicIPAddressID(input string) (*VirtualMachineScaleSetPublicIPAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineScaleSetPublicIPAddressId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineScaleSetPublicIPAddressId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualMachineScaleSetName, ok = parsed.Parsed["virtualMachineScaleSetName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineScaleSetName' was not found in the resource id %q", input) + } + + if id.VirtualMachineIndex, ok = parsed.Parsed["virtualMachineIndex"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineIndex' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + if id.PublicIpAddressName, ok = parsed.Parsed["publicIpAddressName"]; !ok { + return nil, fmt.Errorf("the segment 'publicIpAddressName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualMachineScaleSetPublicIPAddressIDInsensitively parses 'input' case-insensitively into a VirtualMachineScaleSetPublicIPAddressId +// note: this method should only be used for API response data and not user input +func ParseVirtualMachineScaleSetPublicIPAddressIDInsensitively(input string) (*VirtualMachineScaleSetPublicIPAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineScaleSetPublicIPAddressId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineScaleSetPublicIPAddressId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualMachineScaleSetName, ok = parsed.Parsed["virtualMachineScaleSetName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineScaleSetName' was not found in the resource id %q", input) + } + + if id.VirtualMachineIndex, ok = parsed.Parsed["virtualMachineIndex"]; !ok { + return nil, fmt.Errorf("the segment 'virtualMachineIndex' was not found in the resource id %q", input) + } + + if id.NetworkInterfaceName, ok = parsed.Parsed["networkInterfaceName"]; !ok { + return nil, fmt.Errorf("the segment 'networkInterfaceName' was not found in the resource id %q", input) + } + + if id.IpConfigurationName, ok = parsed.Parsed["ipConfigurationName"]; !ok { + return nil, fmt.Errorf("the segment 'ipConfigurationName' was not found in the resource id %q", input) + } + + if id.PublicIpAddressName, ok = parsed.Parsed["publicIpAddressName"]; !ok { + return nil, fmt.Errorf("the segment 'publicIpAddressName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualMachineScaleSetPublicIPAddressID checks that 'input' can be parsed as a Virtual Machine Scale Set Public I P Address ID +func ValidateVirtualMachineScaleSetPublicIPAddressID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualMachineScaleSetPublicIPAddressID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Machine Scale Set Public I P Address ID +func (id VirtualMachineScaleSetPublicIPAddressId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s/networkInterfaces/%s/ipConfigurations/%s/publicIPAddresses/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.VirtualMachineScaleSetName, id.VirtualMachineIndex, id.NetworkInterfaceName, id.IpConfigurationName, id.PublicIpAddressName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Scale Set Public I P Address ID +func (id VirtualMachineScaleSetPublicIPAddressId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("virtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), + resourceids.StaticSegment("virtualMachines", "virtualMachines", "virtualMachines"), + resourceids.UserSpecifiedSegment("virtualMachineIndex", "virtualMachineIndexValue"), + resourceids.StaticSegment("networkInterfaces", "networkInterfaces", "networkInterfaces"), + resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), + resourceids.StaticSegment("ipConfigurations", "ipConfigurations", "ipConfigurations"), + resourceids.UserSpecifiedSegment("ipConfigurationName", "ipConfigurationValue"), + resourceids.StaticSegment("publicIPAddresses", "publicIPAddresses", "publicIPAddresses"), + resourceids.UserSpecifiedSegment("publicIpAddressName", "publicIpAddressValue"), + } +} + +// String returns a human-readable description of this Virtual Machine Scale Set Public I P Address ID +func (id VirtualMachineScaleSetPublicIPAddressId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), + fmt.Sprintf("Virtual Machine Index: %q", id.VirtualMachineIndex), + fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), + fmt.Sprintf("Ip Configuration Name: %q", id.IpConfigurationName), + fmt.Sprintf("Public Ip Address Name: %q", id.PublicIpAddressName), + } + return fmt.Sprintf("Virtual Machine Scale Set Public IP Address (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_router_peering.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_router_peering.go new file mode 100644 index 0000000000000..0a026e000a410 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_router_peering.go @@ -0,0 +1,137 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualRouterPeeringId{} + +// VirtualRouterPeeringId is a struct representing the Resource ID for a Virtual Router Peering +type VirtualRouterPeeringId struct { + SubscriptionId string + ResourceGroup string + VirtualRouterName string + PeeringName string +} + +// NewVirtualRouterPeeringID returns a new VirtualRouterPeeringId struct +func NewVirtualRouterPeeringID(subscriptionId string, resourceGroup string, virtualRouterName string, peeringName string) VirtualRouterPeeringId { + return VirtualRouterPeeringId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + VirtualRouterName: virtualRouterName, + PeeringName: peeringName, + } +} + +// ParseVirtualRouterPeeringID parses 'input' into a VirtualRouterPeeringId +func ParseVirtualRouterPeeringID(input string) (*VirtualRouterPeeringId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualRouterPeeringId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualRouterPeeringId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualRouterName, ok = parsed.Parsed["virtualRouterName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualRouterName' was not found in the resource id %q", input) + } + + if id.PeeringName, ok = parsed.Parsed["peeringName"]; !ok { + return nil, fmt.Errorf("the segment 'peeringName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualRouterPeeringIDInsensitively parses 'input' case-insensitively into a VirtualRouterPeeringId +// note: this method should only be used for API response data and not user input +func ParseVirtualRouterPeeringIDInsensitively(input string) (*VirtualRouterPeeringId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualRouterPeeringId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualRouterPeeringId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.VirtualRouterName, ok = parsed.Parsed["virtualRouterName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualRouterName' was not found in the resource id %q", input) + } + + if id.PeeringName, ok = parsed.Parsed["peeringName"]; !ok { + return nil, fmt.Errorf("the segment 'peeringName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualRouterPeeringID checks that 'input' can be parsed as a Virtual Router Peering ID +func ValidateVirtualRouterPeeringID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualRouterPeeringID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Router Peering ID +func (id VirtualRouterPeeringId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualRouters/%s/peerings/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.VirtualRouterName, id.PeeringName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Router Peering ID +func (id VirtualRouterPeeringId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("virtualRouters", "virtualRouters", "virtualRouters"), + resourceids.UserSpecifiedSegment("virtualRouterName", "virtualRouterValue"), + resourceids.StaticSegment("peerings", "peerings", "peerings"), + resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), + } +} + +// String returns a human-readable description of this Virtual Router Peering ID +func (id VirtualRouterPeeringId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Virtual Router Name: %q", id.VirtualRouterName), + fmt.Sprintf("Peering Name: %q", id.PeeringName), + } + return fmt.Sprintf("Virtual Router Peering (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_wan_p2s_vpn_gateway.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_wan_p2s_vpn_gateway.go new file mode 100644 index 0000000000000..e87ae5cda5930 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/virtual_wan_p2s_vpn_gateway.go @@ -0,0 +1,124 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualWANP2SVPNGatewayId{} + +// VirtualWANP2SVPNGatewayId is a struct representing the Resource ID for a Virtual W A N P 2 S V P N Gateway +type VirtualWANP2SVPNGatewayId struct { + SubscriptionId string + ResourceGroup string + GatewayName string +} + +// NewVirtualWANP2SVPNGatewayID returns a new VirtualWANP2SVPNGatewayId struct +func NewVirtualWANP2SVPNGatewayID(subscriptionId string, resourceGroup string, gatewayName string) VirtualWANP2SVPNGatewayId { + return VirtualWANP2SVPNGatewayId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + GatewayName: gatewayName, + } +} + +// ParseVirtualWANP2SVPNGatewayID parses 'input' into a VirtualWANP2SVPNGatewayId +func ParseVirtualWANP2SVPNGatewayID(input string) (*VirtualWANP2SVPNGatewayId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualWANP2SVPNGatewayId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualWANP2SVPNGatewayId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.GatewayName, ok = parsed.Parsed["gatewayName"]; !ok { + return nil, fmt.Errorf("the segment 'gatewayName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualWANP2SVPNGatewayIDInsensitively parses 'input' case-insensitively into a VirtualWANP2SVPNGatewayId +// note: this method should only be used for API response data and not user input +func ParseVirtualWANP2SVPNGatewayIDInsensitively(input string) (*VirtualWANP2SVPNGatewayId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualWANP2SVPNGatewayId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualWANP2SVPNGatewayId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.GatewayName, ok = parsed.Parsed["gatewayName"]; !ok { + return nil, fmt.Errorf("the segment 'gatewayName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualWANP2SVPNGatewayID checks that 'input' can be parsed as a Virtual W A N P 2 S V P N Gateway ID +func ValidateVirtualWANP2SVPNGatewayID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualWANP2SVPNGatewayID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual W A N P 2 S V P N Gateway ID +func (id VirtualWANP2SVPNGatewayId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/p2sVpnGateways/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.GatewayName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual W A N P 2 S V P N Gateway ID +func (id VirtualWANP2SVPNGatewayId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("p2sVpnGateways", "p2sVpnGateways", "p2sVpnGateways"), + resourceids.UserSpecifiedSegment("gatewayName", "gatewayValue"), + } +} + +// String returns a human-readable description of this Virtual W A N P 2 S V P N Gateway ID +func (id VirtualWANP2SVPNGatewayId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Gateway Name: %q", id.GatewayName), + } + return fmt.Sprintf("Virtual WAN P2S VPN Gateway (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vpn_connection.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vpn_connection.go new file mode 100644 index 0000000000000..a7cdedbd96ff8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/vpn_connection.go @@ -0,0 +1,137 @@ +package commonids + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VPNConnectionId{} + +// VPNConnectionId is a struct representing the Resource ID for a V P N Connection +type VPNConnectionId struct { + SubscriptionId string + ResourceGroup string + GatewayName string + ConnectionName string +} + +// NewVPNConnectionID returns a new VPNConnectionId struct +func NewVPNConnectionID(subscriptionId string, resourceGroup string, gatewayName string, connectionName string) VPNConnectionId { + return VPNConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + GatewayName: gatewayName, + ConnectionName: connectionName, + } +} + +// ParseVPNConnectionID parses 'input' into a VPNConnectionId +func ParseVPNConnectionID(input string) (*VPNConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(VPNConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VPNConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.GatewayName, ok = parsed.Parsed["gatewayName"]; !ok { + return nil, fmt.Errorf("the segment 'gatewayName' was not found in the resource id %q", input) + } + + if id.ConnectionName, ok = parsed.Parsed["connectionName"]; !ok { + return nil, fmt.Errorf("the segment 'connectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVPNConnectionIDInsensitively parses 'input' case-insensitively into a VPNConnectionId +// note: this method should only be used for API response data and not user input +func ParseVPNConnectionIDInsensitively(input string) (*VPNConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(VPNConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VPNConnectionId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroup, ok = parsed.Parsed["resourceGroup"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroup' was not found in the resource id %q", input) + } + + if id.GatewayName, ok = parsed.Parsed["gatewayName"]; !ok { + return nil, fmt.Errorf("the segment 'gatewayName' was not found in the resource id %q", input) + } + + if id.ConnectionName, ok = parsed.Parsed["connectionName"]; !ok { + return nil, fmt.Errorf("the segment 'connectionName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVPNConnectionID checks that 'input' can be parsed as a V P N Connection ID +func ValidateVPNConnectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVPNConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted V P N Connection ID +func (id VPNConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s/vpnConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.GatewayName, id.ConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this V P N Connection ID +func (id VPNConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroup", "example-resource-group"), + resourceids.StaticSegment("providers", "providers", "providers"), + resourceids.ResourceProviderSegment("resourceProvider", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("vpnGateways", "vpnGateways", "vpnGateways"), + resourceids.UserSpecifiedSegment("gatewayName", "gatewayValue"), + resourceids.StaticSegment("vpnConnections", "vpnConnections", "vpnConnections"), + resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), + } +} + +// String returns a human-readable description of this V P N Connection ID +func (id VPNConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group: %q", id.ResourceGroup), + fmt.Sprintf("Gateway Name: %q", id.GatewayName), + fmt.Sprintf("Connection Name: %q", id.ConnectionName), + } + return fmt.Sprintf("V P N Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/README.md similarity index 50% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/README.md index 069fad59b0fcd..d05230442193e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/README.md @@ -1,32 +1,32 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis` Documentation -The `applicationinsights` SDK allows for interaction with the Azure Resource Manager Service `applicationinsights` (API Version `2020-11-20`). +The `workbooktemplatesapis` SDK allows for interaction with the Azure Resource Manager Service `applicationinsights` (API Version `2020-11-20`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights" +import "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis" ``` ### Client Initialization ```go -client := applicationinsights.NewApplicationInsightsClientWithBaseURI("https://management.azure.com") +client := workbooktemplatesapis.NewWorkbookTemplatesAPIsClientWithBaseURI("https://management.azure.com") client.Client.Authorizer = authorizer ``` -### Example Usage: `ApplicationInsightsClient.WorkbookTemplatesCreateOrUpdate` +### Example Usage: `WorkbookTemplatesAPIsClient.WorkbookTemplatesCreateOrUpdate` ```go ctx := context.TODO() -id := applicationinsights.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") -payload := applicationinsights.WorkbookTemplate{ +payload := workbooktemplatesapis.WorkbookTemplate{ // ... } @@ -41,11 +41,11 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ApplicationInsightsClient.WorkbookTemplatesDelete` +### Example Usage: `WorkbookTemplatesAPIsClient.WorkbookTemplatesDelete` ```go ctx := context.TODO() -id := applicationinsights.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") read, err := client.WorkbookTemplatesDelete(ctx, id) if err != nil { @@ -57,11 +57,11 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ApplicationInsightsClient.WorkbookTemplatesGet` +### Example Usage: `WorkbookTemplatesAPIsClient.WorkbookTemplatesGet` ```go ctx := context.TODO() -id := applicationinsights.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") read, err := client.WorkbookTemplatesGet(ctx, id) if err != nil { @@ -73,11 +73,11 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ApplicationInsightsClient.WorkbookTemplatesListByResourceGroup` +### Example Usage: `WorkbookTemplatesAPIsClient.WorkbookTemplatesListByResourceGroup` ```go ctx := context.TODO() -id := applicationinsights.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") +id := workbooktemplatesapis.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") read, err := client.WorkbookTemplatesListByResourceGroup(ctx, id) if err != nil { @@ -89,13 +89,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ApplicationInsightsClient.WorkbookTemplatesUpdate` +### Example Usage: `WorkbookTemplatesAPIsClient.WorkbookTemplatesUpdate` ```go ctx := context.TODO() -id := applicationinsights.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") -payload := applicationinsights.WorkbookTemplateUpdateParameters{ +payload := workbooktemplatesapis.WorkbookTemplateUpdateParameters{ // ... } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/client.go new file mode 100644 index 0000000000000..e11129fabe3cd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/client.go @@ -0,0 +1,18 @@ +package workbooktemplatesapis + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WorkbookTemplatesAPIsClient struct { + Client autorest.Client + baseUri string +} + +func NewWorkbookTemplatesAPIsClientWithBaseURI(endpoint string) WorkbookTemplatesAPIsClient { + return WorkbookTemplatesAPIsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/id_workbooktemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/id_workbooktemplate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate.go index 21ad2013cf86d..42058833c610d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/id_workbooktemplate.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatescreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatescreateorupdate_autorest.go similarity index 60% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatescreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatescreateorupdate_autorest.go index ee52c9bcea101..ccbfa85c72063 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatescreateorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatescreateorupdate_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis import ( "context" @@ -17,22 +17,22 @@ type WorkbookTemplatesCreateOrUpdateOperationResponse struct { } // WorkbookTemplatesCreateOrUpdate ... -func (c ApplicationInsightsClient) WorkbookTemplatesCreateOrUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplate) (result WorkbookTemplatesCreateOrUpdateOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) WorkbookTemplatesCreateOrUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplate) (result WorkbookTemplatesCreateOrUpdateOperationResponse, err error) { req, err := c.preparerForWorkbookTemplatesCreateOrUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesCreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesCreateOrUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesCreateOrUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesCreateOrUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbookTemplatesCreateOrUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesCreateOrUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesCreateOrUpdate", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c ApplicationInsightsClient) WorkbookTemplatesCreateOrUpdate(ctx context.C } // preparerForWorkbookTemplatesCreateOrUpdate prepares the WorkbookTemplatesCreateOrUpdate request. -func (c ApplicationInsightsClient) preparerForWorkbookTemplatesCreateOrUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplate) (*http.Request, error) { +func (c WorkbookTemplatesAPIsClient) preparerForWorkbookTemplatesCreateOrUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplate) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c ApplicationInsightsClient) preparerForWorkbookTemplatesCreateOrUpdate(ct // responderForWorkbookTemplatesCreateOrUpdate handles the response to the WorkbookTemplatesCreateOrUpdate request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbookTemplatesCreateOrUpdate(resp *http.Response) (result WorkbookTemplatesCreateOrUpdateOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) responderForWorkbookTemplatesCreateOrUpdate(resp *http.Response) (result WorkbookTemplatesCreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesdelete_autorest.go similarity index 60% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesdelete_autorest.go index d0b4d6a589f5a..0088c4274a7ca 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesdelete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesdelete_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis import ( "context" @@ -16,22 +16,22 @@ type WorkbookTemplatesDeleteOperationResponse struct { } // WorkbookTemplatesDelete ... -func (c ApplicationInsightsClient) WorkbookTemplatesDelete(ctx context.Context, id WorkbookTemplateId) (result WorkbookTemplatesDeleteOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) WorkbookTemplatesDelete(ctx context.Context, id WorkbookTemplateId) (result WorkbookTemplatesDeleteOperationResponse, err error) { req, err := c.preparerForWorkbookTemplatesDelete(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesDelete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesDelete", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesDelete", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesDelete", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbookTemplatesDelete(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesDelete", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesDelete", result.HttpResponse, "Failure responding to request") return } @@ -39,7 +39,7 @@ func (c ApplicationInsightsClient) WorkbookTemplatesDelete(ctx context.Context, } // preparerForWorkbookTemplatesDelete prepares the WorkbookTemplatesDelete request. -func (c ApplicationInsightsClient) preparerForWorkbookTemplatesDelete(ctx context.Context, id WorkbookTemplateId) (*http.Request, error) { +func (c WorkbookTemplatesAPIsClient) preparerForWorkbookTemplatesDelete(ctx context.Context, id WorkbookTemplateId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -55,7 +55,7 @@ func (c ApplicationInsightsClient) preparerForWorkbookTemplatesDelete(ctx contex // responderForWorkbookTemplatesDelete handles the response to the WorkbookTemplatesDelete request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbookTemplatesDelete(resp *http.Response) (result WorkbookTemplatesDeleteOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) responderForWorkbookTemplatesDelete(resp *http.Response) (result WorkbookTemplatesDeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesget_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesget_autorest.go index e671dbb3dd56e..b6c19f69c26e1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesget_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis import ( "context" @@ -17,22 +17,22 @@ type WorkbookTemplatesGetOperationResponse struct { } // WorkbookTemplatesGet ... -func (c ApplicationInsightsClient) WorkbookTemplatesGet(ctx context.Context, id WorkbookTemplateId) (result WorkbookTemplatesGetOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) WorkbookTemplatesGet(ctx context.Context, id WorkbookTemplateId) (result WorkbookTemplatesGetOperationResponse, err error) { req, err := c.preparerForWorkbookTemplatesGet(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesGet", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesGet", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbookTemplatesGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesGet", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c ApplicationInsightsClient) WorkbookTemplatesGet(ctx context.Context, id } // preparerForWorkbookTemplatesGet prepares the WorkbookTemplatesGet request. -func (c ApplicationInsightsClient) preparerForWorkbookTemplatesGet(ctx context.Context, id WorkbookTemplateId) (*http.Request, error) { +func (c WorkbookTemplatesAPIsClient) preparerForWorkbookTemplatesGet(ctx context.Context, id WorkbookTemplateId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c ApplicationInsightsClient) preparerForWorkbookTemplatesGet(ctx context.C // responderForWorkbookTemplatesGet handles the response to the WorkbookTemplatesGet request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbookTemplatesGet(resp *http.Response) (result WorkbookTemplatesGetOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) responderForWorkbookTemplatesGet(resp *http.Response) (result WorkbookTemplatesGetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplateslistbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplateslistbyresourcegroup_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplateslistbyresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplateslistbyresourcegroup_autorest.go index 734e825ab0c37..0ac096a184a7e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplateslistbyresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplateslistbyresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis import ( "context" @@ -19,22 +19,22 @@ type WorkbookTemplatesListByResourceGroupOperationResponse struct { } // WorkbookTemplatesListByResourceGroup ... -func (c ApplicationInsightsClient) WorkbookTemplatesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result WorkbookTemplatesListByResourceGroupOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) WorkbookTemplatesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result WorkbookTemplatesListByResourceGroupOperationResponse, err error) { req, err := c.preparerForWorkbookTemplatesListByResourceGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesListByResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesListByResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesListByResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbookTemplatesListByResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesListByResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesListByResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -42,7 +42,7 @@ func (c ApplicationInsightsClient) WorkbookTemplatesListByResourceGroup(ctx cont } // preparerForWorkbookTemplatesListByResourceGroup prepares the WorkbookTemplatesListByResourceGroup request. -func (c ApplicationInsightsClient) preparerForWorkbookTemplatesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { +func (c WorkbookTemplatesAPIsClient) preparerForWorkbookTemplatesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c ApplicationInsightsClient) preparerForWorkbookTemplatesListByResourceGro // responderForWorkbookTemplatesListByResourceGroup handles the response to the WorkbookTemplatesListByResourceGroup request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbookTemplatesListByResourceGroup(resp *http.Response) (result WorkbookTemplatesListByResourceGroupOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) responderForWorkbookTemplatesListByResourceGroup(resp *http.Response) (result WorkbookTemplatesListByResourceGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesupdate_autorest.go similarity index 59% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesupdate_autorest.go index 7bae342347313..f4c4bd7570bdd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/method_workbooktemplatesupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/method_workbooktemplatesupdate_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis import ( "context" @@ -17,22 +17,22 @@ type WorkbookTemplatesUpdateOperationResponse struct { } // WorkbookTemplatesUpdate ... -func (c ApplicationInsightsClient) WorkbookTemplatesUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplateUpdateParameters) (result WorkbookTemplatesUpdateOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) WorkbookTemplatesUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplateUpdateParameters) (result WorkbookTemplatesUpdateOperationResponse, err error) { req, err := c.preparerForWorkbookTemplatesUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbookTemplatesUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbookTemplatesUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooktemplatesapis.WorkbookTemplatesAPIsClient", "WorkbookTemplatesUpdate", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c ApplicationInsightsClient) WorkbookTemplatesUpdate(ctx context.Context, } // preparerForWorkbookTemplatesUpdate prepares the WorkbookTemplatesUpdate request. -func (c ApplicationInsightsClient) preparerForWorkbookTemplatesUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplateUpdateParameters) (*http.Request, error) { +func (c WorkbookTemplatesAPIsClient) preparerForWorkbookTemplatesUpdate(ctx context.Context, id WorkbookTemplateId, input WorkbookTemplateUpdateParameters) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c ApplicationInsightsClient) preparerForWorkbookTemplatesUpdate(ctx contex // responderForWorkbookTemplatesUpdate handles the response to the WorkbookTemplatesUpdate request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbookTemplatesUpdate(resp *http.Response) (result WorkbookTemplatesUpdateOperationResponse, err error) { +func (c WorkbookTemplatesAPIsClient) responderForWorkbookTemplatesUpdate(resp *http.Response) (result WorkbookTemplatesUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplate.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplate.go index a70bfa79a3584..f3e0c42e001b3 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplate.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplate.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplategallery.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplategallery.go similarity index 93% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplategallery.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplategallery.go index 4459f03c6d289..4046438733e1a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplategallery.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplategallery.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplatelocalizedgallery.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplatelocalizedgallery.go similarity index 92% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplatelocalizedgallery.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplatelocalizedgallery.go index ef525ea0c3072..770335e5d2a09 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplatelocalizedgallery.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplatelocalizedgallery.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateproperties.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateproperties.go index 15c0eb32a94da..9a8a986384ed6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateproperties.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateslistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateslistresult.go similarity index 89% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateslistresult.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateslistresult.go index 0acb197b2f675..7b38275aed8e0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateslistresult.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateslistresult.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateupdateparameters.go similarity index 91% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateupdateparameters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateupdateparameters.go index e8a88aa86fcb3..eee6e4b9133b6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/model_workbooktemplateupdateparameters.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/model_workbooktemplateupdateparameters.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/version.go similarity index 66% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/version.go index 2dc2d21c4d965..abd25f3cdc9e4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/version.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooktemplatesapis import "fmt" @@ -8,5 +8,5 @@ import "fmt" const defaultApiVersion = "2020-11-20" func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationinsights/%s", defaultApiVersion) + return fmt.Sprintf("hashicorp/go-azure-sdk/workbooktemplatesapis/%s", defaultApiVersion) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/README.md deleted file mode 100644 index 8080cc0ccaf57..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/README.md +++ /dev/null @@ -1,161 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights` Documentation - -The `applicationinsights` SDK allows for interaction with the Azure Resource Manager Service `applicationinsights` (API Version `2022-04-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights" -``` - - -### Client Initialization - -```go -client := applicationinsights.NewApplicationInsightsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksCreateOrUpdate` - -```go -ctx := context.TODO() -id := applicationinsights.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") - -payload := applicationinsights.Workbook{ - // ... -} - - -read, err := client.WorkbooksCreateOrUpdate(ctx, id, payload, applicationinsights.DefaultWorkbooksCreateOrUpdateOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksDelete` - -```go -ctx := context.TODO() -id := applicationinsights.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") - -read, err := client.WorkbooksDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksGet` - -```go -ctx := context.TODO() -id := applicationinsights.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") - -read, err := client.WorkbooksGet(ctx, id, applicationinsights.DefaultWorkbooksGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksListByResourceGroup` - -```go -ctx := context.TODO() -id := applicationinsights.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.WorkbooksListByResourceGroup(ctx, id, applicationinsights.DefaultWorkbooksListByResourceGroupOperationOptions())` can be used to do batched pagination -items, err := client.WorkbooksListByResourceGroupComplete(ctx, id, applicationinsights.DefaultWorkbooksListByResourceGroupOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksListBySubscription` - -```go -ctx := context.TODO() -id := applicationinsights.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.WorkbooksListBySubscription(ctx, id, applicationinsights.DefaultWorkbooksListBySubscriptionOperationOptions())` can be used to do batched pagination -items, err := client.WorkbooksListBySubscriptionComplete(ctx, id, applicationinsights.DefaultWorkbooksListBySubscriptionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksRevisionGet` - -```go -ctx := context.TODO() -id := applicationinsights.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue", "revisionIdValue") - -read, err := client.WorkbooksRevisionGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksRevisionsList` - -```go -ctx := context.TODO() -id := applicationinsights.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") - -// alternatively `client.WorkbooksRevisionsList(ctx, id)` can be used to do batched pagination -items, err := client.WorkbooksRevisionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationInsightsClient.WorkbooksUpdate` - -```go -ctx := context.TODO() -id := applicationinsights.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") - -payload := applicationinsights.WorkbookUpdateParameters{ - // ... -} - - -read, err := client.WorkbooksUpdate(ctx, id, payload, applicationinsights.DefaultWorkbooksUpdateOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/README.md new file mode 100644 index 0000000000000..f3698e6dbfe1c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/README.md @@ -0,0 +1,161 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis` Documentation + +The `workbooksapis` SDK allows for interaction with the Azure Resource Manager Service `applicationinsights` (API Version `2022-04-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis" +``` + + +### Client Initialization + +```go +client := workbooksapis.NewWorkbooksAPIsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksCreateOrUpdate` + +```go +ctx := context.TODO() +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") + +payload := workbooksapis.Workbook{ + // ... +} + + +read, err := client.WorkbooksCreateOrUpdate(ctx, id, payload, workbooksapis.DefaultWorkbooksCreateOrUpdateOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksDelete` + +```go +ctx := context.TODO() +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") + +read, err := client.WorkbooksDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksGet` + +```go +ctx := context.TODO() +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") + +read, err := client.WorkbooksGet(ctx, id, workbooksapis.DefaultWorkbooksGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksListByResourceGroup` + +```go +ctx := context.TODO() +id := workbooksapis.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.WorkbooksListByResourceGroup(ctx, id, workbooksapis.DefaultWorkbooksListByResourceGroupOperationOptions())` can be used to do batched pagination +items, err := client.WorkbooksListByResourceGroupComplete(ctx, id, workbooksapis.DefaultWorkbooksListByResourceGroupOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksListBySubscription` + +```go +ctx := context.TODO() +id := workbooksapis.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.WorkbooksListBySubscription(ctx, id, workbooksapis.DefaultWorkbooksListBySubscriptionOperationOptions())` can be used to do batched pagination +items, err := client.WorkbooksListBySubscriptionComplete(ctx, id, workbooksapis.DefaultWorkbooksListBySubscriptionOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksRevisionGet` + +```go +ctx := context.TODO() +id := workbooksapis.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue", "revisionIdValue") + +read, err := client.WorkbooksRevisionGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksRevisionsList` + +```go +ctx := context.TODO() +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") + +// alternatively `client.WorkbooksRevisionsList(ctx, id)` can be used to do batched pagination +items, err := client.WorkbooksRevisionsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `WorkbooksAPIsClient.WorkbooksUpdate` + +```go +ctx := context.TODO() +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") + +payload := workbooksapis.WorkbookUpdateParameters{ + // ... +} + + +read, err := client.WorkbooksUpdate(ctx, id, payload, workbooksapis.DefaultWorkbooksUpdateOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/client.go similarity index 67% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/client.go index deb3923442eff..651cbf32b0764 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/client.go @@ -1,17 +1,17 @@ -package videoanalyzer +package workbooksapis import "github.com/Azure/go-autorest/autorest" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type VideoAnalyzerClient struct { +type WorkbooksAPIsClient struct { Client autorest.Client baseUri string } -func NewVideoAnalyzerClientWithBaseURI(endpoint string) VideoAnalyzerClient { - return VideoAnalyzerClient{ +func NewWorkbooksAPIsClientWithBaseURI(endpoint string) WorkbooksAPIsClient { + return WorkbooksAPIsClient{ Client: autorest.NewClientWithUserAgent(userAgent()), baseUri: endpoint, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/constants.go similarity index 98% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/constants.go index 159af02f81d42..9a609b0db3ccf 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/constants.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import "strings" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/id_revision.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/id_revision.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision.go index 96d1083ce4c63..4556cfaec7103 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/id_revision.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/id_workbook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/id_workbook.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook.go index 0480e638a6096..78b322bb80edb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/id_workbook.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookscreateorupdate_autorest.go similarity index 68% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookscreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookscreateorupdate_autorest.go index 3016bce4f8a44..d51b79a20c89b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookscreateorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookscreateorupdate_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -41,22 +41,22 @@ func (o WorkbooksCreateOrUpdateOperationOptions) toQueryString() map[string]inte } // WorkbooksCreateOrUpdate ... -func (c ApplicationInsightsClient) WorkbooksCreateOrUpdate(ctx context.Context, id WorkbookId, input Workbook, options WorkbooksCreateOrUpdateOperationOptions) (result WorkbooksCreateOrUpdateOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksCreateOrUpdate(ctx context.Context, id WorkbookId, input Workbook, options WorkbooksCreateOrUpdateOperationOptions) (result WorkbooksCreateOrUpdateOperationResponse, err error) { req, err := c.preparerForWorkbooksCreateOrUpdate(ctx, id, input, options) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksCreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksCreateOrUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksCreateOrUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksCreateOrUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksCreateOrUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksCreateOrUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksCreateOrUpdate", result.HttpResponse, "Failure responding to request") return } @@ -64,7 +64,7 @@ func (c ApplicationInsightsClient) WorkbooksCreateOrUpdate(ctx context.Context, } // preparerForWorkbooksCreateOrUpdate prepares the WorkbooksCreateOrUpdate request. -func (c ApplicationInsightsClient) preparerForWorkbooksCreateOrUpdate(ctx context.Context, id WorkbookId, input Workbook, options WorkbooksCreateOrUpdateOperationOptions) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksCreateOrUpdate(ctx context.Context, id WorkbookId, input Workbook, options WorkbooksCreateOrUpdateOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -86,7 +86,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksCreateOrUpdate(ctx contex // responderForWorkbooksCreateOrUpdate handles the response to the WorkbooksCreateOrUpdate request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksCreateOrUpdate(resp *http.Response) (result WorkbooksCreateOrUpdateOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksCreateOrUpdate(resp *http.Response) (result WorkbooksCreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksdelete_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksdelete_autorest.go index 2c21cb92d7329..e6cde4eeef3e5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksdelete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksdelete_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -16,22 +16,22 @@ type WorkbooksDeleteOperationResponse struct { } // WorkbooksDelete ... -func (c ApplicationInsightsClient) WorkbooksDelete(ctx context.Context, id WorkbookId) (result WorkbooksDeleteOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksDelete(ctx context.Context, id WorkbookId) (result WorkbooksDeleteOperationResponse, err error) { req, err := c.preparerForWorkbooksDelete(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksDelete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksDelete", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksDelete", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksDelete", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksDelete(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksDelete", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksDelete", result.HttpResponse, "Failure responding to request") return } @@ -39,7 +39,7 @@ func (c ApplicationInsightsClient) WorkbooksDelete(ctx context.Context, id Workb } // preparerForWorkbooksDelete prepares the WorkbooksDelete request. -func (c ApplicationInsightsClient) preparerForWorkbooksDelete(ctx context.Context, id WorkbookId) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksDelete(ctx context.Context, id WorkbookId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -55,7 +55,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksDelete(ctx context.Contex // responderForWorkbooksDelete handles the response to the WorkbooksDelete request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksDelete(resp *http.Response) (result WorkbooksDeleteOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksDelete(resp *http.Response) (result WorkbooksDeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksget_autorest.go similarity index 69% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksget_autorest.go index 379679b68e15e..4f8e45339afc2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksget_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -41,22 +41,22 @@ func (o WorkbooksGetOperationOptions) toQueryString() map[string]interface{} { } // WorkbooksGet ... -func (c ApplicationInsightsClient) WorkbooksGet(ctx context.Context, id WorkbookId, options WorkbooksGetOperationOptions) (result WorkbooksGetOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksGet(ctx context.Context, id WorkbookId, options WorkbooksGetOperationOptions) (result WorkbooksGetOperationResponse, err error) { req, err := c.preparerForWorkbooksGet(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksGet", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksGet", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksGet", result.HttpResponse, "Failure responding to request") return } @@ -64,7 +64,7 @@ func (c ApplicationInsightsClient) WorkbooksGet(ctx context.Context, id Workbook } // preparerForWorkbooksGet prepares the WorkbooksGet request. -func (c ApplicationInsightsClient) preparerForWorkbooksGet(ctx context.Context, id WorkbookId, options WorkbooksGetOperationOptions) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksGet(ctx context.Context, id WorkbookId, options WorkbooksGetOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -85,7 +85,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksGet(ctx context.Context, // responderForWorkbooksGet handles the response to the WorkbooksGet request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksGet(resp *http.Response) (result WorkbooksGetOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksGet(resp *http.Response) (result WorkbooksGetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookslistbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookslistbyresourcegroup_autorest.go similarity index 72% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookslistbyresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookslistbyresourcegroup_autorest.go index 5475c3b04e0f2..67e843c2cfb24 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookslistbyresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookslistbyresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -78,29 +78,29 @@ func (o WorkbooksListByResourceGroupOperationOptions) toQueryString() map[string } // WorkbooksListByResourceGroup ... -func (c ApplicationInsightsClient) WorkbooksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions) (resp WorkbooksListByResourceGroupOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions) (resp WorkbooksListByResourceGroupOperationResponse, err error) { req, err := c.preparerForWorkbooksListByResourceGroup(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListByResourceGroup", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListByResourceGroup", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListByResourceGroup", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForWorkbooksListByResourceGroup(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListByResourceGroup", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListByResourceGroup", resp.HttpResponse, "Failure responding to request") return } return } // preparerForWorkbooksListByResourceGroup prepares the WorkbooksListByResourceGroup request. -func (c ApplicationInsightsClient) preparerForWorkbooksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -120,7 +120,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksListByResourceGroup(ctx c } // preparerForWorkbooksListByResourceGroupWithNextLink prepares the WorkbooksListByResourceGroup request with the given nextLink token. -func (c ApplicationInsightsClient) preparerForWorkbooksListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -146,7 +146,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksListByResourceGroupWithNe // responderForWorkbooksListByResourceGroup handles the response to the WorkbooksListByResourceGroup request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksListByResourceGroup(resp *http.Response) (result WorkbooksListByResourceGroupOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksListByResourceGroup(resp *http.Response) (result WorkbooksListByResourceGroupOperationResponse, err error) { type page struct { Values []Workbook `json:"value"` NextLink *string `json:"nextLink"` @@ -164,19 +164,19 @@ func (c ApplicationInsightsClient) responderForWorkbooksListByResourceGroup(resp result.nextPageFunc = func(ctx context.Context, nextLink string) (result WorkbooksListByResourceGroupOperationResponse, err error) { req, err := c.preparerForWorkbooksListByResourceGroupWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListByResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListByResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListByResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksListByResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListByResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListByResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -187,12 +187,12 @@ func (c ApplicationInsightsClient) responderForWorkbooksListByResourceGroup(resp } // WorkbooksListByResourceGroupComplete retrieves all of the results into a single object -func (c ApplicationInsightsClient) WorkbooksListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions) (WorkbooksListByResourceGroupCompleteResult, error) { +func (c WorkbooksAPIsClient) WorkbooksListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions) (WorkbooksListByResourceGroupCompleteResult, error) { return c.WorkbooksListByResourceGroupCompleteMatchingPredicate(ctx, id, options, WorkbookOperationPredicate{}) } // WorkbooksListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ApplicationInsightsClient) WorkbooksListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions, predicate WorkbookOperationPredicate) (resp WorkbooksListByResourceGroupCompleteResult, err error) { +func (c WorkbooksAPIsClient) WorkbooksListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options WorkbooksListByResourceGroupOperationOptions, predicate WorkbookOperationPredicate) (resp WorkbooksListByResourceGroupCompleteResult, err error) { items := make([]Workbook, 0) page, err := c.WorkbooksListByResourceGroup(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookslistbysubscription_autorest.go similarity index 71% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookslistbysubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookslistbysubscription_autorest.go index 5e81e80969778..2c82ca2cf7682 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbookslistbysubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbookslistbysubscription_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -73,29 +73,29 @@ func (o WorkbooksListBySubscriptionOperationOptions) toQueryString() map[string] } // WorkbooksListBySubscription ... -func (c ApplicationInsightsClient) WorkbooksListBySubscription(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions) (resp WorkbooksListBySubscriptionOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksListBySubscription(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions) (resp WorkbooksListBySubscriptionOperationResponse, err error) { req, err := c.preparerForWorkbooksListBySubscription(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListBySubscription", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListBySubscription", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListBySubscription", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForWorkbooksListBySubscription(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListBySubscription", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListBySubscription", resp.HttpResponse, "Failure responding to request") return } return } // preparerForWorkbooksListBySubscription prepares the WorkbooksListBySubscription request. -func (c ApplicationInsightsClient) preparerForWorkbooksListBySubscription(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksListBySubscription(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -115,7 +115,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksListBySubscription(ctx co } // preparerForWorkbooksListBySubscriptionWithNextLink prepares the WorkbooksListBySubscription request with the given nextLink token. -func (c ApplicationInsightsClient) preparerForWorkbooksListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -141,7 +141,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksListBySubscriptionWithNex // responderForWorkbooksListBySubscription handles the response to the WorkbooksListBySubscription request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksListBySubscription(resp *http.Response) (result WorkbooksListBySubscriptionOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksListBySubscription(resp *http.Response) (result WorkbooksListBySubscriptionOperationResponse, err error) { type page struct { Values []Workbook `json:"value"` NextLink *string `json:"nextLink"` @@ -159,19 +159,19 @@ func (c ApplicationInsightsClient) responderForWorkbooksListBySubscription(resp result.nextPageFunc = func(ctx context.Context, nextLink string) (result WorkbooksListBySubscriptionOperationResponse, err error) { req, err := c.preparerForWorkbooksListBySubscriptionWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListBySubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListBySubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListBySubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksListBySubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksListBySubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksListBySubscription", result.HttpResponse, "Failure responding to request") return } @@ -182,12 +182,12 @@ func (c ApplicationInsightsClient) responderForWorkbooksListBySubscription(resp } // WorkbooksListBySubscriptionComplete retrieves all of the results into a single object -func (c ApplicationInsightsClient) WorkbooksListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions) (WorkbooksListBySubscriptionCompleteResult, error) { +func (c WorkbooksAPIsClient) WorkbooksListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions) (WorkbooksListBySubscriptionCompleteResult, error) { return c.WorkbooksListBySubscriptionCompleteMatchingPredicate(ctx, id, options, WorkbookOperationPredicate{}) } // WorkbooksListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ApplicationInsightsClient) WorkbooksListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions, predicate WorkbookOperationPredicate) (resp WorkbooksListBySubscriptionCompleteResult, err error) { +func (c WorkbooksAPIsClient) WorkbooksListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options WorkbooksListBySubscriptionOperationOptions, predicate WorkbookOperationPredicate) (resp WorkbooksListBySubscriptionCompleteResult, err error) { items := make([]Workbook, 0) page, err := c.WorkbooksListBySubscription(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksrevisionget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksrevisionget_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksrevisionget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksrevisionget_autorest.go index 05936ef8281f0..cbb48f8264439 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksrevisionget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksrevisionget_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -17,22 +17,22 @@ type WorkbooksRevisionGetOperationResponse struct { } // WorkbooksRevisionGet ... -func (c ApplicationInsightsClient) WorkbooksRevisionGet(ctx context.Context, id RevisionId) (result WorkbooksRevisionGetOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksRevisionGet(ctx context.Context, id RevisionId) (result WorkbooksRevisionGetOperationResponse, err error) { req, err := c.preparerForWorkbooksRevisionGet(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionGet", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionGet", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksRevisionGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionGet", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c ApplicationInsightsClient) WorkbooksRevisionGet(ctx context.Context, id } // preparerForWorkbooksRevisionGet prepares the WorkbooksRevisionGet request. -func (c ApplicationInsightsClient) preparerForWorkbooksRevisionGet(ctx context.Context, id RevisionId) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksRevisionGet(ctx context.Context, id RevisionId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksRevisionGet(ctx context.C // responderForWorkbooksRevisionGet handles the response to the WorkbooksRevisionGet request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksRevisionGet(resp *http.Response) (result WorkbooksRevisionGetOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksRevisionGet(resp *http.Response) (result WorkbooksRevisionGetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksrevisionslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksrevisionslist_autorest.go similarity index 70% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksrevisionslist_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksrevisionslist_autorest.go index 0fb28e92358ba..d902bfa3e3660 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksrevisionslist_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksrevisionslist_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -38,29 +38,29 @@ func (r WorkbooksRevisionsListOperationResponse) LoadMore(ctx context.Context) ( } // WorkbooksRevisionsList ... -func (c ApplicationInsightsClient) WorkbooksRevisionsList(ctx context.Context, id WorkbookId) (resp WorkbooksRevisionsListOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksRevisionsList(ctx context.Context, id WorkbookId) (resp WorkbooksRevisionsListOperationResponse, err error) { req, err := c.preparerForWorkbooksRevisionsList(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionsList", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionsList", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionsList", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionsList", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForWorkbooksRevisionsList(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionsList", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionsList", resp.HttpResponse, "Failure responding to request") return } return } // preparerForWorkbooksRevisionsList prepares the WorkbooksRevisionsList request. -func (c ApplicationInsightsClient) preparerForWorkbooksRevisionsList(ctx context.Context, id WorkbookId) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksRevisionsList(ctx context.Context, id WorkbookId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -75,7 +75,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksRevisionsList(ctx context } // preparerForWorkbooksRevisionsListWithNextLink prepares the WorkbooksRevisionsList request with the given nextLink token. -func (c ApplicationInsightsClient) preparerForWorkbooksRevisionsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksRevisionsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -101,7 +101,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksRevisionsListWithNextLink // responderForWorkbooksRevisionsList handles the response to the WorkbooksRevisionsList request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksRevisionsList(resp *http.Response) (result WorkbooksRevisionsListOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksRevisionsList(resp *http.Response) (result WorkbooksRevisionsListOperationResponse, err error) { type page struct { Values []Workbook `json:"value"` NextLink *string `json:"nextLink"` @@ -119,19 +119,19 @@ func (c ApplicationInsightsClient) responderForWorkbooksRevisionsList(resp *http result.nextPageFunc = func(ctx context.Context, nextLink string) (result WorkbooksRevisionsListOperationResponse, err error) { req, err := c.preparerForWorkbooksRevisionsListWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionsList", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionsList", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionsList", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionsList", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksRevisionsList(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksRevisionsList", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksRevisionsList", result.HttpResponse, "Failure responding to request") return } @@ -142,12 +142,12 @@ func (c ApplicationInsightsClient) responderForWorkbooksRevisionsList(resp *http } // WorkbooksRevisionsListComplete retrieves all of the results into a single object -func (c ApplicationInsightsClient) WorkbooksRevisionsListComplete(ctx context.Context, id WorkbookId) (WorkbooksRevisionsListCompleteResult, error) { +func (c WorkbooksAPIsClient) WorkbooksRevisionsListComplete(ctx context.Context, id WorkbookId) (WorkbooksRevisionsListCompleteResult, error) { return c.WorkbooksRevisionsListCompleteMatchingPredicate(ctx, id, WorkbookOperationPredicate{}) } // WorkbooksRevisionsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ApplicationInsightsClient) WorkbooksRevisionsListCompleteMatchingPredicate(ctx context.Context, id WorkbookId, predicate WorkbookOperationPredicate) (resp WorkbooksRevisionsListCompleteResult, err error) { +func (c WorkbooksAPIsClient) WorkbooksRevisionsListCompleteMatchingPredicate(ctx context.Context, id WorkbookId, predicate WorkbookOperationPredicate) (resp WorkbooksRevisionsListCompleteResult, err error) { items := make([]Workbook, 0) page, err := c.WorkbooksRevisionsList(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksupdate_autorest.go similarity index 68% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksupdate_autorest.go index 74b2557509ac6..9e8489128227e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/method_workbooksupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/method_workbooksupdate_autorest.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "context" @@ -41,22 +41,22 @@ func (o WorkbooksUpdateOperationOptions) toQueryString() map[string]interface{} } // WorkbooksUpdate ... -func (c ApplicationInsightsClient) WorkbooksUpdate(ctx context.Context, id WorkbookId, input WorkbookUpdateParameters, options WorkbooksUpdateOperationOptions) (result WorkbooksUpdateOperationResponse, err error) { +func (c WorkbooksAPIsClient) WorkbooksUpdate(ctx context.Context, id WorkbookId, input WorkbookUpdateParameters, options WorkbooksUpdateOperationOptions) (result WorkbooksUpdateOperationResponse, err error) { req, err := c.preparerForWorkbooksUpdate(ctx, id, input, options) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForWorkbooksUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "applicationinsights.ApplicationInsightsClient", "WorkbooksUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "workbooksapis.WorkbooksAPIsClient", "WorkbooksUpdate", result.HttpResponse, "Failure responding to request") return } @@ -64,7 +64,7 @@ func (c ApplicationInsightsClient) WorkbooksUpdate(ctx context.Context, id Workb } // preparerForWorkbooksUpdate prepares the WorkbooksUpdate request. -func (c ApplicationInsightsClient) preparerForWorkbooksUpdate(ctx context.Context, id WorkbookId, input WorkbookUpdateParameters, options WorkbooksUpdateOperationOptions) (*http.Request, error) { +func (c WorkbooksAPIsClient) preparerForWorkbooksUpdate(ctx context.Context, id WorkbookId, input WorkbookUpdateParameters, options WorkbooksUpdateOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -86,7 +86,7 @@ func (c ApplicationInsightsClient) preparerForWorkbooksUpdate(ctx context.Contex // responderForWorkbooksUpdate handles the response to the WorkbooksUpdate request. The method always // closes the http.Response Body. -func (c ApplicationInsightsClient) responderForWorkbooksUpdate(resp *http.Response) (result WorkbooksUpdateOperationResponse, err error) { +func (c WorkbooksAPIsClient) responderForWorkbooksUpdate(resp *http.Response) (result WorkbooksUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbook.go similarity index 97% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbook.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbook.go index b4b430f5abcbf..44e7b742b7397 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbook.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbook.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookproperties.go similarity index 97% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookproperties.go index 54dee560daeb5..b1cc1c68a5683 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookproperties.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import ( "time" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookpropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookpropertiesupdateparameters.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookpropertiesupdateparameters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookpropertiesupdateparameters.go index 235662311c205..f27f938eb1299 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookpropertiesupdateparameters.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookpropertiesupdateparameters.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookupdateparameters.go similarity index 93% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookupdateparameters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookupdateparameters.go index a9dd334311ccc..b199d837b748d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/model_workbookupdateparameters.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/model_workbookupdateparameters.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/predicates.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/predicates.go index 39d3111c5aed7..9a1d22c7384fb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/predicates.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/predicates.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis type WorkbookOperationPredicate struct { Etag *string diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/version.go similarity index 67% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/version.go index b9a5f6adde708..0a9c841b785ed 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis/version.go @@ -1,4 +1,4 @@ -package applicationinsights +package workbooksapis import "fmt" @@ -8,5 +8,5 @@ import "fmt" const defaultApiVersion = "2022-04-01" func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationinsights/%s", defaultApiVersion) + return fmt.Sprintf("hashicorp/go-azure-sdk/workbooksapis/%s", defaultApiVersion) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/README.md new file mode 100644 index 0000000000000..37ae6ce25feae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/README.md @@ -0,0 +1,128 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups` Documentation + +The `dedicatedhostgroups` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2021-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups" +``` + + +### Client Initialization + +```go +client := dedicatedhostgroups.NewDedicatedHostGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DedicatedHostGroupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := dedicatedhostgroups.NewHostGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue") + +payload := dedicatedhostgroups.DedicatedHostGroup{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DedicatedHostGroupsClient.Delete` + +```go +ctx := context.TODO() +id := dedicatedhostgroups.NewHostGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DedicatedHostGroupsClient.Get` + +```go +ctx := context.TODO() +id := dedicatedhostgroups.NewHostGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue") + +read, err := client.Get(ctx, id, dedicatedhostgroups.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DedicatedHostGroupsClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := dedicatedhostgroups.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DedicatedHostGroupsClient.ListBySubscription` + +```go +ctx := context.TODO() +id := dedicatedhostgroups.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DedicatedHostGroupsClient.Update` + +```go +ctx := context.TODO() +id := dedicatedhostgroups.NewHostGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue") + +payload := dedicatedhostgroups.DedicatedHostGroupUpdate{ + // ... +} + + +read, err := client.Update(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/client.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/client.go index f35cbf2494aaf..134a20c571b25 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/client.go @@ -1,17 +1,17 @@ -package applicationinsights +package dedicatedhostgroups import "github.com/Azure/go-autorest/autorest" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationInsightsClient struct { +type DedicatedHostGroupsClient struct { Client autorest.Client baseUri string } -func NewApplicationInsightsClientWithBaseURI(endpoint string) ApplicationInsightsClient { - return ApplicationInsightsClient{ +func NewDedicatedHostGroupsClientWithBaseURI(endpoint string) DedicatedHostGroupsClient { + return DedicatedHostGroupsClient{ Client: autorest.NewClientWithUserAgent(userAgent()), baseUri: endpoint, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/constants.go new file mode 100644 index 0000000000000..6800a48d60e77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/constants.go @@ -0,0 +1,65 @@ +package dedicatedhostgroups + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewTypes string + +const ( + InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" + InstanceViewTypesUserData InstanceViewTypes = "userData" +) + +func PossibleValuesForInstanceViewTypes() []string { + return []string{ + string(InstanceViewTypesInstanceView), + string(InstanceViewTypesUserData), + } +} + +func parseInstanceViewTypes(input string) (*InstanceViewTypes, error) { + vals := map[string]InstanceViewTypes{ + "instanceview": InstanceViewTypesInstanceView, + "userdata": InstanceViewTypesUserData, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := InstanceViewTypes(input) + return &out, nil +} + +type StatusLevelTypes string + +const ( + StatusLevelTypesError StatusLevelTypes = "Error" + StatusLevelTypesInfo StatusLevelTypes = "Info" + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +func PossibleValuesForStatusLevelTypes() []string { + return []string{ + string(StatusLevelTypesError), + string(StatusLevelTypesInfo), + string(StatusLevelTypesWarning), + } +} + +func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { + vals := map[string]StatusLevelTypes{ + "error": StatusLevelTypesError, + "info": StatusLevelTypesInfo, + "warning": StatusLevelTypesWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StatusLevelTypes(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/id_hostgroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/id_hostgroup.go new file mode 100644 index 0000000000000..e6f1f64a37432 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/id_hostgroup.go @@ -0,0 +1,124 @@ +package dedicatedhostgroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = HostGroupId{} + +// HostGroupId is a struct representing the Resource ID for a Host Group +type HostGroupId struct { + SubscriptionId string + ResourceGroupName string + HostGroupName string +} + +// NewHostGroupID returns a new HostGroupId struct +func NewHostGroupID(subscriptionId string, resourceGroupName string, hostGroupName string) HostGroupId { + return HostGroupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + HostGroupName: hostGroupName, + } +} + +// ParseHostGroupID parses 'input' into a HostGroupId +func ParseHostGroupID(input string) (*HostGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(HostGroupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := HostGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.HostGroupName, ok = parsed.Parsed["hostGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'hostGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseHostGroupIDInsensitively parses 'input' case-insensitively into a HostGroupId +// note: this method should only be used for API response data and not user input +func ParseHostGroupIDInsensitively(input string) (*HostGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(HostGroupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := HostGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.HostGroupName, ok = parsed.Parsed["hostGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'hostGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateHostGroupID checks that 'input' can be parsed as a Host Group ID +func ValidateHostGroupID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseHostGroupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Host Group ID +func (id HostGroupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/hostGroups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.HostGroupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Host Group ID +func (id HostGroupId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("staticHostGroups", "hostGroups", "hostGroups"), + resourceids.UserSpecifiedSegment("hostGroupName", "hostGroupValue"), + } +} + +// String returns a human-readable description of this Host Group ID +func (id HostGroupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Host Group Name: %q", id.HostGroupName), + } + return fmt.Sprintf("Host Group (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..43753ae8f7a01 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_createorupdate_autorest.go @@ -0,0 +1,69 @@ +package dedicatedhostgroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + Model *DedicatedHostGroup +} + +// CreateOrUpdate ... +func (c DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, id HostGroupId, input DedicatedHostGroup) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCreateOrUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "CreateOrUpdate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c DedicatedHostGroupsClient) preparerForCreateOrUpdate(ctx context.Context, id HostGroupId, input DedicatedHostGroup) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (c DedicatedHostGroupsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_delete_autorest.go new file mode 100644 index 0000000000000..d8eead37c12a6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_delete_autorest.go @@ -0,0 +1,66 @@ +package dedicatedhostgroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response +} + +// Delete ... +func (c DedicatedHostGroupsClient) Delete(ctx context.Context, id HostGroupId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Delete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDelete prepares the Delete request. +func (c DedicatedHostGroupsClient) preparerForDelete(ctx context.Context, id HostGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDelete handles the response to the Delete request. The method always +// closes the http.Response Body. +func (c DedicatedHostGroupsClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_get_autorest.go new file mode 100644 index 0000000000000..d100587d001bb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_get_autorest.go @@ -0,0 +1,97 @@ +package dedicatedhostgroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *DedicatedHostGroup +} + +type GetOperationOptions struct { + Expand *InstanceViewTypes +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o GetOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Expand != nil { + out["$expand"] = *o.Expand + } + + return out +} + +// Get ... +func (c DedicatedHostGroupsClient) Get(ctx context.Context, id HostGroupId, options GetOperationOptions) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c DedicatedHostGroupsClient) preparerForGet(ctx context.Context, id HostGroupId, options GetOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c DedicatedHostGroupsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_listbyresourcegroup_autorest.go new file mode 100644 index 0000000000000..95b5f55a2a85d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_listbyresourcegroup_autorest.go @@ -0,0 +1,187 @@ +package dedicatedhostgroups + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + Model *[]DedicatedHostGroup + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupOperationResponse, error) +} + +type ListByResourceGroupCompleteResult struct { + Items []DedicatedHostGroup +} + +func (r ListByResourceGroupOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListByResourceGroupOperationResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// ListByResourceGroup ... +func (c DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroup(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListByResourceGroup", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListByResourceGroup(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListByResourceGroup", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListByResourceGroup prepares the ListByResourceGroup request. +func (c DedicatedHostGroupsClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.Compute/hostGroups", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListByResourceGroupWithNextLink prepares the ListByResourceGroup request with the given nextLink token. +func (c DedicatedHostGroupsClient) preparerForListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (c DedicatedHostGroupsClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { + type page struct { + Values []DedicatedHostGroup `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroupWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListByResourceGroup", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByResourceGroup(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListByResourceGroup", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListByResourceGroupComplete retrieves all of the results into a single object +func (c DedicatedHostGroupsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DedicatedHostGroupOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c DedicatedHostGroupsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DedicatedHostGroupOperationPredicate) (resp ListByResourceGroupCompleteResult, err error) { + items := make([]DedicatedHostGroup, 0) + + page, err := c.ListByResourceGroup(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListByResourceGroupCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_listbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_listbysubscription_autorest.go new file mode 100644 index 0000000000000..d1bf92328bfb9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_listbysubscription_autorest.go @@ -0,0 +1,187 @@ +package dedicatedhostgroups + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + Model *[]DedicatedHostGroup + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListBySubscriptionOperationResponse, error) +} + +type ListBySubscriptionCompleteResult struct { + Items []DedicatedHostGroup +} + +func (r ListBySubscriptionOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp ListBySubscriptionOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// ListBySubscription ... +func (c DedicatedHostGroupsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp ListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForListBySubscription(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListBySubscription", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListBySubscription(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListBySubscription", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListBySubscription prepares the ListBySubscription request. +func (c DedicatedHostGroupsClient) preparerForListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.Compute/hostGroups", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListBySubscriptionWithNextLink prepares the ListBySubscription request with the given nextLink token. +func (c DedicatedHostGroupsClient) preparerForListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListBySubscription handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (c DedicatedHostGroupsClient) responderForListBySubscription(resp *http.Response) (result ListBySubscriptionOperationResponse, err error) { + type page struct { + Values []DedicatedHostGroup `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForListBySubscriptionWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListBySubscription", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListBySubscription(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "ListBySubscription", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListBySubscriptionComplete retrieves all of the results into a single object +func (c DedicatedHostGroupsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, DedicatedHostGroupOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c DedicatedHostGroupsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DedicatedHostGroupOperationPredicate) (resp ListBySubscriptionCompleteResult, err error) { + items := make([]DedicatedHostGroup, 0) + + page, err := c.ListBySubscription(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListBySubscriptionCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_update_autorest.go new file mode 100644 index 0000000000000..368f672222b01 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/method_update_autorest.go @@ -0,0 +1,69 @@ +package dedicatedhostgroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + Model *DedicatedHostGroup +} + +// Update ... +func (c DedicatedHostGroupsClient) Update(ctx context.Context, id HostGroupId, input DedicatedHostGroupUpdate) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Update", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhostgroups.DedicatedHostGroupsClient", "Update", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForUpdate prepares the Update request. +func (c DedicatedHostGroupsClient) preparerForUpdate(ctx context.Context, id HostGroupId, input DedicatedHostGroupUpdate) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForUpdate handles the response to the Update request. The method always +// closes the http.Response Body. +func (c DedicatedHostGroupsClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoflags.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostallocatablevm.go similarity index 50% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoflags.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostallocatablevm.go index 4aba0b3e160a1..eb95a66408c22 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoflags.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostallocatablevm.go @@ -1,10 +1,9 @@ -package videoanalyzer +package dedicatedhostgroups // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type VideoFlags struct { - CanStream bool `json:"canStream"` - HasData bool `json:"hasData"` - IsRecording bool `json:"isRecording"` +type DedicatedHostAllocatableVM struct { + Count *float64 `json:"count,omitempty"` + VmSize *string `json:"vmSize,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostavailablecapacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostavailablecapacity.go new file mode 100644 index 0000000000000..645a995fd14b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostavailablecapacity.go @@ -0,0 +1,8 @@ +package dedicatedhostgroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostAvailableCapacity struct { + AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroup.go new file mode 100644 index 0000000000000..3c175527c0e66 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroup.go @@ -0,0 +1,14 @@ +package dedicatedhostgroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostGroup struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *DedicatedHostGroupProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *[]string `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupinstanceview.go new file mode 100644 index 0000000000000..4f3f4179ea88d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupinstanceview.go @@ -0,0 +1,8 @@ +package dedicatedhostgroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostGroupInstanceView struct { + Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupproperties.go new file mode 100644 index 0000000000000..57f37cb87a9d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupproperties.go @@ -0,0 +1,11 @@ +package dedicatedhostgroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostGroupProperties struct { + Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` + InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` + PlatformFaultDomainCount int64 `json:"platformFaultDomainCount"` + SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupupdate.go new file mode 100644 index 0000000000000..4630d43c8456c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostgroupupdate.go @@ -0,0 +1,10 @@ +package dedicatedhostgroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostGroupUpdate struct { + Properties *DedicatedHostGroupProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Zones *[]string `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostinstanceviewwithname.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostinstanceviewwithname.go new file mode 100644 index 0000000000000..e8c322787600e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_dedicatedhostinstanceviewwithname.go @@ -0,0 +1,11 @@ +package dedicatedhostgroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostInstanceViewWithName struct { + AssetId *string `json:"assetId,omitempty"` + AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` + Name *string `json:"name,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_instanceviewstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_instanceviewstatus.go new file mode 100644 index 0000000000000..74b66b61bc6bf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_instanceviewstatus.go @@ -0,0 +1,30 @@ +package dedicatedhostgroups + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewStatus struct { + Code *string `json:"code,omitempty"` + DisplayStatus *string `json:"displayStatus,omitempty"` + Level *StatusLevelTypes `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *InstanceViewStatus) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_tokenclaim.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_subresourcereadonly.go similarity index 60% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_tokenclaim.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_subresourcereadonly.go index 260109ed17501..9c5ae8726a88e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_tokenclaim.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/model_subresourcereadonly.go @@ -1,9 +1,8 @@ -package videoanalyzer +package dedicatedhostgroups // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type TokenClaim struct { - Name string `json:"name"` - Value string `json:"value"` +type SubResourceReadOnly struct { + Id *string `json:"id,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/predicates.go new file mode 100644 index 0000000000000..34bfe81b45870 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/predicates.go @@ -0,0 +1,29 @@ +package dedicatedhostgroups + +type DedicatedHostGroupOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p DedicatedHostGroupOperationPredicate) Matches(input DedicatedHostGroup) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/version.go new file mode 100644 index 0000000000000..788e7707a6b86 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups/version.go @@ -0,0 +1,12 @@ +package dedicatedhostgroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/dedicatedhostgroups/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/README.md new file mode 100644 index 0000000000000..da7c59d40644c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts` Documentation + +The `dedicatedhosts` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2021-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts" +``` + + +### Client Initialization + +```go +client := dedicatedhosts.NewDedicatedHostsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DedicatedHostsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := dedicatedhosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue", "hostValue") + +payload := dedicatedhosts.DedicatedHost{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DedicatedHostsClient.Delete` + +```go +ctx := context.TODO() +id := dedicatedhosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue", "hostValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DedicatedHostsClient.Get` + +```go +ctx := context.TODO() +id := dedicatedhosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue", "hostValue") + +read, err := client.Get(ctx, id, dedicatedhosts.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DedicatedHostsClient.Update` + +```go +ctx := context.TODO() +id := dedicatedhosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostGroupValue", "hostValue") + +payload := dedicatedhosts.DedicatedHostUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/client.go similarity index 66% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/client.go index 1f34a06b408f3..23417d2b3cc2f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/client.go @@ -1,17 +1,17 @@ -package policyinsights +package dedicatedhosts import "github.com/Azure/go-autorest/autorest" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PolicyInsightsClient struct { +type DedicatedHostsClient struct { Client autorest.Client baseUri string } -func NewPolicyInsightsClientWithBaseURI(endpoint string) PolicyInsightsClient { - return PolicyInsightsClient{ +func NewDedicatedHostsClientWithBaseURI(endpoint string) DedicatedHostsClient { + return DedicatedHostsClient{ Client: autorest.NewClientWithUserAgent(userAgent()), baseUri: endpoint, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/constants.go new file mode 100644 index 0000000000000..686182ccc3e8e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/constants.go @@ -0,0 +1,96 @@ +package dedicatedhosts + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostLicenseTypes string + +const ( + DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" + DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" + DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" +) + +func PossibleValuesForDedicatedHostLicenseTypes() []string { + return []string{ + string(DedicatedHostLicenseTypesNone), + string(DedicatedHostLicenseTypesWindowsServerHybrid), + string(DedicatedHostLicenseTypesWindowsServerPerpetual), + } +} + +func parseDedicatedHostLicenseTypes(input string) (*DedicatedHostLicenseTypes, error) { + vals := map[string]DedicatedHostLicenseTypes{ + "none": DedicatedHostLicenseTypesNone, + "windows_server_hybrid": DedicatedHostLicenseTypesWindowsServerHybrid, + "windows_server_perpetual": DedicatedHostLicenseTypesWindowsServerPerpetual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DedicatedHostLicenseTypes(input) + return &out, nil +} + +type InstanceViewTypes string + +const ( + InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" + InstanceViewTypesUserData InstanceViewTypes = "userData" +) + +func PossibleValuesForInstanceViewTypes() []string { + return []string{ + string(InstanceViewTypesInstanceView), + string(InstanceViewTypesUserData), + } +} + +func parseInstanceViewTypes(input string) (*InstanceViewTypes, error) { + vals := map[string]InstanceViewTypes{ + "instanceview": InstanceViewTypesInstanceView, + "userdata": InstanceViewTypesUserData, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := InstanceViewTypes(input) + return &out, nil +} + +type StatusLevelTypes string + +const ( + StatusLevelTypesError StatusLevelTypes = "Error" + StatusLevelTypesInfo StatusLevelTypes = "Info" + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +func PossibleValuesForStatusLevelTypes() []string { + return []string{ + string(StatusLevelTypesError), + string(StatusLevelTypesInfo), + string(StatusLevelTypesWarning), + } +} + +func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { + vals := map[string]StatusLevelTypes{ + "error": StatusLevelTypesError, + "info": StatusLevelTypesInfo, + "warning": StatusLevelTypesWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StatusLevelTypes(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/id_host.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/id_host.go new file mode 100644 index 0000000000000..027aa1b4eb7a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/id_host.go @@ -0,0 +1,137 @@ +package dedicatedhosts + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = HostId{} + +// HostId is a struct representing the Resource ID for a Host +type HostId struct { + SubscriptionId string + ResourceGroupName string + HostGroupName string + HostName string +} + +// NewHostID returns a new HostId struct +func NewHostID(subscriptionId string, resourceGroupName string, hostGroupName string, hostName string) HostId { + return HostId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + HostGroupName: hostGroupName, + HostName: hostName, + } +} + +// ParseHostID parses 'input' into a HostId +func ParseHostID(input string) (*HostId, error) { + parser := resourceids.NewParserFromResourceIdType(HostId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := HostId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.HostGroupName, ok = parsed.Parsed["hostGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'hostGroupName' was not found in the resource id %q", input) + } + + if id.HostName, ok = parsed.Parsed["hostName"]; !ok { + return nil, fmt.Errorf("the segment 'hostName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseHostIDInsensitively parses 'input' case-insensitively into a HostId +// note: this method should only be used for API response data and not user input +func ParseHostIDInsensitively(input string) (*HostId, error) { + parser := resourceids.NewParserFromResourceIdType(HostId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := HostId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.HostGroupName, ok = parsed.Parsed["hostGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'hostGroupName' was not found in the resource id %q", input) + } + + if id.HostName, ok = parsed.Parsed["hostName"]; !ok { + return nil, fmt.Errorf("the segment 'hostName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateHostID checks that 'input' can be parsed as a Host ID +func ValidateHostID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseHostID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Host ID +func (id HostId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/hostGroups/%s/hosts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.HostGroupName, id.HostName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Host ID +func (id HostId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("staticHostGroups", "hostGroups", "hostGroups"), + resourceids.UserSpecifiedSegment("hostGroupName", "hostGroupValue"), + resourceids.StaticSegment("staticHosts", "hosts", "hosts"), + resourceids.UserSpecifiedSegment("hostName", "hostValue"), + } +} + +// String returns a human-readable description of this Host ID +func (id HostId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Host Group Name: %q", id.HostGroupName), + fmt.Sprintf("Host Name: %q", id.HostName), + } + return fmt.Sprintf("Host (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..7a949f91c987d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package dedicatedhosts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c DedicatedHostsClient) CreateOrUpdate(ctx context.Context, id HostId, input DedicatedHost) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c DedicatedHostsClient) CreateOrUpdateThenPoll(ctx context.Context, id HostId, input DedicatedHost) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c DedicatedHostsClient) preparerForCreateOrUpdate(ctx context.Context, id HostId, input DedicatedHost) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c DedicatedHostsClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_delete_autorest.go new file mode 100644 index 0000000000000..9730b615da41d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_delete_autorest.go @@ -0,0 +1,78 @@ +package dedicatedhosts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c DedicatedHostsClient) Delete(ctx context.Context, id HostId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c DedicatedHostsClient) DeleteThenPoll(ctx context.Context, id HostId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c DedicatedHostsClient) preparerForDelete(ctx context.Context, id HostId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c DedicatedHostsClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_get_autorest.go new file mode 100644 index 0000000000000..ff03643bbe776 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_get_autorest.go @@ -0,0 +1,97 @@ +package dedicatedhosts + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *DedicatedHost +} + +type GetOperationOptions struct { + Expand *InstanceViewTypes +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o GetOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Expand != nil { + out["$expand"] = *o.Expand + } + + return out +} + +// Get ... +func (c DedicatedHostsClient) Get(ctx context.Context, id HostId, options GetOperationOptions) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c DedicatedHostsClient) preparerForGet(ctx context.Context, id HostId, options GetOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c DedicatedHostsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_update_autorest.go new file mode 100644 index 0000000000000..be212b805b90d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/method_update_autorest.go @@ -0,0 +1,79 @@ +package dedicatedhosts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c DedicatedHostsClient) Update(ctx context.Context, id HostId, input DedicatedHostUpdate) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "dedicatedhosts.DedicatedHostsClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c DedicatedHostsClient) UpdateThenPoll(ctx context.Context, id HostId, input DedicatedHostUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c DedicatedHostsClient) preparerForUpdate(ctx context.Context, id HostId, input DedicatedHostUpdate) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c DedicatedHostsClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhost.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhost.go new file mode 100644 index 0000000000000..c5b706c12d856 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhost.go @@ -0,0 +1,14 @@ +package dedicatedhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHost struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *DedicatedHostProperties `json:"properties,omitempty"` + Sku Sku `json:"sku"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostallocatablevm.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostallocatablevm.go new file mode 100644 index 0000000000000..62a06248b736a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostallocatablevm.go @@ -0,0 +1,9 @@ +package dedicatedhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostAllocatableVM struct { + Count *float64 `json:"count,omitempty"` + VmSize *string `json:"vmSize,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostavailablecapacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostavailablecapacity.go new file mode 100644 index 0000000000000..4a815b0460c10 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostavailablecapacity.go @@ -0,0 +1,8 @@ +package dedicatedhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostAvailableCapacity struct { + AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostinstanceview.go new file mode 100644 index 0000000000000..7574083ca0d79 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostinstanceview.go @@ -0,0 +1,10 @@ +package dedicatedhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostInstanceView struct { + AssetId *string `json:"assetId,omitempty"` + AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostproperties.go new file mode 100644 index 0000000000000..067483736a4cc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostproperties.go @@ -0,0 +1,46 @@ +package dedicatedhosts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostProperties struct { + AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` + HostId *string `json:"hostId,omitempty"` + InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` + LicenseType *DedicatedHostLicenseTypes `json:"licenseType,omitempty"` + PlatformFaultDomain *int64 `json:"platformFaultDomain,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProvisioningTime *string `json:"provisioningTime,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` +} + +func (o *DedicatedHostProperties) GetProvisioningTimeAsTime() (*time.Time, error) { + if o.ProvisioningTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ProvisioningTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *DedicatedHostProperties) SetProvisioningTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ProvisioningTime = &formatted +} + +func (o *DedicatedHostProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *DedicatedHostProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostupdate.go new file mode 100644 index 0000000000000..c2a21bb93d1c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_dedicatedhostupdate.go @@ -0,0 +1,9 @@ +package dedicatedhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DedicatedHostUpdate struct { + Properties *DedicatedHostProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_instanceviewstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_instanceviewstatus.go new file mode 100644 index 0000000000000..fe3a89546ec6d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_instanceviewstatus.go @@ -0,0 +1,30 @@ +package dedicatedhosts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewStatus struct { + Code *string `json:"code,omitempty"` + DisplayStatus *string `json:"displayStatus,omitempty"` + Level *StatusLevelTypes `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *InstanceViewStatus) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_sku.go new file mode 100644 index 0000000000000..ce3dda6ffbe55 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_sku.go @@ -0,0 +1,10 @@ +package dedicatedhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Sku struct { + Capacity *int64 `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videomediainfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_subresourcereadonly.go similarity index 59% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videomediainfo.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_subresourcereadonly.go index c21d687ba669b..91dea24f8e1a5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videomediainfo.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/model_subresourcereadonly.go @@ -1,8 +1,8 @@ -package videoanalyzer +package dedicatedhosts // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type VideoMediaInfo struct { - SegmentLength *string `json:"segmentLength,omitempty"` +type SubResourceReadOnly struct { + Id *string `json:"id,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/version.go new file mode 100644 index 0000000000000..74e63de99bd9e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts/version.go @@ -0,0 +1,12 @@ +package dedicatedhosts + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/dedicatedhosts/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/README.md new file mode 100644 index 0000000000000..fa0670fe30c30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports` Documentation + +The `exports` SDK allows for interaction with the Azure Resource Manager Service `costmanagement` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports" +``` + + +### Client Initialization + +```go +client := exports.NewExportsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExportsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportValue") + +payload := exports.Export{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExportsClient.Delete` + +```go +ctx := context.TODO() +id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExportsClient.Execute` + +```go +ctx := context.TODO() +id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportValue") + +read, err := client.Execute(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExportsClient.Get` + +```go +ctx := context.TODO() +id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportValue") + +read, err := client.Get(ctx, id, exports.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExportsClient.GetExecutionHistory` + +```go +ctx := context.TODO() +id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportValue") + +read, err := client.GetExecutionHistory(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExportsClient.List` + +```go +ctx := context.TODO() +id := exports.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.List(ctx, id, exports.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/client.go similarity index 65% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/client.go index b2fd1fa9c1729..512e25c313c43 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/client.go @@ -1,17 +1,17 @@ -package managedidentity +package exports import "github.com/Azure/go-autorest/autorest" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ManagedIdentityClient struct { +type ExportsClient struct { Client autorest.Client baseUri string } -func NewManagedIdentityClientWithBaseURI(endpoint string) ManagedIdentityClient { - return ManagedIdentityClient{ +func NewExportsClientWithBaseURI(endpoint string) ExportsClient { + return ExportsClient{ Client: autorest.NewClientWithUserAgent(userAgent()), baseUri: endpoint, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/constants.go new file mode 100644 index 0000000000000..98fefa2ae1d72 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/constants.go @@ -0,0 +1,260 @@ +package exports + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatus string + +const ( + ExecutionStatusCompleted ExecutionStatus = "Completed" + ExecutionStatusDataNotAvailable ExecutionStatus = "DataNotAvailable" + ExecutionStatusFailed ExecutionStatus = "Failed" + ExecutionStatusInProgress ExecutionStatus = "InProgress" + ExecutionStatusNewDataNotAvailable ExecutionStatus = "NewDataNotAvailable" + ExecutionStatusQueued ExecutionStatus = "Queued" + ExecutionStatusTimeout ExecutionStatus = "Timeout" +) + +func PossibleValuesForExecutionStatus() []string { + return []string{ + string(ExecutionStatusCompleted), + string(ExecutionStatusDataNotAvailable), + string(ExecutionStatusFailed), + string(ExecutionStatusInProgress), + string(ExecutionStatusNewDataNotAvailable), + string(ExecutionStatusQueued), + string(ExecutionStatusTimeout), + } +} + +func parseExecutionStatus(input string) (*ExecutionStatus, error) { + vals := map[string]ExecutionStatus{ + "completed": ExecutionStatusCompleted, + "datanotavailable": ExecutionStatusDataNotAvailable, + "failed": ExecutionStatusFailed, + "inprogress": ExecutionStatusInProgress, + "newdatanotavailable": ExecutionStatusNewDataNotAvailable, + "queued": ExecutionStatusQueued, + "timeout": ExecutionStatusTimeout, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExecutionStatus(input) + return &out, nil +} + +type ExecutionType string + +const ( + ExecutionTypeOnDemand ExecutionType = "OnDemand" + ExecutionTypeScheduled ExecutionType = "Scheduled" +) + +func PossibleValuesForExecutionType() []string { + return []string{ + string(ExecutionTypeOnDemand), + string(ExecutionTypeScheduled), + } +} + +func parseExecutionType(input string) (*ExecutionType, error) { + vals := map[string]ExecutionType{ + "ondemand": ExecutionTypeOnDemand, + "scheduled": ExecutionTypeScheduled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExecutionType(input) + return &out, nil +} + +type ExportType string + +const ( + ExportTypeActualCost ExportType = "ActualCost" + ExportTypeAmortizedCost ExportType = "AmortizedCost" + ExportTypeUsage ExportType = "Usage" +) + +func PossibleValuesForExportType() []string { + return []string{ + string(ExportTypeActualCost), + string(ExportTypeAmortizedCost), + string(ExportTypeUsage), + } +} + +func parseExportType(input string) (*ExportType, error) { + vals := map[string]ExportType{ + "actualcost": ExportTypeActualCost, + "amortizedcost": ExportTypeAmortizedCost, + "usage": ExportTypeUsage, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ExportType(input) + return &out, nil +} + +type FormatType string + +const ( + FormatTypeCsv FormatType = "Csv" +) + +func PossibleValuesForFormatType() []string { + return []string{ + string(FormatTypeCsv), + } +} + +func parseFormatType(input string) (*FormatType, error) { + vals := map[string]FormatType{ + "csv": FormatTypeCsv, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FormatType(input) + return &out, nil +} + +type GranularityType string + +const ( + GranularityTypeDaily GranularityType = "Daily" +) + +func PossibleValuesForGranularityType() []string { + return []string{ + string(GranularityTypeDaily), + } +} + +func parseGranularityType(input string) (*GranularityType, error) { + vals := map[string]GranularityType{ + "daily": GranularityTypeDaily, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GranularityType(input) + return &out, nil +} + +type RecurrenceType string + +const ( + RecurrenceTypeAnnually RecurrenceType = "Annually" + RecurrenceTypeDaily RecurrenceType = "Daily" + RecurrenceTypeMonthly RecurrenceType = "Monthly" + RecurrenceTypeWeekly RecurrenceType = "Weekly" +) + +func PossibleValuesForRecurrenceType() []string { + return []string{ + string(RecurrenceTypeAnnually), + string(RecurrenceTypeDaily), + string(RecurrenceTypeMonthly), + string(RecurrenceTypeWeekly), + } +} + +func parseRecurrenceType(input string) (*RecurrenceType, error) { + vals := map[string]RecurrenceType{ + "annually": RecurrenceTypeAnnually, + "daily": RecurrenceTypeDaily, + "monthly": RecurrenceTypeMonthly, + "weekly": RecurrenceTypeWeekly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RecurrenceType(input) + return &out, nil +} + +type StatusType string + +const ( + StatusTypeActive StatusType = "Active" + StatusTypeInactive StatusType = "Inactive" +) + +func PossibleValuesForStatusType() []string { + return []string{ + string(StatusTypeActive), + string(StatusTypeInactive), + } +} + +func parseStatusType(input string) (*StatusType, error) { + vals := map[string]StatusType{ + "active": StatusTypeActive, + "inactive": StatusTypeInactive, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StatusType(input) + return &out, nil +} + +type TimeframeType string + +const ( + TimeframeTypeBillingMonthToDate TimeframeType = "BillingMonthToDate" + TimeframeTypeCustom TimeframeType = "Custom" + TimeframeTypeMonthToDate TimeframeType = "MonthToDate" + TimeframeTypeTheLastBillingMonth TimeframeType = "TheLastBillingMonth" + TimeframeTypeTheLastMonth TimeframeType = "TheLastMonth" + TimeframeTypeWeekToDate TimeframeType = "WeekToDate" +) + +func PossibleValuesForTimeframeType() []string { + return []string{ + string(TimeframeTypeBillingMonthToDate), + string(TimeframeTypeCustom), + string(TimeframeTypeMonthToDate), + string(TimeframeTypeTheLastBillingMonth), + string(TimeframeTypeTheLastMonth), + string(TimeframeTypeWeekToDate), + } +} + +func parseTimeframeType(input string) (*TimeframeType, error) { + vals := map[string]TimeframeType{ + "billingmonthtodate": TimeframeTypeBillingMonthToDate, + "custom": TimeframeTypeCustom, + "monthtodate": TimeframeTypeMonthToDate, + "thelastbillingmonth": TimeframeTypeTheLastBillingMonth, + "thelastmonth": TimeframeTypeTheLastMonth, + "weektodate": TimeframeTypeWeekToDate, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TimeframeType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/id_scopedexport.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/id_scopedexport.go new file mode 100644 index 0000000000000..6c5f4a1dfb0dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/id_scopedexport.go @@ -0,0 +1,110 @@ +package exports + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ScopedExportId{} + +// ScopedExportId is a struct representing the Resource ID for a Scoped Export +type ScopedExportId struct { + Scope string + ExportName string +} + +// NewScopedExportID returns a new ScopedExportId struct +func NewScopedExportID(scope string, exportName string) ScopedExportId { + return ScopedExportId{ + Scope: scope, + ExportName: exportName, + } +} + +// ParseScopedExportID parses 'input' into a ScopedExportId +func ParseScopedExportID(input string) (*ScopedExportId, error) { + parser := resourceids.NewParserFromResourceIdType(ScopedExportId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ScopedExportId{} + + if id.Scope, ok = parsed.Parsed["scope"]; !ok { + return nil, fmt.Errorf("the segment 'scope' was not found in the resource id %q", input) + } + + if id.ExportName, ok = parsed.Parsed["exportName"]; !ok { + return nil, fmt.Errorf("the segment 'exportName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseScopedExportIDInsensitively parses 'input' case-insensitively into a ScopedExportId +// note: this method should only be used for API response data and not user input +func ParseScopedExportIDInsensitively(input string) (*ScopedExportId, error) { + parser := resourceids.NewParserFromResourceIdType(ScopedExportId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ScopedExportId{} + + if id.Scope, ok = parsed.Parsed["scope"]; !ok { + return nil, fmt.Errorf("the segment 'scope' was not found in the resource id %q", input) + } + + if id.ExportName, ok = parsed.Parsed["exportName"]; !ok { + return nil, fmt.Errorf("the segment 'exportName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateScopedExportID checks that 'input' can be parsed as a Scoped Export ID +func ValidateScopedExportID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseScopedExportID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Scoped Export ID +func (id ScopedExportId) ID() string { + fmtString := "/%s/providers/Microsoft.CostManagement/exports/%s" + return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.ExportName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Scoped Export ID +func (id ScopedExportId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), + resourceids.StaticSegment("staticExports", "exports", "exports"), + resourceids.UserSpecifiedSegment("exportName", "exportValue"), + } +} + +// String returns a human-readable description of this Scoped Export ID +func (id ScopedExportId) String() string { + components := []string{ + fmt.Sprintf("Scope: %q", id.Scope), + fmt.Sprintf("Export Name: %q", id.ExportName), + } + return fmt.Sprintf("Scoped Export (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..86eb1416ecdcd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_createorupdate_autorest.go @@ -0,0 +1,69 @@ +package exports + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + Model *Export +} + +// CreateOrUpdate ... +func (c ExportsClient) CreateOrUpdate(ctx context.Context, id ScopedExportId, input Export) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCreateOrUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "CreateOrUpdate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c ExportsClient) preparerForCreateOrUpdate(ctx context.Context, id ScopedExportId, input Export) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (c ExportsClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_delete_autorest.go new file mode 100644 index 0000000000000..60ee5b3426b99 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_delete_autorest.go @@ -0,0 +1,66 @@ +package exports + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response +} + +// Delete ... +func (c ExportsClient) Delete(ctx context.Context, id ScopedExportId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Delete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Delete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDelete prepares the Delete request. +func (c ExportsClient) preparerForDelete(ctx context.Context, id ScopedExportId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDelete handles the response to the Delete request. The method always +// closes the http.Response Body. +func (c ExportsClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_execute_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_execute_autorest.go new file mode 100644 index 0000000000000..4468e0c911d3a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_execute_autorest.go @@ -0,0 +1,67 @@ +package exports + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecuteOperationResponse struct { + HttpResponse *http.Response +} + +// Execute ... +func (c ExportsClient) Execute(ctx context.Context, id ScopedExportId) (result ExecuteOperationResponse, err error) { + req, err := c.preparerForExecute(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Execute", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Execute", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForExecute(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Execute", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForExecute prepares the Execute request. +func (c ExportsClient) preparerForExecute(ctx context.Context, id ScopedExportId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/run", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForExecute handles the response to the Execute request. The method always +// closes the http.Response Body. +func (c ExportsClient) responderForExecute(resp *http.Response) (result ExecuteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_get_autorest.go new file mode 100644 index 0000000000000..a65445b22a7a5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_get_autorest.go @@ -0,0 +1,97 @@ +package exports + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Export +} + +type GetOperationOptions struct { + Expand *string +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o GetOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Expand != nil { + out["$expand"] = *o.Expand + } + + return out +} + +// Get ... +func (c ExportsClient) Get(ctx context.Context, id ScopedExportId, options GetOperationOptions) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c ExportsClient) preparerForGet(ctx context.Context, id ScopedExportId, options GetOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c ExportsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_getexecutionhistory_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_getexecutionhistory_autorest.go new file mode 100644 index 0000000000000..bfb71da0ce892 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_getexecutionhistory_autorest.go @@ -0,0 +1,69 @@ +package exports + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetExecutionHistoryOperationResponse struct { + HttpResponse *http.Response + Model *ExportExecutionListResult +} + +// GetExecutionHistory ... +func (c ExportsClient) GetExecutionHistory(ctx context.Context, id ScopedExportId) (result GetExecutionHistoryOperationResponse, err error) { + req, err := c.preparerForGetExecutionHistory(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "GetExecutionHistory", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "GetExecutionHistory", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGetExecutionHistory(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "GetExecutionHistory", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGetExecutionHistory prepares the GetExecutionHistory request. +func (c ExportsClient) preparerForGetExecutionHistory(ctx context.Context, id ScopedExportId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/runHistory", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGetExecutionHistory handles the response to the GetExecutionHistory request. The method always +// closes the http.Response Body. +func (c ExportsClient) responderForGetExecutionHistory(resp *http.Response) (result GetExecutionHistoryOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_list_autorest.go new file mode 100644 index 0000000000000..d9b422de4fcc2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/method_list_autorest.go @@ -0,0 +1,99 @@ +package exports + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *ExportListResult +} + +type ListOperationOptions struct { + Expand *string +} + +func DefaultListOperationOptions() ListOperationOptions { + return ListOperationOptions{} +} + +func (o ListOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Expand != nil { + out["$expand"] = *o.Expand + } + + return out +} + +// List ... +func (c ExportsClient) List(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (result ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "exports.ExportsClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForList prepares the List request. +func (c ExportsClient) preparerForList(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.CostManagement/exports", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c ExportsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_commonexportproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_commonexportproperties.go new file mode 100644 index 0000000000000..814103b70a7db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_commonexportproperties.go @@ -0,0 +1,31 @@ +package exports + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CommonExportProperties struct { + Definition ExportDefinition `json:"definition"` + DeliveryInfo ExportDeliveryInfo `json:"deliveryInfo"` + Format *FormatType `json:"format,omitempty"` + NextRunTimeEstimate *string `json:"nextRunTimeEstimate,omitempty"` + PartitionData *bool `json:"partitionData,omitempty"` + RunHistory *ExportExecutionListResult `json:"runHistory,omitempty"` +} + +func (o *CommonExportProperties) GetNextRunTimeEstimateAsTime() (*time.Time, error) { + if o.NextRunTimeEstimate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.NextRunTimeEstimate, "2006-01-02T15:04:05Z07:00") +} + +func (o *CommonExportProperties) SetNextRunTimeEstimateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.NextRunTimeEstimate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_errordetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_errordetails.go new file mode 100644 index 0000000000000..def5fc753e17b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_errordetails.go @@ -0,0 +1,9 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ErrorDetails struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_export.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_export.go new file mode 100644 index 0000000000000..ea296361983c3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_export.go @@ -0,0 +1,12 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Export struct { + ETag *string `json:"eTag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExportProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdataset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdataset.go new file mode 100644 index 0000000000000..c4a8d5acdf870 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdataset.go @@ -0,0 +1,9 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportDataset struct { + Configuration *ExportDatasetConfiguration `json:"configuration,omitempty"` + Granularity *GranularityType `json:"granularity,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videostreaming.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdatasetconfiguration.go similarity index 59% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videostreaming.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdatasetconfiguration.go index ab492acba232c..9acc4e43e924a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videostreaming.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdatasetconfiguration.go @@ -1,8 +1,8 @@ -package videoanalyzer +package exports // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type VideoStreaming struct { - ArchiveBaseUrl *string `json:"archiveBaseUrl,omitempty"` +type ExportDatasetConfiguration struct { + Columns *[]string `json:"columns,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdefinition.go new file mode 100644 index 0000000000000..d128ed638e62d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdefinition.go @@ -0,0 +1,11 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportDefinition struct { + DataSet *ExportDataset `json:"dataSet,omitempty"` + TimePeriod *ExportTimePeriod `json:"timePeriod,omitempty"` + Timeframe TimeframeType `json:"timeframe"` + Type ExportType `json:"type"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdeliverydestination.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdeliverydestination.go new file mode 100644 index 0000000000000..56cff46854a7e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdeliverydestination.go @@ -0,0 +1,12 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportDeliveryDestination struct { + Container string `json:"container"` + ResourceId *string `json:"resourceId,omitempty"` + RootFolderPath *string `json:"rootFolderPath,omitempty"` + SasToken *string `json:"sasToken,omitempty"` + StorageAccount *string `json:"storageAccount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdeliveryinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdeliveryinfo.go new file mode 100644 index 0000000000000..204ca440e9fa8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportdeliveryinfo.go @@ -0,0 +1,8 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportDeliveryInfo struct { + Destination ExportDeliveryDestination `json:"destination"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecution.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecution.go new file mode 100644 index 0000000000000..5cddc2df1e6bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecution.go @@ -0,0 +1,12 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportExecution struct { + ETag *string `json:"eTag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ExportExecutionProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecutionlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecutionlistresult.go new file mode 100644 index 0000000000000..a07b784ea303f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecutionlistresult.go @@ -0,0 +1,8 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportExecutionListResult struct { + Value *[]ExportExecution `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecutionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecutionproperties.go new file mode 100644 index 0000000000000..c29e900fc3dc6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportexecutionproperties.go @@ -0,0 +1,58 @@ +package exports + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportExecutionProperties struct { + Error *ErrorDetails `json:"error,omitempty"` + ExecutionType *ExecutionType `json:"executionType,omitempty"` + FileName *string `json:"fileName,omitempty"` + ProcessingEndTime *string `json:"processingEndTime,omitempty"` + ProcessingStartTime *string `json:"processingStartTime,omitempty"` + RunSettings *CommonExportProperties `json:"runSettings,omitempty"` + Status *ExecutionStatus `json:"status,omitempty"` + SubmittedBy *string `json:"submittedBy,omitempty"` + SubmittedTime *string `json:"submittedTime,omitempty"` +} + +func (o *ExportExecutionProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { + if o.ProcessingEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportExecutionProperties) SetProcessingEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ProcessingEndTime = &formatted +} + +func (o *ExportExecutionProperties) GetProcessingStartTimeAsTime() (*time.Time, error) { + if o.ProcessingStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ProcessingStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportExecutionProperties) SetProcessingStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ProcessingStartTime = &formatted +} + +func (o *ExportExecutionProperties) GetSubmittedTimeAsTime() (*time.Time, error) { + if o.SubmittedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmittedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportExecutionProperties) SetSubmittedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmittedTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportlistresult.go new file mode 100644 index 0000000000000..6e50ebcc28366 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportlistresult.go @@ -0,0 +1,8 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportListResult struct { + Value *[]Export `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportproperties.go new file mode 100644 index 0000000000000..13dbc84cd87d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportproperties.go @@ -0,0 +1,32 @@ +package exports + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportProperties struct { + Definition ExportDefinition `json:"definition"` + DeliveryInfo ExportDeliveryInfo `json:"deliveryInfo"` + Format *FormatType `json:"format,omitempty"` + NextRunTimeEstimate *string `json:"nextRunTimeEstimate,omitempty"` + PartitionData *bool `json:"partitionData,omitempty"` + RunHistory *ExportExecutionListResult `json:"runHistory,omitempty"` + Schedule *ExportSchedule `json:"schedule,omitempty"` +} + +func (o *ExportProperties) GetNextRunTimeEstimateAsTime() (*time.Time, error) { + if o.NextRunTimeEstimate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.NextRunTimeEstimate, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportProperties) SetNextRunTimeEstimateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.NextRunTimeEstimate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportrecurrenceperiod.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportrecurrenceperiod.go new file mode 100644 index 0000000000000..b78c9ceddfee5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportrecurrenceperiod.go @@ -0,0 +1,36 @@ +package exports + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportRecurrencePeriod struct { + From string `json:"from"` + To *string `json:"to,omitempty"` +} + +func (o *ExportRecurrencePeriod) GetFromAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.From, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportRecurrencePeriod) SetFromAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.From = formatted +} + +func (o *ExportRecurrencePeriod) GetToAsTime() (*time.Time, error) { + if o.To == nil { + return nil, nil + } + return dates.ParseAsFormat(o.To, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportRecurrencePeriod) SetToAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.To = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportschedule.go new file mode 100644 index 0000000000000..d9a1f5757c78a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exportschedule.go @@ -0,0 +1,10 @@ +package exports + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportSchedule struct { + Recurrence *RecurrenceType `json:"recurrence,omitempty"` + RecurrencePeriod *ExportRecurrencePeriod `json:"recurrencePeriod,omitempty"` + Status *StatusType `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exporttimeperiod.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exporttimeperiod.go new file mode 100644 index 0000000000000..82751bd3d6a7b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/model_exporttimeperiod.go @@ -0,0 +1,33 @@ +package exports + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportTimePeriod struct { + From string `json:"from"` + To string `json:"to"` +} + +func (o *ExportTimePeriod) GetFromAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.From, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportTimePeriod) SetFromAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.From = formatted +} + +func (o *ExportTimePeriod) GetToAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.To, "2006-01-02T15:04:05Z07:00") +} + +func (o *ExportTimePeriod) SetToAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.To = formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/version.go similarity index 69% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/version.go index f70907012dee2..96be6d93da3f2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports/version.go @@ -1,4 +1,4 @@ -package policyinsights +package exports import "fmt" @@ -8,5 +8,5 @@ import "fmt" const defaultApiVersion = "2021-10-01" func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/policyinsights/%s", defaultApiVersion) + return fmt.Sprintf("hashicorp/go-azure-sdk/exports/%s", defaultApiVersion) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/README.md new file mode 100644 index 0000000000000..7266d603fa8b5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/README.md @@ -0,0 +1,120 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces` Documentation + +The `namespaces` SDK allows for interaction with the Azure Resource Manager Service `eventhub` (API Version `2021-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces" +``` + + +### Client Initialization + +```go +client := namespaces.NewNamespacesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NamespacesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := namespaces.NewNamespaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue") + +payload := namespaces.EHNamespace{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NamespacesClient.Delete` + +```go +ctx := context.TODO() +id := namespaces.NewNamespaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NamespacesClient.Get` + +```go +ctx := context.TODO() +id := namespaces.NewNamespaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NamespacesClient.List` + +```go +ctx := context.TODO() +id := namespaces.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NamespacesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := namespaces.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NamespacesClient.Update` + +```go +ctx := context.TODO() +id := namespaces.NewNamespaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue") + +payload := namespaces.EHNamespace{ + // ... +} + + +read, err := client.Update(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/client.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/client.go index f870e5c2d7b0f..bf25155c4194b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/client.go @@ -1,17 +1,17 @@ -package operationalinsights +package namespaces import "github.com/Azure/go-autorest/autorest" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type OperationalInsightsClient struct { +type NamespacesClient struct { Client autorest.Client baseUri string } -func NewOperationalInsightsClientWithBaseURI(endpoint string) OperationalInsightsClient { - return OperationalInsightsClient{ +func NewNamespacesClientWithBaseURI(endpoint string) NamespacesClient { + return NamespacesClient{ Client: autorest.NewClientWithUserAgent(userAgent()), baseUri: endpoint, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/constants.go new file mode 100644 index 0000000000000..6558e700ccbfd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/constants.go @@ -0,0 +1,167 @@ +package namespaces + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EndPointProvisioningState string + +const ( + EndPointProvisioningStateCanceled EndPointProvisioningState = "Canceled" + EndPointProvisioningStateCreating EndPointProvisioningState = "Creating" + EndPointProvisioningStateDeleting EndPointProvisioningState = "Deleting" + EndPointProvisioningStateFailed EndPointProvisioningState = "Failed" + EndPointProvisioningStateSucceeded EndPointProvisioningState = "Succeeded" + EndPointProvisioningStateUpdating EndPointProvisioningState = "Updating" +) + +func PossibleValuesForEndPointProvisioningState() []string { + return []string{ + string(EndPointProvisioningStateCanceled), + string(EndPointProvisioningStateCreating), + string(EndPointProvisioningStateDeleting), + string(EndPointProvisioningStateFailed), + string(EndPointProvisioningStateSucceeded), + string(EndPointProvisioningStateUpdating), + } +} + +func parseEndPointProvisioningState(input string) (*EndPointProvisioningState, error) { + vals := map[string]EndPointProvisioningState{ + "canceled": EndPointProvisioningStateCanceled, + "creating": EndPointProvisioningStateCreating, + "deleting": EndPointProvisioningStateDeleting, + "failed": EndPointProvisioningStateFailed, + "succeeded": EndPointProvisioningStateSucceeded, + "updating": EndPointProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndPointProvisioningState(input) + return &out, nil +} + +type KeySource string + +const ( + KeySourceMicrosoftPointKeyVault KeySource = "Microsoft.KeyVault" +) + +func PossibleValuesForKeySource() []string { + return []string{ + string(KeySourceMicrosoftPointKeyVault), + } +} + +func parseKeySource(input string) (*KeySource, error) { + vals := map[string]KeySource{ + "microsoft.keyvault": KeySourceMicrosoftPointKeyVault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeySource(input) + return &out, nil +} + +type PrivateLinkConnectionStatus string + +const ( + PrivateLinkConnectionStatusApproved PrivateLinkConnectionStatus = "Approved" + PrivateLinkConnectionStatusDisconnected PrivateLinkConnectionStatus = "Disconnected" + PrivateLinkConnectionStatusPending PrivateLinkConnectionStatus = "Pending" + PrivateLinkConnectionStatusRejected PrivateLinkConnectionStatus = "Rejected" +) + +func PossibleValuesForPrivateLinkConnectionStatus() []string { + return []string{ + string(PrivateLinkConnectionStatusApproved), + string(PrivateLinkConnectionStatusDisconnected), + string(PrivateLinkConnectionStatusPending), + string(PrivateLinkConnectionStatusRejected), + } +} + +func parsePrivateLinkConnectionStatus(input string) (*PrivateLinkConnectionStatus, error) { + vals := map[string]PrivateLinkConnectionStatus{ + "approved": PrivateLinkConnectionStatusApproved, + "disconnected": PrivateLinkConnectionStatusDisconnected, + "pending": PrivateLinkConnectionStatusPending, + "rejected": PrivateLinkConnectionStatusRejected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateLinkConnectionStatus(input) + return &out, nil +} + +type SkuName string + +const ( + SkuNameBasic SkuName = "Basic" + SkuNamePremium SkuName = "Premium" + SkuNameStandard SkuName = "Standard" +) + +func PossibleValuesForSkuName() []string { + return []string{ + string(SkuNameBasic), + string(SkuNamePremium), + string(SkuNameStandard), + } +} + +func parseSkuName(input string) (*SkuName, error) { + vals := map[string]SkuName{ + "basic": SkuNameBasic, + "premium": SkuNamePremium, + "standard": SkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkuName(input) + return &out, nil +} + +type SkuTier string + +const ( + SkuTierBasic SkuTier = "Basic" + SkuTierPremium SkuTier = "Premium" + SkuTierStandard SkuTier = "Standard" +) + +func PossibleValuesForSkuTier() []string { + return []string{ + string(SkuTierBasic), + string(SkuTierPremium), + string(SkuTierStandard), + } +} + +func parseSkuTier(input string) (*SkuTier, error) { + vals := map[string]SkuTier{ + "basic": SkuTierBasic, + "premium": SkuTierPremium, + "standard": SkuTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkuTier(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/id_namespace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/id_namespace.go new file mode 100644 index 0000000000000..dba614cfaf0da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/id_namespace.go @@ -0,0 +1,124 @@ +package namespaces + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NamespaceId{} + +// NamespaceId is a struct representing the Resource ID for a Namespace +type NamespaceId struct { + SubscriptionId string + ResourceGroupName string + NamespaceName string +} + +// NewNamespaceID returns a new NamespaceId struct +func NewNamespaceID(subscriptionId string, resourceGroupName string, namespaceName string) NamespaceId { + return NamespaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NamespaceName: namespaceName, + } +} + +// ParseNamespaceID parses 'input' into a NamespaceId +func ParseNamespaceID(input string) (*NamespaceId, error) { + parser := resourceids.NewParserFromResourceIdType(NamespaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NamespaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.NamespaceName, ok = parsed.Parsed["namespaceName"]; !ok { + return nil, fmt.Errorf("the segment 'namespaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNamespaceIDInsensitively parses 'input' case-insensitively into a NamespaceId +// note: this method should only be used for API response data and not user input +func ParseNamespaceIDInsensitively(input string) (*NamespaceId, error) { + parser := resourceids.NewParserFromResourceIdType(NamespaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NamespaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.NamespaceName, ok = parsed.Parsed["namespaceName"]; !ok { + return nil, fmt.Errorf("the segment 'namespaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNamespaceID checks that 'input' can be parsed as a Namespace ID +func ValidateNamespaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNamespaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Namespace ID +func (id NamespaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.EventHub/namespaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NamespaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Namespace ID +func (id NamespaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftEventHub", "Microsoft.EventHub", "Microsoft.EventHub"), + resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), + resourceids.UserSpecifiedSegment("namespaceName", "namespaceValue"), + } +} + +// String returns a human-readable description of this Namespace ID +func (id NamespaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Namespace Name: %q", id.NamespaceName), + } + return fmt.Sprintf("Namespace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..44e30b453dbf4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package namespaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c NamespacesClient) CreateOrUpdate(ctx context.Context, id NamespaceId, input EHNamespace) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c NamespacesClient) CreateOrUpdateThenPoll(ctx context.Context, id NamespaceId, input EHNamespace) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c NamespacesClient) preparerForCreateOrUpdate(ctx context.Context, id NamespaceId, input EHNamespace) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c NamespacesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_delete_autorest.go new file mode 100644 index 0000000000000..968dfe754f22c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_delete_autorest.go @@ -0,0 +1,78 @@ +package namespaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c NamespacesClient) Delete(ctx context.Context, id NamespaceId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c NamespacesClient) DeleteThenPoll(ctx context.Context, id NamespaceId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c NamespacesClient) preparerForDelete(ctx context.Context, id NamespaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c NamespacesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_get_autorest.go new file mode 100644 index 0000000000000..353d889838939 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_get_autorest.go @@ -0,0 +1,68 @@ +package namespaces + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *EHNamespace +} + +// Get ... +func (c NamespacesClient) Get(ctx context.Context, id NamespaceId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c NamespacesClient) preparerForGet(ctx context.Context, id NamespaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c NamespacesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_list_autorest.go new file mode 100644 index 0000000000000..5a7df04ecfd2d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_list_autorest.go @@ -0,0 +1,187 @@ +package namespaces + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *[]EHNamespace + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) +} + +type ListCompleteResult struct { + Items []EHNamespace +} + +func (r ListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// List ... +func (c NamespacesClient) List(ctx context.Context, id commonids.SubscriptionId) (resp ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "List", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "List", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "List", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForList prepares the List request. +func (c NamespacesClient) preparerForList(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.EventHub/namespaces", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListWithNextLink prepares the List request with the given nextLink token. +func (c NamespacesClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c NamespacesClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + type page struct { + Values []EHNamespace `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { + req, err := c.preparerForListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListComplete retrieves all of the results into a single object +func (c NamespacesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, EHNamespaceOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c NamespacesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate EHNamespaceOperationPredicate) (resp ListCompleteResult, err error) { + items := make([]EHNamespace, 0) + + page, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_listbyresourcegroup_autorest.go new file mode 100644 index 0000000000000..d655de7c1ac14 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_listbyresourcegroup_autorest.go @@ -0,0 +1,187 @@ +package namespaces + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + Model *[]EHNamespace + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupOperationResponse, error) +} + +type ListByResourceGroupCompleteResult struct { + Items []EHNamespace +} + +func (r ListByResourceGroupOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListByResourceGroupOperationResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// ListByResourceGroup ... +func (c NamespacesClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroup(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "ListByResourceGroup", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListByResourceGroup(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "ListByResourceGroup", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListByResourceGroup prepares the ListByResourceGroup request. +func (c NamespacesClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.EventHub/namespaces", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListByResourceGroupWithNextLink prepares the ListByResourceGroup request with the given nextLink token. +func (c NamespacesClient) preparerForListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (c NamespacesClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { + type page struct { + Values []EHNamespace `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroupWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "ListByResourceGroup", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByResourceGroup(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "ListByResourceGroup", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListByResourceGroupComplete retrieves all of the results into a single object +func (c NamespacesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, EHNamespaceOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c NamespacesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate EHNamespaceOperationPredicate) (resp ListByResourceGroupCompleteResult, err error) { + items := make([]EHNamespace, 0) + + page, err := c.ListByResourceGroup(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListByResourceGroupCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_update_autorest.go new file mode 100644 index 0000000000000..2dce2d196385e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/method_update_autorest.go @@ -0,0 +1,69 @@ +package namespaces + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + Model *EHNamespace +} + +// Update ... +func (c NamespacesClient) Update(ctx context.Context, id NamespaceId, input EHNamespace) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Update", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "namespaces.NamespacesClient", "Update", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForUpdate prepares the Update request. +func (c NamespacesClient) preparerForUpdate(ctx context.Context, id NamespaceId, input EHNamespace) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForUpdate handles the response to the Update request. The method always +// closes the http.Response Body. +func (c NamespacesClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_connectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_connectionstate.go new file mode 100644 index 0000000000000..022aa980debfe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_connectionstate.go @@ -0,0 +1,9 @@ +package namespaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionState struct { + Description *string `json:"description,omitempty"` + Status *PrivateLinkConnectionStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_ehnamespace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_ehnamespace.go new file mode 100644 index 0000000000000..17819eb7bf040 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_ehnamespace.go @@ -0,0 +1,21 @@ +package namespaces + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EHNamespace struct { + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *EHNamespaceProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_ehnamespaceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_ehnamespaceproperties.go new file mode 100644 index 0000000000000..65d06e6cf5b4a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_ehnamespaceproperties.go @@ -0,0 +1,52 @@ +package namespaces + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EHNamespaceProperties struct { + AlternateName *string `json:"alternateName,omitempty"` + ClusterArmId *string `json:"clusterArmId,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + MaximumThroughputUnits *int64 `json:"maximumThroughputUnits,omitempty"` + MetricId *string `json:"metricId,omitempty"` + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + Status *string `json:"status,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +func (o *EHNamespaceProperties) GetCreatedAtAsTime() (*time.Time, error) { + if o.CreatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *EHNamespaceProperties) SetCreatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedAt = &formatted +} + +func (o *EHNamespaceProperties) GetUpdatedAtAsTime() (*time.Time, error) { + if o.UpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.UpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *EHNamespaceProperties) SetUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.UpdatedAt = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_encryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_encryption.go new file mode 100644 index 0000000000000..c33fdbc6fad21 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_encryption.go @@ -0,0 +1,10 @@ +package namespaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Encryption struct { + KeySource *KeySource `json:"keySource,omitempty"` + KeyVaultProperties *[]KeyVaultProperties `json:"keyVaultProperties,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_keyvaultproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_keyvaultproperties.go new file mode 100644 index 0000000000000..b0dfb9a4e063b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_keyvaultproperties.go @@ -0,0 +1,11 @@ +package namespaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultProperties struct { + Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpoint.go new file mode 100644 index 0000000000000..3dec0387e5f1a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpoint.go @@ -0,0 +1,8 @@ +package namespaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpoint struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpointconnection.go new file mode 100644 index 0000000000000..58852b36e0258 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpointconnection.go @@ -0,0 +1,17 @@ +package namespaces + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpointconnectionproperties.go new file mode 100644 index 0000000000000..e0aa15c59571b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_privateendpointconnectionproperties.go @@ -0,0 +1,10 @@ +package namespaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *ConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *EndPointProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_sku.go new file mode 100644 index 0000000000000..909b599f1389a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_sku.go @@ -0,0 +1,10 @@ +package namespaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Sku struct { + Capacity *int64 `json:"capacity,omitempty"` + Name SkuName `json:"name"` + Tier *SkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_userassignedidentityproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_userassignedidentityproperties.go new file mode 100644 index 0000000000000..0685aa3ea141b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/model_userassignedidentityproperties.go @@ -0,0 +1,8 @@ +package namespaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserAssignedIdentityProperties struct { + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/predicates.go new file mode 100644 index 0000000000000..da2e3acefe1a0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/predicates.go @@ -0,0 +1,29 @@ +package namespaces + +type EHNamespaceOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p EHNamespaceOperationPredicate) Matches(input EHNamespace) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && (input.Location == nil && *p.Location != *input.Location) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/version.go new file mode 100644 index 0000000000000..e7fef9f37bd38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces/version.go @@ -0,0 +1,12 @@ +package namespaces + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/namespaces/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/README.md new file mode 100644 index 0000000000000..86a8c4bfcaa92 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry` Documentation + +The `schemaregistry` SDK allows for interaction with the Azure Resource Manager Service `eventhub` (API Version `2021-11-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry" +``` + + +### Client Initialization + +```go +client := schemaregistry.NewSchemaRegistryClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SchemaRegistryClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := schemaregistry.NewSchemaGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "schemaGroupValue") + +payload := schemaregistry.SchemaGroup{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SchemaRegistryClient.Delete` + +```go +ctx := context.TODO() +id := schemaregistry.NewSchemaGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "schemaGroupValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SchemaRegistryClient.Get` + +```go +ctx := context.TODO() +id := schemaregistry.NewSchemaGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "schemaGroupValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SchemaRegistryClient.ListByNamespace` + +```go +ctx := context.TODO() +id := schemaregistry.NewNamespaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue") + +// alternatively `client.ListByNamespace(ctx, id, schemaregistry.DefaultListByNamespaceOperationOptions())` can be used to do batched pagination +items, err := client.ListByNamespaceComplete(ctx, id, schemaregistry.DefaultListByNamespaceOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/client.go new file mode 100644 index 0000000000000..0f62fd93dd924 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/client.go @@ -0,0 +1,18 @@ +package schemaregistry + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaRegistryClient struct { + Client autorest.Client + baseUri string +} + +func NewSchemaRegistryClientWithBaseURI(endpoint string) SchemaRegistryClient { + return SchemaRegistryClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/constants.go new file mode 100644 index 0000000000000..7a4b53869fe71 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/constants.go @@ -0,0 +1,65 @@ +package schemaregistry + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaCompatibility string + +const ( + SchemaCompatibilityBackward SchemaCompatibility = "Backward" + SchemaCompatibilityForward SchemaCompatibility = "Forward" + SchemaCompatibilityNone SchemaCompatibility = "None" +) + +func PossibleValuesForSchemaCompatibility() []string { + return []string{ + string(SchemaCompatibilityBackward), + string(SchemaCompatibilityForward), + string(SchemaCompatibilityNone), + } +} + +func parseSchemaCompatibility(input string) (*SchemaCompatibility, error) { + vals := map[string]SchemaCompatibility{ + "backward": SchemaCompatibilityBackward, + "forward": SchemaCompatibilityForward, + "none": SchemaCompatibilityNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SchemaCompatibility(input) + return &out, nil +} + +type SchemaType string + +const ( + SchemaTypeAvro SchemaType = "Avro" + SchemaTypeUnknown SchemaType = "Unknown" +) + +func PossibleValuesForSchemaType() []string { + return []string{ + string(SchemaTypeAvro), + string(SchemaTypeUnknown), + } +} + +func parseSchemaType(input string) (*SchemaType, error) { + vals := map[string]SchemaType{ + "avro": SchemaTypeAvro, + "unknown": SchemaTypeUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SchemaType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/id_namespace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/id_namespace.go new file mode 100644 index 0000000000000..6247a58974b76 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/id_namespace.go @@ -0,0 +1,124 @@ +package schemaregistry + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NamespaceId{} + +// NamespaceId is a struct representing the Resource ID for a Namespace +type NamespaceId struct { + SubscriptionId string + ResourceGroupName string + NamespaceName string +} + +// NewNamespaceID returns a new NamespaceId struct +func NewNamespaceID(subscriptionId string, resourceGroupName string, namespaceName string) NamespaceId { + return NamespaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NamespaceName: namespaceName, + } +} + +// ParseNamespaceID parses 'input' into a NamespaceId +func ParseNamespaceID(input string) (*NamespaceId, error) { + parser := resourceids.NewParserFromResourceIdType(NamespaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NamespaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.NamespaceName, ok = parsed.Parsed["namespaceName"]; !ok { + return nil, fmt.Errorf("the segment 'namespaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNamespaceIDInsensitively parses 'input' case-insensitively into a NamespaceId +// note: this method should only be used for API response data and not user input +func ParseNamespaceIDInsensitively(input string) (*NamespaceId, error) { + parser := resourceids.NewParserFromResourceIdType(NamespaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NamespaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.NamespaceName, ok = parsed.Parsed["namespaceName"]; !ok { + return nil, fmt.Errorf("the segment 'namespaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNamespaceID checks that 'input' can be parsed as a Namespace ID +func ValidateNamespaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNamespaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Namespace ID +func (id NamespaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.EventHub/namespaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NamespaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Namespace ID +func (id NamespaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftEventHub", "Microsoft.EventHub", "Microsoft.EventHub"), + resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), + resourceids.UserSpecifiedSegment("namespaceName", "namespaceValue"), + } +} + +// String returns a human-readable description of this Namespace ID +func (id NamespaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Namespace Name: %q", id.NamespaceName), + } + return fmt.Sprintf("Namespace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/id_schemagroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/id_schemagroup.go new file mode 100644 index 0000000000000..24e1394431f7f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/id_schemagroup.go @@ -0,0 +1,137 @@ +package schemaregistry + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = SchemaGroupId{} + +// SchemaGroupId is a struct representing the Resource ID for a Schema Group +type SchemaGroupId struct { + SubscriptionId string + ResourceGroupName string + NamespaceName string + SchemaGroupName string +} + +// NewSchemaGroupID returns a new SchemaGroupId struct +func NewSchemaGroupID(subscriptionId string, resourceGroupName string, namespaceName string, schemaGroupName string) SchemaGroupId { + return SchemaGroupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NamespaceName: namespaceName, + SchemaGroupName: schemaGroupName, + } +} + +// ParseSchemaGroupID parses 'input' into a SchemaGroupId +func ParseSchemaGroupID(input string) (*SchemaGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(SchemaGroupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SchemaGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.NamespaceName, ok = parsed.Parsed["namespaceName"]; !ok { + return nil, fmt.Errorf("the segment 'namespaceName' was not found in the resource id %q", input) + } + + if id.SchemaGroupName, ok = parsed.Parsed["schemaGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'schemaGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseSchemaGroupIDInsensitively parses 'input' case-insensitively into a SchemaGroupId +// note: this method should only be used for API response data and not user input +func ParseSchemaGroupIDInsensitively(input string) (*SchemaGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(SchemaGroupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SchemaGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.NamespaceName, ok = parsed.Parsed["namespaceName"]; !ok { + return nil, fmt.Errorf("the segment 'namespaceName' was not found in the resource id %q", input) + } + + if id.SchemaGroupName, ok = parsed.Parsed["schemaGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'schemaGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateSchemaGroupID checks that 'input' can be parsed as a Schema Group ID +func ValidateSchemaGroupID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSchemaGroupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Schema Group ID +func (id SchemaGroupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.EventHub/namespaces/%s/schemaGroups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NamespaceName, id.SchemaGroupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Schema Group ID +func (id SchemaGroupId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftEventHub", "Microsoft.EventHub", "Microsoft.EventHub"), + resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), + resourceids.UserSpecifiedSegment("namespaceName", "namespaceValue"), + resourceids.StaticSegment("staticSchemaGroups", "schemaGroups", "schemaGroups"), + resourceids.UserSpecifiedSegment("schemaGroupName", "schemaGroupValue"), + } +} + +// String returns a human-readable description of this Schema Group ID +func (id SchemaGroupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Namespace Name: %q", id.NamespaceName), + fmt.Sprintf("Schema Group Name: %q", id.SchemaGroupName), + } + return fmt.Sprintf("Schema Group (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..317ec3505ac64 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_createorupdate_autorest.go @@ -0,0 +1,69 @@ +package schemaregistry + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + Model *SchemaGroup +} + +// CreateOrUpdate ... +func (c SchemaRegistryClient) CreateOrUpdate(ctx context.Context, id SchemaGroupId, input SchemaGroup) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForCreateOrUpdate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "CreateOrUpdate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c SchemaRegistryClient) preparerForCreateOrUpdate(ctx context.Context, id SchemaGroupId, input SchemaGroup) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (c SchemaRegistryClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_delete_autorest.go new file mode 100644 index 0000000000000..6ad24e9264b88 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_delete_autorest.go @@ -0,0 +1,66 @@ +package schemaregistry + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response +} + +// Delete ... +func (c SchemaRegistryClient) Delete(ctx context.Context, id SchemaGroupId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "Delete", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForDelete(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "Delete", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForDelete prepares the Delete request. +func (c SchemaRegistryClient) preparerForDelete(ctx context.Context, id SchemaGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForDelete handles the response to the Delete request. The method always +// closes the http.Response Body. +func (c SchemaRegistryClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_get_autorest.go new file mode 100644 index 0000000000000..9de51cd1edc9b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_get_autorest.go @@ -0,0 +1,68 @@ +package schemaregistry + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *SchemaGroup +} + +// Get ... +func (c SchemaRegistryClient) Get(ctx context.Context, id SchemaGroupId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c SchemaRegistryClient) preparerForGet(ctx context.Context, id SchemaGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c SchemaRegistryClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_listbynamespace_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_listbynamespace_autorest.go new file mode 100644 index 0000000000000..47c5881524cca --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/method_listbynamespace_autorest.go @@ -0,0 +1,220 @@ +package schemaregistry + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByNamespaceOperationResponse struct { + HttpResponse *http.Response + Model *[]SchemaGroup + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListByNamespaceOperationResponse, error) +} + +type ListByNamespaceCompleteResult struct { + Items []SchemaGroup +} + +func (r ListByNamespaceOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListByNamespaceOperationResponse) LoadMore(ctx context.Context) (resp ListByNamespaceOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ListByNamespaceOperationOptions struct { + Skip *int64 + Top *int64 +} + +func DefaultListByNamespaceOperationOptions() ListByNamespaceOperationOptions { + return ListByNamespaceOperationOptions{} +} + +func (o ListByNamespaceOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListByNamespaceOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Skip != nil { + out["$skip"] = *o.Skip + } + + if o.Top != nil { + out["$top"] = *o.Top + } + + return out +} + +// ListByNamespace ... +func (c SchemaRegistryClient) ListByNamespace(ctx context.Context, id NamespaceId, options ListByNamespaceOperationOptions) (resp ListByNamespaceOperationResponse, err error) { + req, err := c.preparerForListByNamespace(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "ListByNamespace", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "ListByNamespace", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListByNamespace(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "ListByNamespace", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListByNamespace prepares the ListByNamespace request. +func (c SchemaRegistryClient) preparerForListByNamespace(ctx context.Context, id NamespaceId, options ListByNamespaceOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/schemaGroups", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListByNamespaceWithNextLink prepares the ListByNamespace request with the given nextLink token. +func (c SchemaRegistryClient) preparerForListByNamespaceWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByNamespace handles the response to the ListByNamespace request. The method always +// closes the http.Response Body. +func (c SchemaRegistryClient) responderForListByNamespace(resp *http.Response) (result ListByNamespaceOperationResponse, err error) { + type page struct { + Values []SchemaGroup `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByNamespaceOperationResponse, err error) { + req, err := c.preparerForListByNamespaceWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "ListByNamespace", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "ListByNamespace", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByNamespace(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "schemaregistry.SchemaRegistryClient", "ListByNamespace", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListByNamespaceComplete retrieves all of the results into a single object +func (c SchemaRegistryClient) ListByNamespaceComplete(ctx context.Context, id NamespaceId, options ListByNamespaceOperationOptions) (ListByNamespaceCompleteResult, error) { + return c.ListByNamespaceCompleteMatchingPredicate(ctx, id, options, SchemaGroupOperationPredicate{}) +} + +// ListByNamespaceCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c SchemaRegistryClient) ListByNamespaceCompleteMatchingPredicate(ctx context.Context, id NamespaceId, options ListByNamespaceOperationOptions, predicate SchemaGroupOperationPredicate) (resp ListByNamespaceCompleteResult, err error) { + items := make([]SchemaGroup, 0) + + page, err := c.ListByNamespace(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListByNamespaceCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/model_schemagroup.go similarity index 73% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoentity.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/model_schemagroup.go index aa98624a97eee..b39dc6034a217 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoentity.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/model_schemagroup.go @@ -1,4 +1,4 @@ -package videoanalyzer +package schemaregistry import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" @@ -7,10 +7,11 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type VideoEntity struct { +type SchemaGroup struct { Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` Name *string `json:"name,omitempty"` - Properties *VideoProperties `json:"properties,omitempty"` + Properties *SchemaGroupProperties `json:"properties,omitempty"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/model_schemagroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/model_schemagroupproperties.go new file mode 100644 index 0000000000000..1f9c58b6c2df3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/model_schemagroupproperties.go @@ -0,0 +1,43 @@ +package schemaregistry + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaGroupProperties struct { + CreatedAtUtc *string `json:"createdAtUtc,omitempty"` + ETag *string `json:"eTag,omitempty"` + GroupProperties *map[string]string `json:"groupProperties,omitempty"` + SchemaCompatibility *SchemaCompatibility `json:"schemaCompatibility,omitempty"` + SchemaType *SchemaType `json:"schemaType,omitempty"` + UpdatedAtUtc *string `json:"updatedAtUtc,omitempty"` +} + +func (o *SchemaGroupProperties) GetCreatedAtUtcAsTime() (*time.Time, error) { + if o.CreatedAtUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedAtUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *SchemaGroupProperties) SetCreatedAtUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedAtUtc = &formatted +} + +func (o *SchemaGroupProperties) GetUpdatedAtUtcAsTime() (*time.Time, error) { + if o.UpdatedAtUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.UpdatedAtUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *SchemaGroupProperties) SetUpdatedAtUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.UpdatedAtUtc = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/predicates.go new file mode 100644 index 0000000000000..51e1fd01f7a5d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/predicates.go @@ -0,0 +1,29 @@ +package schemaregistry + +type SchemaGroupOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p SchemaGroupOperationPredicate) Matches(input SchemaGroup) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && (input.Location == nil && *p.Location != *input.Location) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/version.go new file mode 100644 index 0000000000000..a267692839282 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry/version.go @@ -0,0 +1,12 @@ +package schemaregistry + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/schemaregistry/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/README.md similarity index 54% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/README.md index ca3a2786a4682..cfed355888640 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/README.md @@ -1,30 +1,30 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities` Documentation -The `managedidentity` SDK allows for interaction with the Azure Resource Manager Service `managedidentity` (API Version `2018-11-30`). +The `managedidentities` SDK allows for interaction with the Azure Resource Manager Service `managedidentity` (API Version `2018-11-30`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity" +import "github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities" ``` ### Client Initialization ```go -client := managedidentity.NewManagedIdentityClientWithBaseURI("https://management.azure.com") +client := managedidentities.NewManagedIdentitiesClientWithBaseURI("https://management.azure.com") client.Client.Authorizer = authorizer ``` -### Example Usage: `ManagedIdentityClient.SystemAssignedIdentitiesGetByScope` +### Example Usage: `ManagedIdentitiesClient.SystemAssignedIdentitiesGetByScope` ```go ctx := context.TODO() -id := managedidentity.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := managedidentities.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SystemAssignedIdentitiesGetByScope(ctx, id) if err != nil { @@ -36,13 +36,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ManagedIdentityClient.UserAssignedIdentitiesCreateOrUpdate` +### Example Usage: `ManagedIdentitiesClient.UserAssignedIdentitiesCreateOrUpdate` ```go ctx := context.TODO() -id := managedidentity.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := managedidentities.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") -payload := managedidentity.Identity{ +payload := managedidentities.Identity{ // ... } @@ -57,11 +57,11 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ManagedIdentityClient.UserAssignedIdentitiesDelete` +### Example Usage: `ManagedIdentitiesClient.UserAssignedIdentitiesDelete` ```go ctx := context.TODO() -id := managedidentity.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := managedidentities.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") read, err := client.UserAssignedIdentitiesDelete(ctx, id) if err != nil { @@ -73,11 +73,11 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ManagedIdentityClient.UserAssignedIdentitiesGet` +### Example Usage: `ManagedIdentitiesClient.UserAssignedIdentitiesGet` ```go ctx := context.TODO() -id := managedidentity.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := managedidentities.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") read, err := client.UserAssignedIdentitiesGet(ctx, id) if err != nil { @@ -89,11 +89,11 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ManagedIdentityClient.UserAssignedIdentitiesListByResourceGroup` +### Example Usage: `ManagedIdentitiesClient.UserAssignedIdentitiesListByResourceGroup` ```go ctx := context.TODO() -id := managedidentity.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") +id := managedidentities.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") // alternatively `client.UserAssignedIdentitiesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.UserAssignedIdentitiesListByResourceGroupComplete(ctx, id) @@ -106,11 +106,11 @@ for _, item := range items { ``` -### Example Usage: `ManagedIdentityClient.UserAssignedIdentitiesListBySubscription` +### Example Usage: `ManagedIdentitiesClient.UserAssignedIdentitiesListBySubscription` ```go ctx := context.TODO() -id := managedidentity.NewSubscriptionID("12345678-1234-9876-4563-123456789012") +id := managedidentities.NewSubscriptionID("12345678-1234-9876-4563-123456789012") // alternatively `client.UserAssignedIdentitiesListBySubscription(ctx, id)` can be used to do batched pagination items, err := client.UserAssignedIdentitiesListBySubscriptionComplete(ctx, id) @@ -123,13 +123,13 @@ for _, item := range items { ``` -### Example Usage: `ManagedIdentityClient.UserAssignedIdentitiesUpdate` +### Example Usage: `ManagedIdentitiesClient.UserAssignedIdentitiesUpdate` ```go ctx := context.TODO() -id := managedidentity.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") +id := managedidentities.NewUserAssignedIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceValue") -payload := managedidentity.IdentityUpdate{ +payload := managedidentities.IdentityUpdate{ // ... } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/client.go new file mode 100644 index 0000000000000..b7ed375f569ba --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/client.go @@ -0,0 +1,18 @@ +package managedidentities + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedIdentitiesClient struct { + Client autorest.Client + baseUri string +} + +func NewManagedIdentitiesClientWithBaseURI(endpoint string) ManagedIdentitiesClient { + return ManagedIdentitiesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_systemassignedidentitiesgetbyscope_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_systemassignedidentitiesgetbyscope_autorest.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_systemassignedidentitiesgetbyscope_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_systemassignedidentitiesgetbyscope_autorest.go index 09adeb02db59a..22b0b58ddd69d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_systemassignedidentitiesgetbyscope_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_systemassignedidentitiesgetbyscope_autorest.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import ( "context" @@ -19,22 +19,22 @@ type SystemAssignedIdentitiesGetByScopeOperationResponse struct { } // SystemAssignedIdentitiesGetByScope ... -func (c ManagedIdentityClient) SystemAssignedIdentitiesGetByScope(ctx context.Context, id commonids.ScopeId) (result SystemAssignedIdentitiesGetByScopeOperationResponse, err error) { +func (c ManagedIdentitiesClient) SystemAssignedIdentitiesGetByScope(ctx context.Context, id commonids.ScopeId) (result SystemAssignedIdentitiesGetByScopeOperationResponse, err error) { req, err := c.preparerForSystemAssignedIdentitiesGetByScope(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "SystemAssignedIdentitiesGetByScope", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "SystemAssignedIdentitiesGetByScope", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "SystemAssignedIdentitiesGetByScope", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "SystemAssignedIdentitiesGetByScope", result.HttpResponse, "Failure sending request") return } result, err = c.responderForSystemAssignedIdentitiesGetByScope(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "SystemAssignedIdentitiesGetByScope", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "SystemAssignedIdentitiesGetByScope", result.HttpResponse, "Failure responding to request") return } @@ -42,7 +42,7 @@ func (c ManagedIdentityClient) SystemAssignedIdentitiesGetByScope(ctx context.Co } // preparerForSystemAssignedIdentitiesGetByScope prepares the SystemAssignedIdentitiesGetByScope request. -func (c ManagedIdentityClient) preparerForSystemAssignedIdentitiesGetByScope(ctx context.Context, id commonids.ScopeId) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForSystemAssignedIdentitiesGetByScope(ctx context.Context, id commonids.ScopeId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c ManagedIdentityClient) preparerForSystemAssignedIdentitiesGetByScope(ctx // responderForSystemAssignedIdentitiesGetByScope handles the response to the SystemAssignedIdentitiesGetByScope request. The method always // closes the http.Response Body. -func (c ManagedIdentityClient) responderForSystemAssignedIdentitiesGetByScope(resp *http.Response) (result SystemAssignedIdentitiesGetByScopeOperationResponse, err error) { +func (c ManagedIdentitiesClient) responderForSystemAssignedIdentitiesGetByScope(resp *http.Response) (result SystemAssignedIdentitiesGetByScopeOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiescreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiescreateorupdate_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiescreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiescreateorupdate_autorest.go index e1264d0e348ea..d5f05a43907fa 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiescreateorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiescreateorupdate_autorest.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import ( "context" @@ -18,22 +18,22 @@ type UserAssignedIdentitiesCreateOrUpdateOperationResponse struct { } // UserAssignedIdentitiesCreateOrUpdate ... -func (c ManagedIdentityClient) UserAssignedIdentitiesCreateOrUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input Identity) (result UserAssignedIdentitiesCreateOrUpdateOperationResponse, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesCreateOrUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input Identity) (result UserAssignedIdentitiesCreateOrUpdateOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesCreateOrUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesCreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesCreateOrUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesCreateOrUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesCreateOrUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForUserAssignedIdentitiesCreateOrUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesCreateOrUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesCreateOrUpdate", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c ManagedIdentityClient) UserAssignedIdentitiesCreateOrUpdate(ctx context. } // preparerForUserAssignedIdentitiesCreateOrUpdate prepares the UserAssignedIdentitiesCreateOrUpdate request. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesCreateOrUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input Identity) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesCreateOrUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input Identity) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesCreateOrUpdate(c // responderForUserAssignedIdentitiesCreateOrUpdate handles the response to the UserAssignedIdentitiesCreateOrUpdate request. The method always // closes the http.Response Body. -func (c ManagedIdentityClient) responderForUserAssignedIdentitiesCreateOrUpdate(resp *http.Response) (result UserAssignedIdentitiesCreateOrUpdateOperationResponse, err error) { +func (c ManagedIdentitiesClient) responderForUserAssignedIdentitiesCreateOrUpdate(resp *http.Response) (result UserAssignedIdentitiesCreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesdelete_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesdelete_autorest.go index 84388d89515ef..ea7e54fd0c08a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesdelete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesdelete_autorest.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import ( "context" @@ -17,22 +17,22 @@ type UserAssignedIdentitiesDeleteOperationResponse struct { } // UserAssignedIdentitiesDelete ... -func (c ManagedIdentityClient) UserAssignedIdentitiesDelete(ctx context.Context, id commonids.UserAssignedIdentityId) (result UserAssignedIdentitiesDeleteOperationResponse, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesDelete(ctx context.Context, id commonids.UserAssignedIdentityId) (result UserAssignedIdentitiesDeleteOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesDelete(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesDelete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesDelete", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesDelete", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesDelete", result.HttpResponse, "Failure sending request") return } result, err = c.responderForUserAssignedIdentitiesDelete(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesDelete", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesDelete", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c ManagedIdentityClient) UserAssignedIdentitiesDelete(ctx context.Context, } // preparerForUserAssignedIdentitiesDelete prepares the UserAssignedIdentitiesDelete request. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesDelete(ctx context.Context, id commonids.UserAssignedIdentityId) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesDelete(ctx context.Context, id commonids.UserAssignedIdentityId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesDelete(ctx conte // responderForUserAssignedIdentitiesDelete handles the response to the UserAssignedIdentitiesDelete request. The method always // closes the http.Response Body. -func (c ManagedIdentityClient) responderForUserAssignedIdentitiesDelete(resp *http.Response) (result UserAssignedIdentitiesDeleteOperationResponse, err error) { +func (c ManagedIdentitiesClient) responderForUserAssignedIdentitiesDelete(resp *http.Response) (result UserAssignedIdentitiesDeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesget_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesget_autorest.go index fcf3fc76805cf..dc6ce10ee8c31 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesget_autorest.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import ( "context" @@ -18,22 +18,22 @@ type UserAssignedIdentitiesGetOperationResponse struct { } // UserAssignedIdentitiesGet ... -func (c ManagedIdentityClient) UserAssignedIdentitiesGet(ctx context.Context, id commonids.UserAssignedIdentityId) (result UserAssignedIdentitiesGetOperationResponse, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesGet(ctx context.Context, id commonids.UserAssignedIdentityId) (result UserAssignedIdentitiesGetOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesGet(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesGet", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesGet", result.HttpResponse, "Failure sending request") return } result, err = c.responderForUserAssignedIdentitiesGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesGet", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c ManagedIdentityClient) UserAssignedIdentitiesGet(ctx context.Context, id } // preparerForUserAssignedIdentitiesGet prepares the UserAssignedIdentitiesGet request. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesGet(ctx context.Context, id commonids.UserAssignedIdentityId) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesGet(ctx context.Context, id commonids.UserAssignedIdentityId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesGet(ctx context. // responderForUserAssignedIdentitiesGet handles the response to the UserAssignedIdentitiesGet request. The method always // closes the http.Response Body. -func (c ManagedIdentityClient) responderForUserAssignedIdentitiesGet(resp *http.Response) (result UserAssignedIdentitiesGetOperationResponse, err error) { +func (c ManagedIdentitiesClient) responderForUserAssignedIdentitiesGet(resp *http.Response) (result UserAssignedIdentitiesGetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitieslistbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitieslistbyresourcegroup_autorest.go similarity index 69% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitieslistbyresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitieslistbyresourcegroup_autorest.go index cc6ccb5011dd8..71cbdae7248e5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitieslistbyresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitieslistbyresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import ( "context" @@ -39,29 +39,29 @@ func (r UserAssignedIdentitiesListByResourceGroupOperationResponse) LoadMore(ctx } // UserAssignedIdentitiesListByResourceGroup ... -func (c ManagedIdentityClient) UserAssignedIdentitiesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp UserAssignedIdentitiesListByResourceGroupOperationResponse, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp UserAssignedIdentitiesListByResourceGroupOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesListByResourceGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListByResourceGroup", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListByResourceGroup", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListByResourceGroup", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForUserAssignedIdentitiesListByResourceGroup(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListByResourceGroup", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListByResourceGroup", resp.HttpResponse, "Failure responding to request") return } return } // preparerForUserAssignedIdentitiesListByResourceGroup prepares the UserAssignedIdentitiesListByResourceGroup request. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -76,7 +76,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListByResourceGr } // preparerForUserAssignedIdentitiesListByResourceGroupWithNextLink prepares the UserAssignedIdentitiesListByResourceGroup request with the given nextLink token. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -102,7 +102,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListByResourceGr // responderForUserAssignedIdentitiesListByResourceGroup handles the response to the UserAssignedIdentitiesListByResourceGroup request. The method always // closes the http.Response Body. -func (c ManagedIdentityClient) responderForUserAssignedIdentitiesListByResourceGroup(resp *http.Response) (result UserAssignedIdentitiesListByResourceGroupOperationResponse, err error) { +func (c ManagedIdentitiesClient) responderForUserAssignedIdentitiesListByResourceGroup(resp *http.Response) (result UserAssignedIdentitiesListByResourceGroupOperationResponse, err error) { type page struct { Values []Identity `json:"value"` NextLink *string `json:"nextLink"` @@ -120,19 +120,19 @@ func (c ManagedIdentityClient) responderForUserAssignedIdentitiesListByResourceG result.nextPageFunc = func(ctx context.Context, nextLink string) (result UserAssignedIdentitiesListByResourceGroupOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesListByResourceGroupWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListByResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListByResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListByResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForUserAssignedIdentitiesListByResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListByResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListByResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -143,12 +143,12 @@ func (c ManagedIdentityClient) responderForUserAssignedIdentitiesListByResourceG } // UserAssignedIdentitiesListByResourceGroupComplete retrieves all of the results into a single object -func (c ManagedIdentityClient) UserAssignedIdentitiesListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (UserAssignedIdentitiesListByResourceGroupCompleteResult, error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (UserAssignedIdentitiesListByResourceGroupCompleteResult, error) { return c.UserAssignedIdentitiesListByResourceGroupCompleteMatchingPredicate(ctx, id, IdentityOperationPredicate{}) } // UserAssignedIdentitiesListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedIdentityClient) UserAssignedIdentitiesListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate IdentityOperationPredicate) (resp UserAssignedIdentitiesListByResourceGroupCompleteResult, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate IdentityOperationPredicate) (resp UserAssignedIdentitiesListByResourceGroupCompleteResult, err error) { items := make([]Identity, 0) page, err := c.UserAssignedIdentitiesListByResourceGroup(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitieslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitieslistbysubscription_autorest.go similarity index 69% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitieslistbysubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitieslistbysubscription_autorest.go index f884a1a6d3467..56809d47a15d4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitieslistbysubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitieslistbysubscription_autorest.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import ( "context" @@ -39,29 +39,29 @@ func (r UserAssignedIdentitiesListBySubscriptionOperationResponse) LoadMore(ctx } // UserAssignedIdentitiesListBySubscription ... -func (c ManagedIdentityClient) UserAssignedIdentitiesListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp UserAssignedIdentitiesListBySubscriptionOperationResponse, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp UserAssignedIdentitiesListBySubscriptionOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesListBySubscription(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListBySubscription", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListBySubscription", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListBySubscription", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForUserAssignedIdentitiesListBySubscription(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListBySubscription", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListBySubscription", resp.HttpResponse, "Failure responding to request") return } return } // preparerForUserAssignedIdentitiesListBySubscription prepares the UserAssignedIdentitiesListBySubscription request. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -76,7 +76,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListBySubscripti } // preparerForUserAssignedIdentitiesListBySubscriptionWithNextLink prepares the UserAssignedIdentitiesListBySubscription request with the given nextLink token. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -102,7 +102,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesListBySubscripti // responderForUserAssignedIdentitiesListBySubscription handles the response to the UserAssignedIdentitiesListBySubscription request. The method always // closes the http.Response Body. -func (c ManagedIdentityClient) responderForUserAssignedIdentitiesListBySubscription(resp *http.Response) (result UserAssignedIdentitiesListBySubscriptionOperationResponse, err error) { +func (c ManagedIdentitiesClient) responderForUserAssignedIdentitiesListBySubscription(resp *http.Response) (result UserAssignedIdentitiesListBySubscriptionOperationResponse, err error) { type page struct { Values []Identity `json:"value"` NextLink *string `json:"nextLink"` @@ -120,19 +120,19 @@ func (c ManagedIdentityClient) responderForUserAssignedIdentitiesListBySubscript result.nextPageFunc = func(ctx context.Context, nextLink string) (result UserAssignedIdentitiesListBySubscriptionOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesListBySubscriptionWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListBySubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListBySubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListBySubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForUserAssignedIdentitiesListBySubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesListBySubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesListBySubscription", result.HttpResponse, "Failure responding to request") return } @@ -143,12 +143,12 @@ func (c ManagedIdentityClient) responderForUserAssignedIdentitiesListBySubscript } // UserAssignedIdentitiesListBySubscriptionComplete retrieves all of the results into a single object -func (c ManagedIdentityClient) UserAssignedIdentitiesListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (UserAssignedIdentitiesListBySubscriptionCompleteResult, error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (UserAssignedIdentitiesListBySubscriptionCompleteResult, error) { return c.UserAssignedIdentitiesListBySubscriptionCompleteMatchingPredicate(ctx, id, IdentityOperationPredicate{}) } // UserAssignedIdentitiesListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedIdentityClient) UserAssignedIdentitiesListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate IdentityOperationPredicate) (resp UserAssignedIdentitiesListBySubscriptionCompleteResult, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate IdentityOperationPredicate) (resp UserAssignedIdentitiesListBySubscriptionCompleteResult, err error) { items := make([]Identity, 0) page, err := c.UserAssignedIdentitiesListBySubscription(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesupdate_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesupdate_autorest.go index 7f95040fed5a1..22cea8211ebd4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/method_userassignedidentitiesupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/method_userassignedidentitiesupdate_autorest.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import ( "context" @@ -18,22 +18,22 @@ type UserAssignedIdentitiesUpdateOperationResponse struct { } // UserAssignedIdentitiesUpdate ... -func (c ManagedIdentityClient) UserAssignedIdentitiesUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input IdentityUpdate) (result UserAssignedIdentitiesUpdateOperationResponse, err error) { +func (c ManagedIdentitiesClient) UserAssignedIdentitiesUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input IdentityUpdate) (result UserAssignedIdentitiesUpdateOperationResponse, err error) { req, err := c.preparerForUserAssignedIdentitiesUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForUserAssignedIdentitiesUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "managedidentity.ManagedIdentityClient", "UserAssignedIdentitiesUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "managedidentities.ManagedIdentitiesClient", "UserAssignedIdentitiesUpdate", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c ManagedIdentityClient) UserAssignedIdentitiesUpdate(ctx context.Context, } // preparerForUserAssignedIdentitiesUpdate prepares the UserAssignedIdentitiesUpdate request. -func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input IdentityUpdate) (*http.Request, error) { +func (c ManagedIdentitiesClient) preparerForUserAssignedIdentitiesUpdate(ctx context.Context, id commonids.UserAssignedIdentityId, input IdentityUpdate) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c ManagedIdentityClient) preparerForUserAssignedIdentitiesUpdate(ctx conte // responderForUserAssignedIdentitiesUpdate handles the response to the UserAssignedIdentitiesUpdate request. The method always // closes the http.Response Body. -func (c ManagedIdentityClient) responderForUserAssignedIdentitiesUpdate(resp *http.Response) (result UserAssignedIdentitiesUpdateOperationResponse, err error) { +func (c ManagedIdentitiesClient) responderForUserAssignedIdentitiesUpdate(resp *http.Response) (result UserAssignedIdentitiesUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_identity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_identity.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_identity.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_identity.go index e740d92711f37..57a699bedd4c4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_identity.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_identity.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_identityupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_identityupdate.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_identityupdate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_identityupdate.go index 8da72370c5433..8a33c3afc3a6d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_identityupdate.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_identityupdate.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_systemassignedidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_systemassignedidentity.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_systemassignedidentity.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_systemassignedidentity.go index 6d10d7a144a77..99548d4fe8bf1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_systemassignedidentity.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_systemassignedidentity.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_systemassignedidentityproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_systemassignedidentityproperties.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_systemassignedidentityproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_systemassignedidentityproperties.go index bd8a9cec49b12..ce9255da48b87 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_systemassignedidentityproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_systemassignedidentityproperties.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_userassignedidentityproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_userassignedidentityproperties.go similarity index 93% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_userassignedidentityproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_userassignedidentityproperties.go index f632fbbb00904..f55185a771bcf 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/model_userassignedidentityproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/model_userassignedidentityproperties.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/predicates.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/predicates.go index d3c3fa8ba5d6e..c2ebab38f5f30 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/predicates.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/predicates.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities type IdentityOperationPredicate struct { Id *string diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/version.go similarity index 68% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/version.go index 510c2a02aba95..0c7ce72850901 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities/version.go @@ -1,4 +1,4 @@ -package managedidentity +package managedidentities import "fmt" @@ -8,5 +8,5 @@ import "fmt" const defaultApiVersion = "2018-11-30" func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/managedidentity/%s", defaultApiVersion) + return fmt.Sprintf("hashicorp/go-azure-sdk/managedidentities/%s", defaultApiVersion) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/README.md new file mode 100644 index 0000000000000..fa17aca6a5cce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/README.md @@ -0,0 +1,69 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations` Documentation + +The `configurations` SDK allows for interaction with the Azure Resource Manager Service `mariadb` (API Version `2018-06-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations" +``` + + +### Client Initialization + +```go +client := configurations.NewConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ConfigurationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "configurationValue") + +payload := configurations.Configuration{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ConfigurationsClient.Get` + +```go +ctx := context.TODO() +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "configurationValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ConfigurationsClient.ListByServer` + +```go +ctx := context.TODO() +id := configurations.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +read, err := client.ListByServer(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/client.go new file mode 100644 index 0000000000000..bbe813edd989a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/client.go @@ -0,0 +1,18 @@ +package configurations + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConfigurationsClient struct { + Client autorest.Client + baseUri string +} + +func NewConfigurationsClientWithBaseURI(endpoint string) ConfigurationsClient { + return ConfigurationsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/id_configuration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/id_configuration.go new file mode 100644 index 0000000000000..4ee365c6b97dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/id_configuration.go @@ -0,0 +1,137 @@ +package configurations + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ConfigurationId{} + +// ConfigurationId is a struct representing the Resource ID for a Configuration +type ConfigurationId struct { + SubscriptionId string + ResourceGroupName string + ServerName string + ConfigurationName string +} + +// NewConfigurationID returns a new ConfigurationId struct +func NewConfigurationID(subscriptionId string, resourceGroupName string, serverName string, configurationName string) ConfigurationId { + return ConfigurationId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + ConfigurationName: configurationName, + } +} + +// ParseConfigurationID parses 'input' into a ConfigurationId +func ParseConfigurationID(input string) (*ConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(ConfigurationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.ConfigurationName, ok = parsed.Parsed["configurationName"]; !ok { + return nil, fmt.Errorf("the segment 'configurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseConfigurationIDInsensitively parses 'input' case-insensitively into a ConfigurationId +// note: this method should only be used for API response data and not user input +func ParseConfigurationIDInsensitively(input string) (*ConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(ConfigurationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ConfigurationId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.ConfigurationName, ok = parsed.Parsed["configurationName"]; !ok { + return nil, fmt.Errorf("the segment 'configurationName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateConfigurationID checks that 'input' can be parsed as a Configuration ID +func ValidateConfigurationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseConfigurationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Configuration ID +func (id ConfigurationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/configurations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName, id.ConfigurationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Configuration ID +func (id ConfigurationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), + resourceids.UserSpecifiedSegment("configurationName", "configurationValue"), + } +} + +// String returns a human-readable description of this Configuration ID +func (id ConfigurationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + fmt.Sprintf("Configuration Name: %q", id.ConfigurationName), + } + return fmt.Sprintf("Configuration (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/id_server.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/id_server.go new file mode 100644 index 0000000000000..01a99b520638e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/id_server.go @@ -0,0 +1,124 @@ +package configurations + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ServerId{} + +// ServerId is a struct representing the Resource ID for a Server +type ServerId struct { + SubscriptionId string + ResourceGroupName string + ServerName string +} + +// NewServerID returns a new ServerId struct +func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId { + return ServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + } +} + +// ParseServerID parses 'input' into a ServerId +func ParseServerID(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId +// note: this method should only be used for API response data and not user input +func ParseServerIDInsensitively(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateServerID checks that 'input' can be parsed as a Server ID +func ValidateServerID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Server ID +func (id ServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Server ID +func (id ServerId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + } +} + +// String returns a human-readable description of this Server ID +func (id ServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + } + return fmt.Sprintf("Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..c1e771a52d14d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package configurations + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c ConfigurationsClient) CreateOrUpdate(ctx context.Context, id ConfigurationId, input Configuration) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c ConfigurationsClient) CreateOrUpdateThenPoll(ctx context.Context, id ConfigurationId, input Configuration) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c ConfigurationsClient) preparerForCreateOrUpdate(ctx context.Context, id ConfigurationId, input Configuration) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c ConfigurationsClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_get_autorest.go new file mode 100644 index 0000000000000..2aeb488f91c05 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_get_autorest.go @@ -0,0 +1,68 @@ +package configurations + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Configuration +} + +// Get ... +func (c ConfigurationsClient) Get(ctx context.Context, id ConfigurationId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c ConfigurationsClient) preparerForGet(ctx context.Context, id ConfigurationId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c ConfigurationsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_listbyserver_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_listbyserver_autorest.go new file mode 100644 index 0000000000000..950a5ec48c1bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/method_listbyserver_autorest.go @@ -0,0 +1,69 @@ +package configurations + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByServerOperationResponse struct { + HttpResponse *http.Response + Model *ConfigurationListResult +} + +// ListByServer ... +func (c ConfigurationsClient) ListByServer(ctx context.Context, id ServerId) (result ListByServerOperationResponse, err error) { + req, err := c.preparerForListByServer(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "ListByServer", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "ListByServer", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByServer(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "configurations.ConfigurationsClient", "ListByServer", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForListByServer prepares the ListByServer request. +func (c ConfigurationsClient) preparerForListByServer(ctx context.Context, id ServerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/configurations", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByServer handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (c ConfigurationsClient) responderForListByServer(resp *http.Response) (result ListByServerOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configuration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configuration.go new file mode 100644 index 0000000000000..84bf2c2812767 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configuration.go @@ -0,0 +1,11 @@ +package configurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Configuration struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ConfigurationProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configurationlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configurationlistresult.go new file mode 100644 index 0000000000000..98af12f5801e2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configurationlistresult.go @@ -0,0 +1,8 @@ +package configurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConfigurationListResult struct { + Value *[]Configuration `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configurationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configurationproperties.go new file mode 100644 index 0000000000000..51143bf6154a3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/model_configurationproperties.go @@ -0,0 +1,13 @@ +package configurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConfigurationProperties struct { + AllowedValues *string `json:"allowedValues,omitempty"` + DataType *string `json:"dataType,omitempty"` + DefaultValue *string `json:"defaultValue,omitempty"` + Description *string `json:"description,omitempty"` + Source *string `json:"source,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/version.go new file mode 100644 index 0000000000000..b31650f643447 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations/version.go @@ -0,0 +1,12 @@ +package configurations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2018-06-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/configurations/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/README.md new file mode 100644 index 0000000000000..3685fef1934dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases` Documentation + +The `databases` SDK allows for interaction with the Azure Resource Manager Service `mariadb` (API Version `2018-06-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases" +``` + + +### Client Initialization + +```go +client := databases.NewDatabasesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DatabasesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue") + +payload := databases.Database{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DatabasesClient.Delete` + +```go +ctx := context.TODO() +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DatabasesClient.Get` + +```go +ctx := context.TODO() +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DatabasesClient.ListByServer` + +```go +ctx := context.TODO() +id := databases.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +read, err := client.ListByServer(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/client.go new file mode 100644 index 0000000000000..5305d65eb6c1c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/client.go @@ -0,0 +1,18 @@ +package databases + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabasesClient struct { + Client autorest.Client + baseUri string +} + +func NewDatabasesClientWithBaseURI(endpoint string) DatabasesClient { + return DatabasesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/id_database.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/id_database.go new file mode 100644 index 0000000000000..4a5dcb2469044 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/id_database.go @@ -0,0 +1,137 @@ +package databases + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = DatabaseId{} + +// DatabaseId is a struct representing the Resource ID for a Database +type DatabaseId struct { + SubscriptionId string + ResourceGroupName string + ServerName string + DatabaseName string +} + +// NewDatabaseID returns a new DatabaseId struct +func NewDatabaseID(subscriptionId string, resourceGroupName string, serverName string, databaseName string) DatabaseId { + return DatabaseId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + DatabaseName: databaseName, + } +} + +// ParseDatabaseID parses 'input' into a DatabaseId +func ParseDatabaseID(input string) (*DatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseDatabaseIDInsensitively parses 'input' case-insensitively into a DatabaseId +// note: this method should only be used for API response data and not user input +func ParseDatabaseIDInsensitively(input string) (*DatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(DatabaseId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DatabaseId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.DatabaseName, ok = parsed.Parsed["databaseName"]; !ok { + return nil, fmt.Errorf("the segment 'databaseName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateDatabaseID checks that 'input' can be parsed as a Database ID +func ValidateDatabaseID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseDatabaseID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database ID +func (id DatabaseId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/databases/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName, id.DatabaseName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database ID +func (id DatabaseId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + resourceids.StaticSegment("staticDatabases", "databases", "databases"), + resourceids.UserSpecifiedSegment("databaseName", "databaseValue"), + } +} + +// String returns a human-readable description of this Database ID +func (id DatabaseId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + fmt.Sprintf("Database Name: %q", id.DatabaseName), + } + return fmt.Sprintf("Database (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/id_server.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/id_server.go new file mode 100644 index 0000000000000..2369e7a1a499c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/id_server.go @@ -0,0 +1,124 @@ +package databases + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ServerId{} + +// ServerId is a struct representing the Resource ID for a Server +type ServerId struct { + SubscriptionId string + ResourceGroupName string + ServerName string +} + +// NewServerID returns a new ServerId struct +func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId { + return ServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + } +} + +// ParseServerID parses 'input' into a ServerId +func ParseServerID(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId +// note: this method should only be used for API response data and not user input +func ParseServerIDInsensitively(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateServerID checks that 'input' can be parsed as a Server ID +func ValidateServerID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Server ID +func (id ServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Server ID +func (id ServerId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + } +} + +// String returns a human-readable description of this Server ID +func (id ServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + } + return fmt.Sprintf("Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..8046543297dad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package databases + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c DatabasesClient) CreateOrUpdate(ctx context.Context, id DatabaseId, input Database) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c DatabasesClient) CreateOrUpdateThenPoll(ctx context.Context, id DatabaseId, input Database) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c DatabasesClient) preparerForCreateOrUpdate(ctx context.Context, id DatabaseId, input Database) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c DatabasesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_delete_autorest.go new file mode 100644 index 0000000000000..13221da85a687 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_delete_autorest.go @@ -0,0 +1,78 @@ +package databases + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c DatabasesClient) Delete(ctx context.Context, id DatabaseId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c DatabasesClient) DeleteThenPoll(ctx context.Context, id DatabaseId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c DatabasesClient) preparerForDelete(ctx context.Context, id DatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c DatabasesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_get_autorest.go new file mode 100644 index 0000000000000..f35d313d2268d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_get_autorest.go @@ -0,0 +1,68 @@ +package databases + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Database +} + +// Get ... +func (c DatabasesClient) Get(ctx context.Context, id DatabaseId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c DatabasesClient) preparerForGet(ctx context.Context, id DatabaseId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c DatabasesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_listbyserver_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_listbyserver_autorest.go new file mode 100644 index 0000000000000..c02aac94bf658 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/method_listbyserver_autorest.go @@ -0,0 +1,69 @@ +package databases + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByServerOperationResponse struct { + HttpResponse *http.Response + Model *DatabaseListResult +} + +// ListByServer ... +func (c DatabasesClient) ListByServer(ctx context.Context, id ServerId) (result ListByServerOperationResponse, err error) { + req, err := c.preparerForListByServer(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "ListByServer", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "ListByServer", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByServer(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "databases.DatabasesClient", "ListByServer", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForListByServer prepares the ListByServer request. +func (c DatabasesClient) preparerForListByServer(ctx context.Context, id ServerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/databases", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByServer handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (c DatabasesClient) responderForListByServer(resp *http.Response) (result ListByServerOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_database.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_database.go new file mode 100644 index 0000000000000..a9880a7432bb0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_database.go @@ -0,0 +1,11 @@ +package databases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Database struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DatabaseProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_databaselistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_databaselistresult.go new file mode 100644 index 0000000000000..80645ead09238 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_databaselistresult.go @@ -0,0 +1,8 @@ +package databases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseListResult struct { + Value *[]Database `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_databaseproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_databaseproperties.go new file mode 100644 index 0000000000000..85fcbd70d5781 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/model_databaseproperties.go @@ -0,0 +1,9 @@ +package databases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseProperties struct { + Charset *string `json:"charset,omitempty"` + Collation *string `json:"collation,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/version.go new file mode 100644 index 0000000000000..6edfbce43c1b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases/version.go @@ -0,0 +1,12 @@ +package databases + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2018-06-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/databases/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/README.md new file mode 100644 index 0000000000000..d46a7c5402ea7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules` Documentation + +The `firewallrules` SDK allows for interaction with the Azure Resource Manager Service `mariadb` (API Version `2018-06-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules" +``` + + +### Client Initialization + +```go +client := firewallrules.NewFirewallRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `FirewallRulesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "firewallRuleValue") + +payload := firewallrules.FirewallRule{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `FirewallRulesClient.Delete` + +```go +ctx := context.TODO() +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "firewallRuleValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `FirewallRulesClient.Get` + +```go +ctx := context.TODO() +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "firewallRuleValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallRulesClient.ListByServer` + +```go +ctx := context.TODO() +id := firewallrules.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +read, err := client.ListByServer(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/client.go new file mode 100644 index 0000000000000..ac01b0459a14b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/client.go @@ -0,0 +1,18 @@ +package firewallrules + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FirewallRulesClient struct { + Client autorest.Client + baseUri string +} + +func NewFirewallRulesClientWithBaseURI(endpoint string) FirewallRulesClient { + return FirewallRulesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/id_firewallrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/id_firewallrule.go new file mode 100644 index 0000000000000..7c308c2e5efa8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/id_firewallrule.go @@ -0,0 +1,137 @@ +package firewallrules + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = FirewallRuleId{} + +// FirewallRuleId is a struct representing the Resource ID for a Firewall Rule +type FirewallRuleId struct { + SubscriptionId string + ResourceGroupName string + ServerName string + FirewallRuleName string +} + +// NewFirewallRuleID returns a new FirewallRuleId struct +func NewFirewallRuleID(subscriptionId string, resourceGroupName string, serverName string, firewallRuleName string) FirewallRuleId { + return FirewallRuleId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + FirewallRuleName: firewallRuleName, + } +} + +// ParseFirewallRuleID parses 'input' into a FirewallRuleId +func ParseFirewallRuleID(input string) (*FirewallRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(FirewallRuleId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := FirewallRuleId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.FirewallRuleName, ok = parsed.Parsed["firewallRuleName"]; !ok { + return nil, fmt.Errorf("the segment 'firewallRuleName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseFirewallRuleIDInsensitively parses 'input' case-insensitively into a FirewallRuleId +// note: this method should only be used for API response data and not user input +func ParseFirewallRuleIDInsensitively(input string) (*FirewallRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(FirewallRuleId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := FirewallRuleId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.FirewallRuleName, ok = parsed.Parsed["firewallRuleName"]; !ok { + return nil, fmt.Errorf("the segment 'firewallRuleName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateFirewallRuleID checks that 'input' can be parsed as a Firewall Rule ID +func ValidateFirewallRuleID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseFirewallRuleID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Firewall Rule ID +func (id FirewallRuleId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/firewallRules/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName, id.FirewallRuleName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Firewall Rule ID +func (id FirewallRuleId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), + resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleValue"), + } +} + +// String returns a human-readable description of this Firewall Rule ID +func (id FirewallRuleId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + fmt.Sprintf("Firewall Rule Name: %q", id.FirewallRuleName), + } + return fmt.Sprintf("Firewall Rule (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/id_server.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/id_server.go new file mode 100644 index 0000000000000..a6c5ab98447e5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/id_server.go @@ -0,0 +1,124 @@ +package firewallrules + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ServerId{} + +// ServerId is a struct representing the Resource ID for a Server +type ServerId struct { + SubscriptionId string + ResourceGroupName string + ServerName string +} + +// NewServerID returns a new ServerId struct +func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId { + return ServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + } +} + +// ParseServerID parses 'input' into a ServerId +func ParseServerID(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId +// note: this method should only be used for API response data and not user input +func ParseServerIDInsensitively(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateServerID checks that 'input' can be parsed as a Server ID +func ValidateServerID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Server ID +func (id ServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Server ID +func (id ServerId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + } +} + +// String returns a human-readable description of this Server ID +func (id ServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + } + return fmt.Sprintf("Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..0dfa761f1a0e0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package firewallrules + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c FirewallRulesClient) CreateOrUpdate(ctx context.Context, id FirewallRuleId, input FirewallRule) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c FirewallRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id FirewallRuleId, input FirewallRule) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c FirewallRulesClient) preparerForCreateOrUpdate(ctx context.Context, id FirewallRuleId, input FirewallRule) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c FirewallRulesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_delete_autorest.go new file mode 100644 index 0000000000000..ec4b290ecddbd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_delete_autorest.go @@ -0,0 +1,78 @@ +package firewallrules + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c FirewallRulesClient) Delete(ctx context.Context, id FirewallRuleId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c FirewallRulesClient) DeleteThenPoll(ctx context.Context, id FirewallRuleId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c FirewallRulesClient) preparerForDelete(ctx context.Context, id FirewallRuleId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c FirewallRulesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_get_autorest.go similarity index 50% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_get_autorest.go index 9b5e02b916908..1391c01ba1a28 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_get_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package firewallrules import ( "context" @@ -11,36 +11,36 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type VideosGetOperationResponse struct { +type GetOperationResponse struct { HttpResponse *http.Response - Model *VideoEntity + Model *FirewallRule } -// VideosGet ... -func (c VideoAnalyzerClient) VideosGet(ctx context.Context, id VideoId) (result VideosGetOperationResponse, err error) { - req, err := c.preparerForVideosGet(ctx, id) +// Get ... +func (c FirewallRulesClient) Get(ctx context.Context, id FirewallRuleId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "Get", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "Get", result.HttpResponse, "Failure sending request") return } - result, err = c.responderForVideosGet(result.HttpResponse) + result, err = c.responderForGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "Get", result.HttpResponse, "Failure responding to request") return } return } -// preparerForVideosGet prepares the VideosGet request. -func (c VideoAnalyzerClient) preparerForVideosGet(ctx context.Context, id VideoId) (*http.Request, error) { +// preparerForGet prepares the Get request. +func (c FirewallRulesClient) preparerForGet(ctx context.Context, id FirewallRuleId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -54,9 +54,9 @@ func (c VideoAnalyzerClient) preparerForVideosGet(ctx context.Context, id VideoI return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// responderForVideosGet handles the response to the VideosGet request. The method always +// responderForGet handles the response to the Get request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideosGet(resp *http.Response) (result VideosGetOperationResponse, err error) { +func (c FirewallRulesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_listbyserver_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_listbyserver_autorest.go new file mode 100644 index 0000000000000..70624d92ee85e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/method_listbyserver_autorest.go @@ -0,0 +1,69 @@ +package firewallrules + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByServerOperationResponse struct { + HttpResponse *http.Response + Model *FirewallRuleListResult +} + +// ListByServer ... +func (c FirewallRulesClient) ListByServer(ctx context.Context, id ServerId) (result ListByServerOperationResponse, err error) { + req, err := c.preparerForListByServer(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "ListByServer", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "ListByServer", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByServer(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "firewallrules.FirewallRulesClient", "ListByServer", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForListByServer prepares the ListByServer request. +func (c FirewallRulesClient) preparerForListByServer(ctx context.Context, id ServerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/firewallRules", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByServer handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (c FirewallRulesClient) responderForListByServer(resp *http.Response) (result ListByServerOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallrule.go new file mode 100644 index 0000000000000..3178a13ed2c44 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallrule.go @@ -0,0 +1,11 @@ +package firewallrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FirewallRule struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties FirewallRuleProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallrulelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallrulelistresult.go new file mode 100644 index 0000000000000..c01e91fae564e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallrulelistresult.go @@ -0,0 +1,8 @@ +package firewallrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FirewallRuleListResult struct { + Value *[]FirewallRule `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallruleproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallruleproperties.go new file mode 100644 index 0000000000000..fca4e1c3684b4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/model_firewallruleproperties.go @@ -0,0 +1,9 @@ +package firewallrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FirewallRuleProperties struct { + EndIPAddress string `json:"endIpAddress"` + StartIPAddress string `json:"startIpAddress"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/version.go new file mode 100644 index 0000000000000..50bf96272aeb4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules/version.go @@ -0,0 +1,12 @@ +package firewallrules + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2018-06-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/firewallrules/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/README.md new file mode 100644 index 0000000000000..69d2b94e329e0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/README.md @@ -0,0 +1,114 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers` Documentation + +The `servers` SDK allows for interaction with the Azure Resource Manager Service `mariadb` (API Version `2018-06-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers" +``` + + +### Client Initialization + +```go +client := servers.NewServersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ServersClient.Create` + +```go +ctx := context.TODO() +id := servers.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +payload := servers.ServerForCreate{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ServersClient.Delete` + +```go +ctx := context.TODO() +id := servers.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ServersClient.Get` + +```go +ctx := context.TODO() +id := servers.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ServersClient.List` + +```go +ctx := context.TODO() +id := servers.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.List(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ServersClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := servers.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +read, err := client.ListByResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ServersClient.Update` + +```go +ctx := context.TODO() +id := servers.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +payload := servers.ServerUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/client.go new file mode 100644 index 0000000000000..fd9e02ba599f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/client.go @@ -0,0 +1,18 @@ +package servers + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServersClient struct { + Client autorest.Client + baseUri string +} + +func NewServersClientWithBaseURI(endpoint string) ServersClient { + return ServersClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/constants.go new file mode 100644 index 0000000000000..7f3894de004ea --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/constants.go @@ -0,0 +1,372 @@ +package servers + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateMode string + +const ( + CreateModeDefault CreateMode = "Default" + CreateModeGeoRestore CreateMode = "GeoRestore" + CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" + CreateModeReplica CreateMode = "Replica" +) + +func PossibleValuesForCreateMode() []string { + return []string{ + string(CreateModeDefault), + string(CreateModeGeoRestore), + string(CreateModePointInTimeRestore), + string(CreateModeReplica), + } +} + +func parseCreateMode(input string) (*CreateMode, error) { + vals := map[string]CreateMode{ + "default": CreateModeDefault, + "georestore": CreateModeGeoRestore, + "pointintimerestore": CreateModePointInTimeRestore, + "replica": CreateModeReplica, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CreateMode(input) + return &out, nil +} + +type GeoRedundantBackup string + +const ( + GeoRedundantBackupDisabled GeoRedundantBackup = "Disabled" + GeoRedundantBackupEnabled GeoRedundantBackup = "Enabled" +) + +func PossibleValuesForGeoRedundantBackup() []string { + return []string{ + string(GeoRedundantBackupDisabled), + string(GeoRedundantBackupEnabled), + } +} + +func parseGeoRedundantBackup(input string) (*GeoRedundantBackup, error) { + vals := map[string]GeoRedundantBackup{ + "disabled": GeoRedundantBackupDisabled, + "enabled": GeoRedundantBackupEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GeoRedundantBackup(input) + return &out, nil +} + +type MinimalTlsVersionEnum string + +const ( + MinimalTlsVersionEnumTLSEnforcementDisabled MinimalTlsVersionEnum = "TLSEnforcementDisabled" + MinimalTlsVersionEnumTLSOneOne MinimalTlsVersionEnum = "TLS1_1" + MinimalTlsVersionEnumTLSOneTwo MinimalTlsVersionEnum = "TLS1_2" + MinimalTlsVersionEnumTLSOneZero MinimalTlsVersionEnum = "TLS1_0" +) + +func PossibleValuesForMinimalTlsVersionEnum() []string { + return []string{ + string(MinimalTlsVersionEnumTLSEnforcementDisabled), + string(MinimalTlsVersionEnumTLSOneOne), + string(MinimalTlsVersionEnumTLSOneTwo), + string(MinimalTlsVersionEnumTLSOneZero), + } +} + +func parseMinimalTlsVersionEnum(input string) (*MinimalTlsVersionEnum, error) { + vals := map[string]MinimalTlsVersionEnum{ + "tlsenforcementdisabled": MinimalTlsVersionEnumTLSEnforcementDisabled, + "tls1_1": MinimalTlsVersionEnumTLSOneOne, + "tls1_2": MinimalTlsVersionEnumTLSOneTwo, + "tls1_0": MinimalTlsVersionEnumTLSOneZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MinimalTlsVersionEnum(input) + return &out, nil +} + +type PrivateEndpointProvisioningState string + +const ( + PrivateEndpointProvisioningStateApproving PrivateEndpointProvisioningState = "Approving" + PrivateEndpointProvisioningStateDropping PrivateEndpointProvisioningState = "Dropping" + PrivateEndpointProvisioningStateFailed PrivateEndpointProvisioningState = "Failed" + PrivateEndpointProvisioningStateReady PrivateEndpointProvisioningState = "Ready" + PrivateEndpointProvisioningStateRejecting PrivateEndpointProvisioningState = "Rejecting" +) + +func PossibleValuesForPrivateEndpointProvisioningState() []string { + return []string{ + string(PrivateEndpointProvisioningStateApproving), + string(PrivateEndpointProvisioningStateDropping), + string(PrivateEndpointProvisioningStateFailed), + string(PrivateEndpointProvisioningStateReady), + string(PrivateEndpointProvisioningStateRejecting), + } +} + +func parsePrivateEndpointProvisioningState(input string) (*PrivateEndpointProvisioningState, error) { + vals := map[string]PrivateEndpointProvisioningState{ + "approving": PrivateEndpointProvisioningStateApproving, + "dropping": PrivateEndpointProvisioningStateDropping, + "failed": PrivateEndpointProvisioningStateFailed, + "ready": PrivateEndpointProvisioningStateReady, + "rejecting": PrivateEndpointProvisioningStateRejecting, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateEndpointProvisioningState(input) + return &out, nil +} + +type PrivateLinkServiceConnectionStateActionsRequire string + +const ( + PrivateLinkServiceConnectionStateActionsRequireNone PrivateLinkServiceConnectionStateActionsRequire = "None" +) + +func PossibleValuesForPrivateLinkServiceConnectionStateActionsRequire() []string { + return []string{ + string(PrivateLinkServiceConnectionStateActionsRequireNone), + } +} + +func parsePrivateLinkServiceConnectionStateActionsRequire(input string) (*PrivateLinkServiceConnectionStateActionsRequire, error) { + vals := map[string]PrivateLinkServiceConnectionStateActionsRequire{ + "none": PrivateLinkServiceConnectionStateActionsRequireNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateLinkServiceConnectionStateActionsRequire(input) + return &out, nil +} + +type PrivateLinkServiceConnectionStateStatus string + +const ( + PrivateLinkServiceConnectionStateStatusApproved PrivateLinkServiceConnectionStateStatus = "Approved" + PrivateLinkServiceConnectionStateStatusDisconnected PrivateLinkServiceConnectionStateStatus = "Disconnected" + PrivateLinkServiceConnectionStateStatusPending PrivateLinkServiceConnectionStateStatus = "Pending" + PrivateLinkServiceConnectionStateStatusRejected PrivateLinkServiceConnectionStateStatus = "Rejected" +) + +func PossibleValuesForPrivateLinkServiceConnectionStateStatus() []string { + return []string{ + string(PrivateLinkServiceConnectionStateStatusApproved), + string(PrivateLinkServiceConnectionStateStatusDisconnected), + string(PrivateLinkServiceConnectionStateStatusPending), + string(PrivateLinkServiceConnectionStateStatusRejected), + } +} + +func parsePrivateLinkServiceConnectionStateStatus(input string) (*PrivateLinkServiceConnectionStateStatus, error) { + vals := map[string]PrivateLinkServiceConnectionStateStatus{ + "approved": PrivateLinkServiceConnectionStateStatusApproved, + "disconnected": PrivateLinkServiceConnectionStateStatusDisconnected, + "pending": PrivateLinkServiceConnectionStateStatusPending, + "rejected": PrivateLinkServiceConnectionStateStatusRejected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateLinkServiceConnectionStateStatus(input) + return &out, nil +} + +type PublicNetworkAccessEnum string + +const ( + PublicNetworkAccessEnumDisabled PublicNetworkAccessEnum = "Disabled" + PublicNetworkAccessEnumEnabled PublicNetworkAccessEnum = "Enabled" +) + +func PossibleValuesForPublicNetworkAccessEnum() []string { + return []string{ + string(PublicNetworkAccessEnumDisabled), + string(PublicNetworkAccessEnumEnabled), + } +} + +func parsePublicNetworkAccessEnum(input string) (*PublicNetworkAccessEnum, error) { + vals := map[string]PublicNetworkAccessEnum{ + "disabled": PublicNetworkAccessEnumDisabled, + "enabled": PublicNetworkAccessEnumEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicNetworkAccessEnum(input) + return &out, nil +} + +type ServerState string + +const ( + ServerStateDisabled ServerState = "Disabled" + ServerStateDropping ServerState = "Dropping" + ServerStateReady ServerState = "Ready" +) + +func PossibleValuesForServerState() []string { + return []string{ + string(ServerStateDisabled), + string(ServerStateDropping), + string(ServerStateReady), + } +} + +func parseServerState(input string) (*ServerState, error) { + vals := map[string]ServerState{ + "disabled": ServerStateDisabled, + "dropping": ServerStateDropping, + "ready": ServerStateReady, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerState(input) + return &out, nil +} + +type ServerVersion string + +const ( + ServerVersionOneZeroPointThree ServerVersion = "10.3" + ServerVersionOneZeroPointTwo ServerVersion = "10.2" +) + +func PossibleValuesForServerVersion() []string { + return []string{ + string(ServerVersionOneZeroPointThree), + string(ServerVersionOneZeroPointTwo), + } +} + +func parseServerVersion(input string) (*ServerVersion, error) { + vals := map[string]ServerVersion{ + "10.3": ServerVersionOneZeroPointThree, + "10.2": ServerVersionOneZeroPointTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerVersion(input) + return &out, nil +} + +type SkuTier string + +const ( + SkuTierBasic SkuTier = "Basic" + SkuTierGeneralPurpose SkuTier = "GeneralPurpose" + SkuTierMemoryOptimized SkuTier = "MemoryOptimized" +) + +func PossibleValuesForSkuTier() []string { + return []string{ + string(SkuTierBasic), + string(SkuTierGeneralPurpose), + string(SkuTierMemoryOptimized), + } +} + +func parseSkuTier(input string) (*SkuTier, error) { + vals := map[string]SkuTier{ + "basic": SkuTierBasic, + "generalpurpose": SkuTierGeneralPurpose, + "memoryoptimized": SkuTierMemoryOptimized, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkuTier(input) + return &out, nil +} + +type SslEnforcementEnum string + +const ( + SslEnforcementEnumDisabled SslEnforcementEnum = "Disabled" + SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" +) + +func PossibleValuesForSslEnforcementEnum() []string { + return []string{ + string(SslEnforcementEnumDisabled), + string(SslEnforcementEnumEnabled), + } +} + +func parseSslEnforcementEnum(input string) (*SslEnforcementEnum, error) { + vals := map[string]SslEnforcementEnum{ + "disabled": SslEnforcementEnumDisabled, + "enabled": SslEnforcementEnumEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SslEnforcementEnum(input) + return &out, nil +} + +type StorageAutogrow string + +const ( + StorageAutogrowDisabled StorageAutogrow = "Disabled" + StorageAutogrowEnabled StorageAutogrow = "Enabled" +) + +func PossibleValuesForStorageAutogrow() []string { + return []string{ + string(StorageAutogrowDisabled), + string(StorageAutogrowEnabled), + } +} + +func parseStorageAutogrow(input string) (*StorageAutogrow, error) { + vals := map[string]StorageAutogrow{ + "disabled": StorageAutogrowDisabled, + "enabled": StorageAutogrowEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StorageAutogrow(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/id_server.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/id_server.go new file mode 100644 index 0000000000000..378e3ccace4bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/id_server.go @@ -0,0 +1,124 @@ +package servers + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ServerId{} + +// ServerId is a struct representing the Resource ID for a Server +type ServerId struct { + SubscriptionId string + ResourceGroupName string + ServerName string +} + +// NewServerID returns a new ServerId struct +func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId { + return ServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + } +} + +// ParseServerID parses 'input' into a ServerId +func ParseServerID(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId +// note: this method should only be used for API response data and not user input +func ParseServerIDInsensitively(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateServerID checks that 'input' can be parsed as a Server ID +func ValidateServerID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Server ID +func (id ServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Server ID +func (id ServerId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + } +} + +// String returns a human-readable description of this Server ID +func (id ServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + } + return fmt.Sprintf("Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_create_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_create_autorest.go new file mode 100644 index 0000000000000..e4d6bd5d73132 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_create_autorest.go @@ -0,0 +1,79 @@ +package servers + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Create ... +func (c ServersClient) Create(ctx context.Context, id ServerId, input ServerForCreate) (result CreateOperationResponse, err error) { + req, err := c.preparerForCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Create", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c ServersClient) CreateThenPoll(ctx context.Context, id ServerId, input ServerForCreate) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} + +// preparerForCreate prepares the Create request. +func (c ServersClient) preparerForCreate(ctx context.Context, id ServerId, input ServerForCreate) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreate sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (c ServersClient) senderForCreate(ctx context.Context, req *http.Request) (future CreateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_delete_autorest.go new file mode 100644 index 0000000000000..f4e5bea63be19 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_delete_autorest.go @@ -0,0 +1,78 @@ +package servers + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c ServersClient) Delete(ctx context.Context, id ServerId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ServersClient) DeleteThenPoll(ctx context.Context, id ServerId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c ServersClient) preparerForDelete(ctx context.Context, id ServerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c ServersClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_get_autorest.go new file mode 100644 index 0000000000000..5c54dc25354ae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_get_autorest.go @@ -0,0 +1,68 @@ +package servers + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Server +} + +// Get ... +func (c ServersClient) Get(ctx context.Context, id ServerId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c ServersClient) preparerForGet(ctx context.Context, id ServerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c ServersClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_list_autorest.go new file mode 100644 index 0000000000000..7d167a9a18c43 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_list_autorest.go @@ -0,0 +1,70 @@ +package servers + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *ServerListResult +} + +// List ... +func (c ServersClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForList prepares the List request. +func (c ServersClient) preparerForList(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.DBforMariaDB/servers", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c ServersClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_listbyresourcegroup_autorest.go new file mode 100644 index 0000000000000..28e8fc0a4dfe5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_listbyresourcegroup_autorest.go @@ -0,0 +1,70 @@ +package servers + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + Model *ServerListResult +} + +// ListByResourceGroup ... +func (c ServersClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroup(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "ListByResourceGroup", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByResourceGroup(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "ListByResourceGroup", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForListByResourceGroup prepares the ListByResourceGroup request. +func (c ServersClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.DBforMariaDB/servers", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (c ServersClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_update_autorest.go new file mode 100644 index 0000000000000..62f5524b57a9a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/method_update_autorest.go @@ -0,0 +1,79 @@ +package servers + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c ServersClient) Update(ctx context.Context, id ServerId, input ServerUpdateParameters) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "servers.ServersClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c ServersClient) UpdateThenPoll(ctx context.Context, id ServerId, input ServerUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c ServersClient) preparerForUpdate(ctx context.Context, id ServerId, input ServerUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c ServersClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_privateendpointproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_privateendpointproperty.go new file mode 100644 index 0000000000000..6b1eab772d2d8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_privateendpointproperty.go @@ -0,0 +1,8 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointProperty struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_server.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_server.go new file mode 100644 index 0000000000000..547e413d481a8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_server.go @@ -0,0 +1,14 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Server struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ServerProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverforcreate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverforcreate.go new file mode 100644 index 0000000000000..fd8d204648e05 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverforcreate.go @@ -0,0 +1,44 @@ +package servers + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerForCreate struct { + Location string `json:"location"` + Properties ServerPropertiesForCreate `json:"properties"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} + +var _ json.Unmarshaler = &ServerForCreate{} + +func (s *ServerForCreate) UnmarshalJSON(bytes []byte) error { + type alias ServerForCreate + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ServerForCreate: %+v", err) + } + + s.Location = decoded.Location + s.Sku = decoded.Sku + s.Tags = decoded.Tags + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ServerForCreate into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalServerPropertiesForCreateImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ServerForCreate': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverlistresult.go new file mode 100644 index 0000000000000..ccf6bd2427036 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverlistresult.go @@ -0,0 +1,8 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerListResult struct { + Value *[]Server `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivateendpointconnection.go new file mode 100644 index 0000000000000..9979a7cec1df3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivateendpointconnection.go @@ -0,0 +1,9 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerPrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Properties *ServerPrivateEndpointConnectionProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivateendpointconnectionproperties.go new file mode 100644 index 0000000000000..c30676397ef49 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivateendpointconnectionproperties.go @@ -0,0 +1,10 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerPrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *ServerPrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *PrivateEndpointProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivatelinkserviceconnectionstateproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivatelinkserviceconnectionstateproperty.go new file mode 100644 index 0000000000000..05d887b1bc6c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverprivatelinkserviceconnectionstateproperty.go @@ -0,0 +1,10 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerPrivateLinkServiceConnectionStateProperty struct { + ActionsRequired *PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"` + Description string `json:"description"` + Status PrivateLinkServiceConnectionStateStatus `json:"status"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverproperties.go new file mode 100644 index 0000000000000..a056ea8f16cb1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverproperties.go @@ -0,0 +1,38 @@ +package servers + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + AdministratorLogin *string `json:"administratorLogin,omitempty"` + EarliestRestoreDate *string `json:"earliestRestoreDate,omitempty"` + FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` + MasterServerId *string `json:"masterServerId,omitempty"` + MinimalTlsVersion *MinimalTlsVersionEnum `json:"minimalTlsVersion,omitempty"` + PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + PublicNetworkAccess *PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` + ReplicaCapacity *int64 `json:"replicaCapacity,omitempty"` + ReplicationRole *string `json:"replicationRole,omitempty"` + SslEnforcement *SslEnforcementEnum `json:"sslEnforcement,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + UserVisibleState *ServerState `json:"userVisibleState,omitempty"` + Version *ServerVersion `json:"version,omitempty"` +} + +func (o *ServerProperties) GetEarliestRestoreDateAsTime() (*time.Time, error) { + if o.EarliestRestoreDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EarliestRestoreDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *ServerProperties) SetEarliestRestoreDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EarliestRestoreDate = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforcreate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforcreate.go new file mode 100644 index 0000000000000..ef35f7ee261f4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforcreate.go @@ -0,0 +1,72 @@ +package servers + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerPropertiesForCreate interface { +} + +func unmarshalServerPropertiesForCreateImplementation(input []byte) (ServerPropertiesForCreate, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ServerPropertiesForCreate into map[string]interface: %+v", err) + } + + value, ok := temp["createMode"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "Default") { + var out ServerPropertiesForDefaultCreate + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServerPropertiesForDefaultCreate: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GeoRestore") { + var out ServerPropertiesForGeoRestore + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServerPropertiesForGeoRestore: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Replica") { + var out ServerPropertiesForReplica + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServerPropertiesForReplica: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PointInTimeRestore") { + var out ServerPropertiesForRestore + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServerPropertiesForRestore: %+v", err) + } + return out, nil + } + + type RawServerPropertiesForCreateImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawServerPropertiesForCreateImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesfordefaultcreate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesfordefaultcreate.go new file mode 100644 index 0000000000000..8311c1ef672ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesfordefaultcreate.go @@ -0,0 +1,47 @@ +package servers + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ServerPropertiesForCreate = ServerPropertiesForDefaultCreate{} + +type ServerPropertiesForDefaultCreate struct { + AdministratorLogin string `json:"administratorLogin"` + AdministratorLoginPassword string `json:"administratorLoginPassword"` + + // Fields inherited from ServerPropertiesForCreate + MinimalTlsVersion *MinimalTlsVersionEnum `json:"minimalTlsVersion,omitempty"` + PublicNetworkAccess *PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` + SslEnforcement *SslEnforcementEnum `json:"sslEnforcement,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + Version *ServerVersion `json:"version,omitempty"` +} + +var _ json.Marshaler = ServerPropertiesForDefaultCreate{} + +func (s ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { + type wrapper ServerPropertiesForDefaultCreate + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServerPropertiesForDefaultCreate: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServerPropertiesForDefaultCreate: %+v", err) + } + decoded["createMode"] = "Default" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServerPropertiesForDefaultCreate: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforgeorestore.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforgeorestore.go new file mode 100644 index 0000000000000..b57ee038d2a5f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforgeorestore.go @@ -0,0 +1,46 @@ +package servers + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ServerPropertiesForCreate = ServerPropertiesForGeoRestore{} + +type ServerPropertiesForGeoRestore struct { + SourceServerId string `json:"sourceServerId"` + + // Fields inherited from ServerPropertiesForCreate + MinimalTlsVersion *MinimalTlsVersionEnum `json:"minimalTlsVersion,omitempty"` + PublicNetworkAccess *PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` + SslEnforcement *SslEnforcementEnum `json:"sslEnforcement,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + Version *ServerVersion `json:"version,omitempty"` +} + +var _ json.Marshaler = ServerPropertiesForGeoRestore{} + +func (s ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) { + type wrapper ServerPropertiesForGeoRestore + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServerPropertiesForGeoRestore: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServerPropertiesForGeoRestore: %+v", err) + } + decoded["createMode"] = "GeoRestore" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServerPropertiesForGeoRestore: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforreplica.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforreplica.go new file mode 100644 index 0000000000000..58b5f5a7929c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforreplica.go @@ -0,0 +1,46 @@ +package servers + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ServerPropertiesForCreate = ServerPropertiesForReplica{} + +type ServerPropertiesForReplica struct { + SourceServerId string `json:"sourceServerId"` + + // Fields inherited from ServerPropertiesForCreate + MinimalTlsVersion *MinimalTlsVersionEnum `json:"minimalTlsVersion,omitempty"` + PublicNetworkAccess *PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` + SslEnforcement *SslEnforcementEnum `json:"sslEnforcement,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + Version *ServerVersion `json:"version,omitempty"` +} + +var _ json.Marshaler = ServerPropertiesForReplica{} + +func (s ServerPropertiesForReplica) MarshalJSON() ([]byte, error) { + type wrapper ServerPropertiesForReplica + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServerPropertiesForReplica: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServerPropertiesForReplica: %+v", err) + } + decoded["createMode"] = "Replica" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServerPropertiesForReplica: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforrestore.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforrestore.go new file mode 100644 index 0000000000000..c60b9f3680292 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverpropertiesforrestore.go @@ -0,0 +1,47 @@ +package servers + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ServerPropertiesForCreate = ServerPropertiesForRestore{} + +type ServerPropertiesForRestore struct { + RestorePointInTime string `json:"restorePointInTime"` + SourceServerId string `json:"sourceServerId"` + + // Fields inherited from ServerPropertiesForCreate + MinimalTlsVersion *MinimalTlsVersionEnum `json:"minimalTlsVersion,omitempty"` + PublicNetworkAccess *PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` + SslEnforcement *SslEnforcementEnum `json:"sslEnforcement,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + Version *ServerVersion `json:"version,omitempty"` +} + +var _ json.Marshaler = ServerPropertiesForRestore{} + +func (s ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { + type wrapper ServerPropertiesForRestore + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServerPropertiesForRestore: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServerPropertiesForRestore: %+v", err) + } + decoded["createMode"] = "PointInTimeRestore" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServerPropertiesForRestore: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverupdateparameters.go new file mode 100644 index 0000000000000..b7088edafbe2b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverupdateparameters.go @@ -0,0 +1,10 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerUpdateParameters struct { + Properties *ServerUpdateParametersProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverupdateparametersproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverupdateparametersproperties.go new file mode 100644 index 0000000000000..8557ea7275279 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_serverupdateparametersproperties.go @@ -0,0 +1,14 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerUpdateParametersProperties struct { + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + MinimalTlsVersion *MinimalTlsVersionEnum `json:"minimalTlsVersion,omitempty"` + PublicNetworkAccess *PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` + ReplicationRole *string `json:"replicationRole,omitempty"` + SslEnforcement *SslEnforcementEnum `json:"sslEnforcement,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + Version *ServerVersion `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_sku.go new file mode 100644 index 0000000000000..8bb23cf521d38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_sku.go @@ -0,0 +1,12 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Sku struct { + Capacity *int64 `json:"capacity,omitempty"` + Family *string `json:"family,omitempty"` + Name string `json:"name"` + Size *string `json:"size,omitempty"` + Tier *SkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_storageprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_storageprofile.go new file mode 100644 index 0000000000000..ecb9b55edb0b4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/model_storageprofile.go @@ -0,0 +1,11 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfile struct { + BackupRetentionDays *int64 `json:"backupRetentionDays,omitempty"` + GeoRedundantBackup *GeoRedundantBackup `json:"geoRedundantBackup,omitempty"` + StorageAutogrow *StorageAutogrow `json:"storageAutogrow,omitempty"` + StorageMB *int64 `json:"storageMB,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/version.go new file mode 100644 index 0000000000000..2e8ea15688542 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers/version.go @@ -0,0 +1,12 @@ +package servers + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2018-06-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/servers/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/README.md new file mode 100644 index 0000000000000..9660b52a520f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules` Documentation + +The `virtualnetworkrules` SDK allows for interaction with the Azure Resource Manager Service `mariadb` (API Version `2018-06-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules" +``` + + +### Client Initialization + +```go +client := virtualnetworkrules.NewVirtualNetworkRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworkRulesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworkrules.NewVirtualNetworkRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "virtualNetworkRuleValue") + +payload := virtualnetworkrules.VirtualNetworkRule{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkRulesClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworkrules.NewVirtualNetworkRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "virtualNetworkRuleValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkRulesClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworkrules.NewVirtualNetworkRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "virtualNetworkRuleValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworkRulesClient.ListByServer` + +```go +ctx := context.TODO() +id := virtualnetworkrules.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue") + +// alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination +items, err := client.ListByServerComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/client.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/client.go index f35cbf2494aaf..c5bb4f331d33e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights/client.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/client.go @@ -1,17 +1,17 @@ -package applicationinsights +package virtualnetworkrules import "github.com/Azure/go-autorest/autorest" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationInsightsClient struct { +type VirtualNetworkRulesClient struct { Client autorest.Client baseUri string } -func NewApplicationInsightsClientWithBaseURI(endpoint string) ApplicationInsightsClient { - return ApplicationInsightsClient{ +func NewVirtualNetworkRulesClientWithBaseURI(endpoint string) VirtualNetworkRulesClient { + return VirtualNetworkRulesClient{ Client: autorest.NewClientWithUserAgent(userAgent()), baseUri: endpoint, } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/constants.go new file mode 100644 index 0000000000000..686ce6f868d2a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/constants.go @@ -0,0 +1,43 @@ +package virtualnetworkrules + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkRuleState string + +const ( + VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" + VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" + VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" + VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" + VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" +) + +func PossibleValuesForVirtualNetworkRuleState() []string { + return []string{ + string(VirtualNetworkRuleStateDeleting), + string(VirtualNetworkRuleStateInProgress), + string(VirtualNetworkRuleStateInitializing), + string(VirtualNetworkRuleStateReady), + string(VirtualNetworkRuleStateUnknown), + } +} + +func parseVirtualNetworkRuleState(input string) (*VirtualNetworkRuleState, error) { + vals := map[string]VirtualNetworkRuleState{ + "deleting": VirtualNetworkRuleStateDeleting, + "inprogress": VirtualNetworkRuleStateInProgress, + "initializing": VirtualNetworkRuleStateInitializing, + "ready": VirtualNetworkRuleStateReady, + "unknown": VirtualNetworkRuleStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkRuleState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/id_server.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/id_server.go new file mode 100644 index 0000000000000..6fafcfc6fba1e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/id_server.go @@ -0,0 +1,124 @@ +package virtualnetworkrules + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ServerId{} + +// ServerId is a struct representing the Resource ID for a Server +type ServerId struct { + SubscriptionId string + ResourceGroupName string + ServerName string +} + +// NewServerID returns a new ServerId struct +func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId { + return ServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + } +} + +// ParseServerID parses 'input' into a ServerId +func ParseServerID(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId +// note: this method should only be used for API response data and not user input +func ParseServerIDInsensitively(input string) (*ServerId, error) { + parser := resourceids.NewParserFromResourceIdType(ServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ServerId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateServerID checks that 'input' can be parsed as a Server ID +func ValidateServerID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Server ID +func (id ServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Server ID +func (id ServerId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + } +} + +// String returns a human-readable description of this Server ID +func (id ServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + } + return fmt.Sprintf("Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/id_virtualnetworkrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/id_virtualnetworkrule.go new file mode 100644 index 0000000000000..9a5d5dba67e03 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/id_virtualnetworkrule.go @@ -0,0 +1,137 @@ +package virtualnetworkrules + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VirtualNetworkRuleId{} + +// VirtualNetworkRuleId is a struct representing the Resource ID for a Virtual Network Rule +type VirtualNetworkRuleId struct { + SubscriptionId string + ResourceGroupName string + ServerName string + VirtualNetworkRuleName string +} + +// NewVirtualNetworkRuleID returns a new VirtualNetworkRuleId struct +func NewVirtualNetworkRuleID(subscriptionId string, resourceGroupName string, serverName string, virtualNetworkRuleName string) VirtualNetworkRuleId { + return VirtualNetworkRuleId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ServerName: serverName, + VirtualNetworkRuleName: virtualNetworkRuleName, + } +} + +// ParseVirtualNetworkRuleID parses 'input' into a VirtualNetworkRuleId +func ParseVirtualNetworkRuleID(input string) (*VirtualNetworkRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualNetworkRuleId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualNetworkRuleId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.VirtualNetworkRuleName, ok = parsed.Parsed["virtualNetworkRuleName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualNetworkRuleName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVirtualNetworkRuleIDInsensitively parses 'input' case-insensitively into a VirtualNetworkRuleId +// note: this method should only be used for API response data and not user input +func ParseVirtualNetworkRuleIDInsensitively(input string) (*VirtualNetworkRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualNetworkRuleId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualNetworkRuleId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.ServerName, ok = parsed.Parsed["serverName"]; !ok { + return nil, fmt.Errorf("the segment 'serverName' was not found in the resource id %q", input) + } + + if id.VirtualNetworkRuleName, ok = parsed.Parsed["virtualNetworkRuleName"]; !ok { + return nil, fmt.Errorf("the segment 'virtualNetworkRuleName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVirtualNetworkRuleID checks that 'input' can be parsed as a Virtual Network Rule ID +func ValidateVirtualNetworkRuleID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVirtualNetworkRuleID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Network Rule ID +func (id VirtualNetworkRuleId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMariaDB/servers/%s/virtualNetworkRules/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerName, id.VirtualNetworkRuleName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Rule ID +func (id VirtualNetworkRuleId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDBforMariaDB", "Microsoft.DBforMariaDB", "Microsoft.DBforMariaDB"), + resourceids.StaticSegment("staticServers", "servers", "servers"), + resourceids.UserSpecifiedSegment("serverName", "serverValue"), + resourceids.StaticSegment("staticVirtualNetworkRules", "virtualNetworkRules", "virtualNetworkRules"), + resourceids.UserSpecifiedSegment("virtualNetworkRuleName", "virtualNetworkRuleValue"), + } +} + +// String returns a human-readable description of this Virtual Network Rule ID +func (id VirtualNetworkRuleId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Server Name: %q", id.ServerName), + fmt.Sprintf("Virtual Network Rule Name: %q", id.VirtualNetworkRuleName), + } + return fmt.Sprintf("Virtual Network Rule (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_createorupdate_autorest.go new file mode 100644 index 0000000000000..1246bc0f90f16 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package virtualnetworkrules + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkRuleId, input VirtualNetworkRule) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VirtualNetworkRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkRuleId, input VirtualNetworkRule) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c VirtualNetworkRulesClient) preparerForCreateOrUpdate(ctx context.Context, id VirtualNetworkRuleId, input VirtualNetworkRule) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualNetworkRulesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_delete_autorest.go new file mode 100644 index 0000000000000..631aa2a88565f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_delete_autorest.go @@ -0,0 +1,78 @@ +package virtualnetworkrules + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c VirtualNetworkRulesClient) Delete(ctx context.Context, id VirtualNetworkRuleId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c VirtualNetworkRulesClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkRuleId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c VirtualNetworkRulesClient) preparerForDelete(ctx context.Context, id VirtualNetworkRuleId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c VirtualNetworkRulesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_get_autorest.go new file mode 100644 index 0000000000000..f105c5887a749 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_get_autorest.go @@ -0,0 +1,68 @@ +package virtualnetworkrules + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *VirtualNetworkRule +} + +// Get ... +func (c VirtualNetworkRulesClient) Get(ctx context.Context, id VirtualNetworkRuleId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c VirtualNetworkRulesClient) preparerForGet(ctx context.Context, id VirtualNetworkRuleId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c VirtualNetworkRulesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_listbyserver_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_listbyserver_autorest.go new file mode 100644 index 0000000000000..73136508fcb4b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/method_listbyserver_autorest.go @@ -0,0 +1,186 @@ +package virtualnetworkrules + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByServerOperationResponse struct { + HttpResponse *http.Response + Model *[]VirtualNetworkRule + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListByServerOperationResponse, error) +} + +type ListByServerCompleteResult struct { + Items []VirtualNetworkRule +} + +func (r ListByServerOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListByServerOperationResponse) LoadMore(ctx context.Context) (resp ListByServerOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// ListByServer ... +func (c VirtualNetworkRulesClient) ListByServer(ctx context.Context, id ServerId) (resp ListByServerOperationResponse, err error) { + req, err := c.preparerForListByServer(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "ListByServer", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListByServer(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "ListByServer", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListByServer prepares the ListByServer request. +func (c VirtualNetworkRulesClient) preparerForListByServer(ctx context.Context, id ServerId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/virtualNetworkRules", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListByServerWithNextLink prepares the ListByServer request with the given nextLink token. +func (c VirtualNetworkRulesClient) preparerForListByServerWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByServer handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (c VirtualNetworkRulesClient) responderForListByServer(resp *http.Response) (result ListByServerOperationResponse, err error) { + type page struct { + Values []VirtualNetworkRule `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByServerOperationResponse, err error) { + req, err := c.preparerForListByServerWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "ListByServer", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByServer(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "virtualnetworkrules.VirtualNetworkRulesClient", "ListByServer", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListByServerComplete retrieves all of the results into a single object +func (c VirtualNetworkRulesClient) ListByServerComplete(ctx context.Context, id ServerId) (ListByServerCompleteResult, error) { + return c.ListByServerCompleteMatchingPredicate(ctx, id, VirtualNetworkRuleOperationPredicate{}) +} + +// ListByServerCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c VirtualNetworkRulesClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id ServerId, predicate VirtualNetworkRuleOperationPredicate) (resp ListByServerCompleteResult, err error) { + items := make([]VirtualNetworkRule, 0) + + page, err := c.ListByServer(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListByServerCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/model_virtualnetworkrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/model_virtualnetworkrule.go new file mode 100644 index 0000000000000..16850c4e56f24 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/model_virtualnetworkrule.go @@ -0,0 +1,11 @@ +package virtualnetworkrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkRule struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VirtualNetworkRuleProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/model_virtualnetworkruleproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/model_virtualnetworkruleproperties.go new file mode 100644 index 0000000000000..40e8ec8d24173 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/model_virtualnetworkruleproperties.go @@ -0,0 +1,10 @@ +package virtualnetworkrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkRuleProperties struct { + IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` + State *VirtualNetworkRuleState `json:"state,omitempty"` + VirtualNetworkSubnetId string `json:"virtualNetworkSubnetId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/predicates.go new file mode 100644 index 0000000000000..ef565fb310315 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/predicates.go @@ -0,0 +1,24 @@ +package virtualnetworkrules + +type VirtualNetworkRuleOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p VirtualNetworkRuleOperationPredicate) Matches(input VirtualNetworkRule) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/version.go new file mode 100644 index 0000000000000..0e53377c7b583 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules/version.go @@ -0,0 +1,12 @@ +package virtualnetworkrules + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2018-06-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkrules/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/README.md deleted file mode 100644 index 5f22f8cc44994..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/README.md +++ /dev/null @@ -1,241 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights` Documentation - -The `operationalinsights` SDK allows for interaction with the Azure Resource Manager Service `operationalinsights` (API Version `2019-09-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights" -``` - - -### Client Initialization - -```go -client := operationalinsights.NewOperationalInsightsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `OperationalInsightsClient.QueriesDelete` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueriesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue", "idValue") - -read, err := client.QueriesDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OperationalInsightsClient.QueriesGet` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueriesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue", "idValue") - -read, err := client.QueriesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OperationalInsightsClient.QueriesList` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") - -// alternatively `client.QueriesList(ctx, id, operationalinsights.DefaultQueriesListOperationOptions())` can be used to do batched pagination -items, err := client.QueriesListComplete(ctx, id, operationalinsights.DefaultQueriesListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `OperationalInsightsClient.QueriesPut` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueriesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue", "idValue") - -payload := operationalinsights.LogAnalyticsQueryPackQuery{ - // ... -} - - -read, err := client.QueriesPut(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OperationalInsightsClient.QueriesSearch` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") - -payload := operationalinsights.LogAnalyticsQueryPackQuerySearchProperties{ - // ... -} - - -// alternatively `client.QueriesSearch(ctx, id, payload, operationalinsights.DefaultQueriesSearchOperationOptions())` can be used to do batched pagination -items, err := client.QueriesSearchComplete(ctx, id, payload, operationalinsights.DefaultQueriesSearchOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `OperationalInsightsClient.QueriesUpdate` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueriesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue", "idValue") - -payload := operationalinsights.LogAnalyticsQueryPackQuery{ - // ... -} - - -read, err := client.QueriesUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OperationalInsightsClient.QueryPacksCreateOrUpdate` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") - -payload := operationalinsights.LogAnalyticsQueryPack{ - // ... -} - - -read, err := client.QueryPacksCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OperationalInsightsClient.QueryPacksDelete` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") - -read, err := client.QueryPacksDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OperationalInsightsClient.QueryPacksGet` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") - -read, err := client.QueryPacksGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OperationalInsightsClient.QueryPacksList` - -```go -ctx := context.TODO() -id := operationalinsights.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.QueryPacksList(ctx, id)` can be used to do batched pagination -items, err := client.QueryPacksListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `OperationalInsightsClient.QueryPacksListByResourceGroup` - -```go -ctx := context.TODO() -id := operationalinsights.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.QueryPacksListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.QueryPacksListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `OperationalInsightsClient.QueryPacksUpdateTags` - -```go -ctx := context.TODO() -id := operationalinsights.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") - -payload := operationalinsights.TagsResource{ - // ... -} - - -read, err := client.QueryPacksUpdateTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/id_queries.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/id_queries.go deleted file mode 100644 index 55cbdcc5b4d96..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/id_queries.go +++ /dev/null @@ -1,137 +0,0 @@ -package operationalinsights - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = QueriesId{} - -// QueriesId is a struct representing the Resource ID for a Queries -type QueriesId struct { - SubscriptionId string - ResourceGroupName string - QueryPackName string - Id string -} - -// NewQueriesID returns a new QueriesId struct -func NewQueriesID(subscriptionId string, resourceGroupName string, queryPackName string, id string) QueriesId { - return QueriesId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - QueryPackName: queryPackName, - Id: id, - } -} - -// ParseQueriesID parses 'input' into a QueriesId -func ParseQueriesID(input string) (*QueriesId, error) { - parser := resourceids.NewParserFromResourceIdType(QueriesId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := QueriesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.QueryPackName, ok = parsed.Parsed["queryPackName"]; !ok { - return nil, fmt.Errorf("the segment 'queryPackName' was not found in the resource id %q", input) - } - - if id.Id, ok = parsed.Parsed["id"]; !ok { - return nil, fmt.Errorf("the segment 'id' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseQueriesIDInsensitively parses 'input' case-insensitively into a QueriesId -// note: this method should only be used for API response data and not user input -func ParseQueriesIDInsensitively(input string) (*QueriesId, error) { - parser := resourceids.NewParserFromResourceIdType(QueriesId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := QueriesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.QueryPackName, ok = parsed.Parsed["queryPackName"]; !ok { - return nil, fmt.Errorf("the segment 'queryPackName' was not found in the resource id %q", input) - } - - if id.Id, ok = parsed.Parsed["id"]; !ok { - return nil, fmt.Errorf("the segment 'id' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateQueriesID checks that 'input' can be parsed as a Queries ID -func ValidateQueriesID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseQueriesID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Queries ID -func (id QueriesId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/queryPacks/%s/queries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.QueryPackName, id.Id) -} - -// Segments returns a slice of Resource ID Segments which comprise this Queries ID -func (id QueriesId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticQueryPacks", "queryPacks", "queryPacks"), - resourceids.UserSpecifiedSegment("queryPackName", "queryPackValue"), - resourceids.StaticSegment("staticQueries", "queries", "queries"), - resourceids.UserSpecifiedSegment("id", "idValue"), - } -} - -// String returns a human-readable description of this Queries ID -func (id QueriesId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Query Pack Name: %q", id.QueryPackName), - fmt.Sprintf(": %q", id.Id), - } - return fmt.Sprintf("Queries (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesdelete_autorest.go deleted file mode 100644 index ff77bba640d58..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesdelete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package operationalinsights - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueriesDeleteOperationResponse struct { - HttpResponse *http.Response -} - -// QueriesDelete ... -func (c OperationalInsightsClient) QueriesDelete(ctx context.Context, id QueriesId) (result QueriesDeleteOperationResponse, err error) { - req, err := c.preparerForQueriesDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesDelete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesDelete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForQueriesDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesDelete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForQueriesDelete prepares the QueriesDelete request. -func (c OperationalInsightsClient) preparerForQueriesDelete(ctx context.Context, id QueriesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForQueriesDelete handles the response to the QueriesDelete request. The method always -// closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueriesDelete(resp *http.Response) (result QueriesDeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesget_autorest.go deleted file mode 100644 index 6074fb6323c01..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesget_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package operationalinsights - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueriesGetOperationResponse struct { - HttpResponse *http.Response - Model *LogAnalyticsQueryPackQuery -} - -// QueriesGet ... -func (c OperationalInsightsClient) QueriesGet(ctx context.Context, id QueriesId) (result QueriesGetOperationResponse, err error) { - req, err := c.preparerForQueriesGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForQueriesGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForQueriesGet prepares the QueriesGet request. -func (c OperationalInsightsClient) preparerForQueriesGet(ctx context.Context, id QueriesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForQueriesGet handles the response to the QueriesGet request. The method always -// closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueriesGet(resp *http.Response) (result QueriesGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querieslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querieslist_autorest.go deleted file mode 100644 index c20f9c4a84d30..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querieslist_autorest.go +++ /dev/null @@ -1,220 +0,0 @@ -package operationalinsights - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueriesListOperationResponse struct { - HttpResponse *http.Response - Model *[]LogAnalyticsQueryPackQuery - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (QueriesListOperationResponse, error) -} - -type QueriesListCompleteResult struct { - Items []LogAnalyticsQueryPackQuery -} - -func (r QueriesListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r QueriesListOperationResponse) LoadMore(ctx context.Context) (resp QueriesListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type QueriesListOperationOptions struct { - IncludeBody *bool - Top *int64 -} - -func DefaultQueriesListOperationOptions() QueriesListOperationOptions { - return QueriesListOperationOptions{} -} - -func (o QueriesListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o QueriesListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.IncludeBody != nil { - out["includeBody"] = *o.IncludeBody - } - - if o.Top != nil { - out["$top"] = *o.Top - } - - return out -} - -// QueriesList ... -func (c OperationalInsightsClient) QueriesList(ctx context.Context, id QueryPackId, options QueriesListOperationOptions) (resp QueriesListOperationResponse, err error) { - req, err := c.preparerForQueriesList(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForQueriesList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForQueriesList prepares the QueriesList request. -func (c OperationalInsightsClient) preparerForQueriesList(ctx context.Context, id QueryPackId, options QueriesListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/queries", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForQueriesListWithNextLink prepares the QueriesList request with the given nextLink token. -func (c OperationalInsightsClient) preparerForQueriesListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForQueriesList handles the response to the QueriesList request. The method always -// closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueriesList(resp *http.Response) (result QueriesListOperationResponse, err error) { - type page struct { - Values []LogAnalyticsQueryPackQuery `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result QueriesListOperationResponse, err error) { - req, err := c.preparerForQueriesListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForQueriesList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// QueriesListComplete retrieves all of the results into a single object -func (c OperationalInsightsClient) QueriesListComplete(ctx context.Context, id QueryPackId, options QueriesListOperationOptions) (QueriesListCompleteResult, error) { - return c.QueriesListCompleteMatchingPredicate(ctx, id, options, LogAnalyticsQueryPackQueryOperationPredicate{}) -} - -// QueriesListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c OperationalInsightsClient) QueriesListCompleteMatchingPredicate(ctx context.Context, id QueryPackId, options QueriesListOperationOptions, predicate LogAnalyticsQueryPackQueryOperationPredicate) (resp QueriesListCompleteResult, err error) { - items := make([]LogAnalyticsQueryPackQuery, 0) - - page, err := c.QueriesList(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := QueriesListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesput_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesput_autorest.go deleted file mode 100644 index 6a355132a65aa..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesput_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package operationalinsights - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueriesPutOperationResponse struct { - HttpResponse *http.Response - Model *LogAnalyticsQueryPackQuery -} - -// QueriesPut ... -func (c OperationalInsightsClient) QueriesPut(ctx context.Context, id QueriesId, input LogAnalyticsQueryPackQuery) (result QueriesPutOperationResponse, err error) { - req, err := c.preparerForQueriesPut(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesPut", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesPut", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForQueriesPut(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesPut", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForQueriesPut prepares the QueriesPut request. -func (c OperationalInsightsClient) preparerForQueriesPut(ctx context.Context, id QueriesId, input LogAnalyticsQueryPackQuery) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForQueriesPut handles the response to the QueriesPut request. The method always -// closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueriesPut(resp *http.Response) (result QueriesPutOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriessearch_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriessearch_autorest.go deleted file mode 100644 index 3c9029e17dd39..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriessearch_autorest.go +++ /dev/null @@ -1,221 +0,0 @@ -package operationalinsights - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueriesSearchOperationResponse struct { - HttpResponse *http.Response - Model *[]LogAnalyticsQueryPackQuery - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (QueriesSearchOperationResponse, error) -} - -type QueriesSearchCompleteResult struct { - Items []LogAnalyticsQueryPackQuery -} - -func (r QueriesSearchOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r QueriesSearchOperationResponse) LoadMore(ctx context.Context) (resp QueriesSearchOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type QueriesSearchOperationOptions struct { - IncludeBody *bool - Top *int64 -} - -func DefaultQueriesSearchOperationOptions() QueriesSearchOperationOptions { - return QueriesSearchOperationOptions{} -} - -func (o QueriesSearchOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o QueriesSearchOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.IncludeBody != nil { - out["includeBody"] = *o.IncludeBody - } - - if o.Top != nil { - out["$top"] = *o.Top - } - - return out -} - -// QueriesSearch ... -func (c OperationalInsightsClient) QueriesSearch(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPackQuerySearchProperties, options QueriesSearchOperationOptions) (resp QueriesSearchOperationResponse, err error) { - req, err := c.preparerForQueriesSearch(ctx, id, input, options) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesSearch", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesSearch", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForQueriesSearch(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesSearch", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForQueriesSearch prepares the QueriesSearch request. -func (c OperationalInsightsClient) preparerForQueriesSearch(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPackQuerySearchProperties, options QueriesSearchOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/queries/search", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForQueriesSearchWithNextLink prepares the QueriesSearch request with the given nextLink token. -func (c OperationalInsightsClient) preparerForQueriesSearchWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForQueriesSearch handles the response to the QueriesSearch request. The method always -// closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueriesSearch(resp *http.Response) (result QueriesSearchOperationResponse, err error) { - type page struct { - Values []LogAnalyticsQueryPackQuery `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result QueriesSearchOperationResponse, err error) { - req, err := c.preparerForQueriesSearchWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesSearch", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesSearch", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForQueriesSearch(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesSearch", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// QueriesSearchComplete retrieves all of the results into a single object -func (c OperationalInsightsClient) QueriesSearchComplete(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPackQuerySearchProperties, options QueriesSearchOperationOptions) (QueriesSearchCompleteResult, error) { - return c.QueriesSearchCompleteMatchingPredicate(ctx, id, input, options, LogAnalyticsQueryPackQueryOperationPredicate{}) -} - -// QueriesSearchCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c OperationalInsightsClient) QueriesSearchCompleteMatchingPredicate(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPackQuerySearchProperties, options QueriesSearchOperationOptions, predicate LogAnalyticsQueryPackQueryOperationPredicate) (resp QueriesSearchCompleteResult, err error) { - items := make([]LogAnalyticsQueryPackQuery, 0) - - page, err := c.QueriesSearch(ctx, id, input, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := QueriesSearchCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesupdate_autorest.go deleted file mode 100644 index 54d4961be6e91..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_queriesupdate_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package operationalinsights - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueriesUpdateOperationResponse struct { - HttpResponse *http.Response - Model *LogAnalyticsQueryPackQuery -} - -// QueriesUpdate ... -func (c OperationalInsightsClient) QueriesUpdate(ctx context.Context, id QueriesId, input LogAnalyticsQueryPackQuery) (result QueriesUpdateOperationResponse, err error) { - req, err := c.preparerForQueriesUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForQueriesUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueriesUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForQueriesUpdate prepares the QueriesUpdate request. -func (c OperationalInsightsClient) preparerForQueriesUpdate(ctx context.Context, id QueriesId, input LogAnalyticsQueryPackQuery) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForQueriesUpdate handles the response to the QueriesUpdate request. The method always -// closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueriesUpdate(resp *http.Response) (result QueriesUpdateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquery.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquery.go deleted file mode 100644 index 287060b61cc1c..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquery.go +++ /dev/null @@ -1,16 +0,0 @@ -package operationalinsights - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogAnalyticsQueryPackQuery struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LogAnalyticsQueryPackQueryProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackqueryproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackqueryproperties.go deleted file mode 100644 index 879779960ca41..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackqueryproperties.go +++ /dev/null @@ -1,47 +0,0 @@ -package operationalinsights - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogAnalyticsQueryPackQueryProperties struct { - Author *string `json:"author,omitempty"` - Body string `json:"body"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Id *string `json:"id,omitempty"` - Properties *interface{} `json:"properties,omitempty"` - Related *LogAnalyticsQueryPackQueryPropertiesRelated `json:"related,omitempty"` - Tags *map[string][]string `json:"tags,omitempty"` - TimeCreated *string `json:"timeCreated,omitempty"` - TimeModified *string `json:"timeModified,omitempty"` -} - -func (o *LogAnalyticsQueryPackQueryProperties) GetTimeCreatedAsTime() (*time.Time, error) { - if o.TimeCreated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") -} - -func (o *LogAnalyticsQueryPackQueryProperties) SetTimeCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeCreated = &formatted -} - -func (o *LogAnalyticsQueryPackQueryProperties) GetTimeModifiedAsTime() (*time.Time, error) { - if o.TimeModified == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeModified, "2006-01-02T15:04:05Z07:00") -} - -func (o *LogAnalyticsQueryPackQueryProperties) SetTimeModifiedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeModified = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerypropertiesrelated.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerypropertiesrelated.go deleted file mode 100644 index af17f38c40bdb..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerypropertiesrelated.go +++ /dev/null @@ -1,10 +0,0 @@ -package operationalinsights - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogAnalyticsQueryPackQueryPropertiesRelated struct { - Categories *[]string `json:"categories,omitempty"` - ResourceTypes *[]string `json:"resourceTypes,omitempty"` - Solutions *[]string `json:"solutions,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerysearchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerysearchproperties.go deleted file mode 100644 index f801bd037f500..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerysearchproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package operationalinsights - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogAnalyticsQueryPackQuerySearchProperties struct { - Related *LogAnalyticsQueryPackQuerySearchPropertiesRelated `json:"related,omitempty"` - Tags *map[string][]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerysearchpropertiesrelated.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerysearchpropertiesrelated.go deleted file mode 100644 index 77f06e6f257e8..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackquerysearchpropertiesrelated.go +++ /dev/null @@ -1,10 +0,0 @@ -package operationalinsights - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogAnalyticsQueryPackQuerySearchPropertiesRelated struct { - Categories *[]string `json:"categories,omitempty"` - ResourceTypes *[]string `json:"resourceTypes,omitempty"` - Solutions *[]string `json:"solutions,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/README.md new file mode 100644 index 0000000000000..a32e5348f3f27 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/README.md @@ -0,0 +1,128 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks` Documentation + +The `querypacks` SDK allows for interaction with the Azure Resource Manager Service `operationalinsights` (API Version `2019-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks" +``` + + +### Client Initialization + +```go +client := querypacks.NewQueryPacksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `QueryPacksClient.QueryPacksCreateOrUpdate` + +```go +ctx := context.TODO() +id := querypacks.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") + +payload := querypacks.LogAnalyticsQueryPack{ + // ... +} + + +read, err := client.QueryPacksCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `QueryPacksClient.QueryPacksDelete` + +```go +ctx := context.TODO() +id := querypacks.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") + +read, err := client.QueryPacksDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `QueryPacksClient.QueryPacksGet` + +```go +ctx := context.TODO() +id := querypacks.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") + +read, err := client.QueryPacksGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `QueryPacksClient.QueryPacksList` + +```go +ctx := context.TODO() +id := querypacks.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.QueryPacksList(ctx, id)` can be used to do batched pagination +items, err := client.QueryPacksListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `QueryPacksClient.QueryPacksListByResourceGroup` + +```go +ctx := context.TODO() +id := querypacks.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.QueryPacksListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.QueryPacksListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `QueryPacksClient.QueryPacksUpdateTags` + +```go +ctx := context.TODO() +id := querypacks.NewQueryPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackValue") + +payload := querypacks.TagsResource{ + // ... +} + + +read, err := client.QueryPacksUpdateTags(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/client.go new file mode 100644 index 0000000000000..9dca658ee8e34 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/client.go @@ -0,0 +1,18 @@ +package querypacks + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryPacksClient struct { + Client autorest.Client + baseUri string +} + +func NewQueryPacksClientWithBaseURI(endpoint string) QueryPacksClient { + return QueryPacksClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/id_querypack.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/id_querypack.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/id_querypack.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/id_querypack.go index b7a249a5c6020..0c395ea666e7e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/id_querypack.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/id_querypack.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackscreateorupdate_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackscreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackscreateorupdate_autorest.go index 2329710d70172..bf9b8ec8aaa94 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackscreateorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackscreateorupdate_autorest.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "context" @@ -17,22 +17,22 @@ type QueryPacksCreateOrUpdateOperationResponse struct { } // QueryPacksCreateOrUpdate ... -func (c OperationalInsightsClient) QueryPacksCreateOrUpdate(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPack) (result QueryPacksCreateOrUpdateOperationResponse, err error) { +func (c QueryPacksClient) QueryPacksCreateOrUpdate(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPack) (result QueryPacksCreateOrUpdateOperationResponse, err error) { req, err := c.preparerForQueryPacksCreateOrUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksCreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksCreateOrUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksCreateOrUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksCreateOrUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForQueryPacksCreateOrUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksCreateOrUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksCreateOrUpdate", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c OperationalInsightsClient) QueryPacksCreateOrUpdate(ctx context.Context, } // preparerForQueryPacksCreateOrUpdate prepares the QueryPacksCreateOrUpdate request. -func (c OperationalInsightsClient) preparerForQueryPacksCreateOrUpdate(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPack) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksCreateOrUpdate(ctx context.Context, id QueryPackId, input LogAnalyticsQueryPack) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksCreateOrUpdate(ctx conte // responderForQueryPacksCreateOrUpdate handles the response to the QueryPacksCreateOrUpdate request. The method always // closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueryPacksCreateOrUpdate(resp *http.Response) (result QueryPacksCreateOrUpdateOperationResponse, err error) { +func (c QueryPacksClient) responderForQueryPacksCreateOrUpdate(resp *http.Response) (result QueryPacksCreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksdelete_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksdelete_autorest.go index 8f5f7a9848322..d3ac8488cbe6b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksdelete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksdelete_autorest.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "context" @@ -16,22 +16,22 @@ type QueryPacksDeleteOperationResponse struct { } // QueryPacksDelete ... -func (c OperationalInsightsClient) QueryPacksDelete(ctx context.Context, id QueryPackId) (result QueryPacksDeleteOperationResponse, err error) { +func (c QueryPacksClient) QueryPacksDelete(ctx context.Context, id QueryPackId) (result QueryPacksDeleteOperationResponse, err error) { req, err := c.preparerForQueryPacksDelete(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksDelete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksDelete", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksDelete", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksDelete", result.HttpResponse, "Failure sending request") return } result, err = c.responderForQueryPacksDelete(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksDelete", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksDelete", result.HttpResponse, "Failure responding to request") return } @@ -39,7 +39,7 @@ func (c OperationalInsightsClient) QueryPacksDelete(ctx context.Context, id Quer } // preparerForQueryPacksDelete prepares the QueryPacksDelete request. -func (c OperationalInsightsClient) preparerForQueryPacksDelete(ctx context.Context, id QueryPackId) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksDelete(ctx context.Context, id QueryPackId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -55,7 +55,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksDelete(ctx context.Conte // responderForQueryPacksDelete handles the response to the QueryPacksDelete request. The method always // closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueryPacksDelete(resp *http.Response) (result QueryPacksDeleteOperationResponse, err error) { +func (c QueryPacksClient) responderForQueryPacksDelete(resp *http.Response) (result QueryPacksDeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksget_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksget_autorest.go index 9beed201713fa..813cfcc911fc6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksget_autorest.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "context" @@ -17,22 +17,22 @@ type QueryPacksGetOperationResponse struct { } // QueryPacksGet ... -func (c OperationalInsightsClient) QueryPacksGet(ctx context.Context, id QueryPackId) (result QueryPacksGetOperationResponse, err error) { +func (c QueryPacksClient) QueryPacksGet(ctx context.Context, id QueryPackId) (result QueryPacksGetOperationResponse, err error) { req, err := c.preparerForQueryPacksGet(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksGet", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksGet", result.HttpResponse, "Failure sending request") return } result, err = c.responderForQueryPacksGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksGet", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c OperationalInsightsClient) QueryPacksGet(ctx context.Context, id QueryPa } // preparerForQueryPacksGet prepares the QueryPacksGet request. -func (c OperationalInsightsClient) preparerForQueryPacksGet(ctx context.Context, id QueryPackId) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksGet(ctx context.Context, id QueryPackId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksGet(ctx context.Context, // responderForQueryPacksGet handles the response to the QueryPacksGet request. The method always // closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueryPacksGet(resp *http.Response) (result QueryPacksGetOperationResponse, err error) { +func (c QueryPacksClient) responderForQueryPacksGet(resp *http.Response) (result QueryPacksGetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackslist_autorest.go similarity index 70% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackslist_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackslist_autorest.go index 5da696c35e74a..b7f9faa72b9ce 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackslist_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackslist_autorest.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "context" @@ -39,29 +39,29 @@ func (r QueryPacksListOperationResponse) LoadMore(ctx context.Context) (resp Que } // QueryPacksList ... -func (c OperationalInsightsClient) QueryPacksList(ctx context.Context, id commonids.SubscriptionId) (resp QueryPacksListOperationResponse, err error) { +func (c QueryPacksClient) QueryPacksList(ctx context.Context, id commonids.SubscriptionId) (resp QueryPacksListOperationResponse, err error) { req, err := c.preparerForQueryPacksList(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksList", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksList", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksList", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksList", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForQueryPacksList(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksList", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksList", resp.HttpResponse, "Failure responding to request") return } return } // preparerForQueryPacksList prepares the QueryPacksList request. -func (c OperationalInsightsClient) preparerForQueryPacksList(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksList(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -76,7 +76,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksList(ctx context.Context } // preparerForQueryPacksListWithNextLink prepares the QueryPacksList request with the given nextLink token. -func (c OperationalInsightsClient) preparerForQueryPacksListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -102,7 +102,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksListWithNextLink(ctx con // responderForQueryPacksList handles the response to the QueryPacksList request. The method always // closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueryPacksList(resp *http.Response) (result QueryPacksListOperationResponse, err error) { +func (c QueryPacksClient) responderForQueryPacksList(resp *http.Response) (result QueryPacksListOperationResponse, err error) { type page struct { Values []LogAnalyticsQueryPack `json:"value"` NextLink *string `json:"nextLink"` @@ -120,19 +120,19 @@ func (c OperationalInsightsClient) responderForQueryPacksList(resp *http.Respons result.nextPageFunc = func(ctx context.Context, nextLink string) (result QueryPacksListOperationResponse, err error) { req, err := c.preparerForQueryPacksListWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksList", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksList", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksList", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksList", result.HttpResponse, "Failure sending request") return } result, err = c.responderForQueryPacksList(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksList", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksList", result.HttpResponse, "Failure responding to request") return } @@ -143,12 +143,12 @@ func (c OperationalInsightsClient) responderForQueryPacksList(resp *http.Respons } // QueryPacksListComplete retrieves all of the results into a single object -func (c OperationalInsightsClient) QueryPacksListComplete(ctx context.Context, id commonids.SubscriptionId) (QueryPacksListCompleteResult, error) { +func (c QueryPacksClient) QueryPacksListComplete(ctx context.Context, id commonids.SubscriptionId) (QueryPacksListCompleteResult, error) { return c.QueryPacksListCompleteMatchingPredicate(ctx, id, LogAnalyticsQueryPackOperationPredicate{}) } // QueryPacksListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c OperationalInsightsClient) QueryPacksListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LogAnalyticsQueryPackOperationPredicate) (resp QueryPacksListCompleteResult, err error) { +func (c QueryPacksClient) QueryPacksListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LogAnalyticsQueryPackOperationPredicate) (resp QueryPacksListCompleteResult, err error) { items := make([]LogAnalyticsQueryPack, 0) page, err := c.QueryPacksList(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackslistbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackslistbyresourcegroup_autorest.go similarity index 69% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackslistbyresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackslistbyresourcegroup_autorest.go index ed95d3779b060..00ee03ac370d0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypackslistbyresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypackslistbyresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "context" @@ -39,29 +39,29 @@ func (r QueryPacksListByResourceGroupOperationResponse) LoadMore(ctx context.Con } // QueryPacksListByResourceGroup ... -func (c OperationalInsightsClient) QueryPacksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp QueryPacksListByResourceGroupOperationResponse, err error) { +func (c QueryPacksClient) QueryPacksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (resp QueryPacksListByResourceGroupOperationResponse, err error) { req, err := c.preparerForQueryPacksListByResourceGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksListByResourceGroup", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksListByResourceGroup", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksListByResourceGroup", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForQueryPacksListByResourceGroup(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksListByResourceGroup", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksListByResourceGroup", resp.HttpResponse, "Failure responding to request") return } return } // preparerForQueryPacksListByResourceGroup prepares the QueryPacksListByResourceGroup request. -func (c OperationalInsightsClient) preparerForQueryPacksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -76,7 +76,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksListByResourceGroup(ctx } // preparerForQueryPacksListByResourceGroupWithNextLink prepares the QueryPacksListByResourceGroup request with the given nextLink token. -func (c OperationalInsightsClient) preparerForQueryPacksListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -102,7 +102,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksListByResourceGroupWithN // responderForQueryPacksListByResourceGroup handles the response to the QueryPacksListByResourceGroup request. The method always // closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueryPacksListByResourceGroup(resp *http.Response) (result QueryPacksListByResourceGroupOperationResponse, err error) { +func (c QueryPacksClient) responderForQueryPacksListByResourceGroup(resp *http.Response) (result QueryPacksListByResourceGroupOperationResponse, err error) { type page struct { Values []LogAnalyticsQueryPack `json:"value"` NextLink *string `json:"nextLink"` @@ -120,19 +120,19 @@ func (c OperationalInsightsClient) responderForQueryPacksListByResourceGroup(res result.nextPageFunc = func(ctx context.Context, nextLink string) (result QueryPacksListByResourceGroupOperationResponse, err error) { req, err := c.preparerForQueryPacksListByResourceGroupWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksListByResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksListByResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksListByResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForQueryPacksListByResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksListByResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksListByResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -143,12 +143,12 @@ func (c OperationalInsightsClient) responderForQueryPacksListByResourceGroup(res } // QueryPacksListByResourceGroupComplete retrieves all of the results into a single object -func (c OperationalInsightsClient) QueryPacksListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (QueryPacksListByResourceGroupCompleteResult, error) { +func (c QueryPacksClient) QueryPacksListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (QueryPacksListByResourceGroupCompleteResult, error) { return c.QueryPacksListByResourceGroupCompleteMatchingPredicate(ctx, id, LogAnalyticsQueryPackOperationPredicate{}) } // QueryPacksListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c OperationalInsightsClient) QueryPacksListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LogAnalyticsQueryPackOperationPredicate) (resp QueryPacksListByResourceGroupCompleteResult, err error) { +func (c QueryPacksClient) QueryPacksListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LogAnalyticsQueryPackOperationPredicate) (resp QueryPacksListByResourceGroupCompleteResult, err error) { items := make([]LogAnalyticsQueryPack, 0) page, err := c.QueryPacksListByResourceGroup(ctx, id) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksupdatetags_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksupdatetags_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksupdatetags_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksupdatetags_autorest.go index edfebc83191db..f35013ff45ca0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/method_querypacksupdatetags_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/method_querypacksupdatetags_autorest.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "context" @@ -17,22 +17,22 @@ type QueryPacksUpdateTagsOperationResponse struct { } // QueryPacksUpdateTags ... -func (c OperationalInsightsClient) QueryPacksUpdateTags(ctx context.Context, id QueryPackId, input TagsResource) (result QueryPacksUpdateTagsOperationResponse, err error) { +func (c QueryPacksClient) QueryPacksUpdateTags(ctx context.Context, id QueryPackId, input TagsResource) (result QueryPacksUpdateTagsOperationResponse, err error) { req, err := c.preparerForQueryPacksUpdateTags(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksUpdateTags", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksUpdateTags", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksUpdateTags", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksUpdateTags", result.HttpResponse, "Failure sending request") return } result, err = c.responderForQueryPacksUpdateTags(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.OperationalInsightsClient", "QueryPacksUpdateTags", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "querypacks.QueryPacksClient", "QueryPacksUpdateTags", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c OperationalInsightsClient) QueryPacksUpdateTags(ctx context.Context, id } // preparerForQueryPacksUpdateTags prepares the QueryPacksUpdateTags request. -func (c OperationalInsightsClient) preparerForQueryPacksUpdateTags(ctx context.Context, id QueryPackId, input TagsResource) (*http.Request, error) { +func (c QueryPacksClient) preparerForQueryPacksUpdateTags(ctx context.Context, id QueryPackId, input TagsResource) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c OperationalInsightsClient) preparerForQueryPacksUpdateTags(ctx context.C // responderForQueryPacksUpdateTags handles the response to the QueryPacksUpdateTags request. The method always // closes the http.Response Body. -func (c OperationalInsightsClient) responderForQueryPacksUpdateTags(resp *http.Response) (result QueryPacksUpdateTagsOperationResponse, err error) { +func (c QueryPacksClient) responderForQueryPacksUpdateTags(resp *http.Response) (result QueryPacksUpdateTagsOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypack.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_loganalyticsquerypack.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypack.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_loganalyticsquerypack.go index e57399848453e..0faa1ce1c0773 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypack.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_loganalyticsquerypack.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_loganalyticsquerypackproperties.go similarity index 97% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_loganalyticsquerypackproperties.go index 1f1a23095fb32..772445a81e855 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_loganalyticsquerypackproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_loganalyticsquerypackproperties.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import ( "time" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_tagsresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_tagsresource.go similarity index 89% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_tagsresource.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_tagsresource.go index a3a35998071c6..7fdf7eeb6c588 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/model_tagsresource.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/model_tagsresource.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/predicates.go similarity index 52% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/predicates.go index 510b201b5b1d3..93dd8980851a8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/predicates.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/predicates.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks type LogAnalyticsQueryPackOperationPredicate struct { Id *string @@ -27,26 +27,3 @@ func (p LogAnalyticsQueryPackOperationPredicate) Matches(input LogAnalyticsQuery return true } - -type LogAnalyticsQueryPackQueryOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p LogAnalyticsQueryPackQueryOperationPredicate) Matches(input LogAnalyticsQueryPackQuery) bool { - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/version.go similarity index 67% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/version.go index c3778597984a2..a95b1f7465c40 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks/version.go @@ -1,4 +1,4 @@ -package operationalinsights +package querypacks import "fmt" @@ -8,5 +8,5 @@ import "fmt" const defaultApiVersion = "2019-09-01" func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/operationalinsights/%s", defaultApiVersion) + return fmt.Sprintf("hashicorp/go-azure-sdk/querypacks/%s", defaultApiVersion) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/README.md deleted file mode 100644 index 09ad4621f0ef2..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/README.md +++ /dev/null @@ -1,432 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights` Documentation - -The `policyinsights` SDK allows for interaction with the Azure Resource Manager Service `policyinsights` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights" -``` - - -### Client Initialization - -```go -client := policyinsights.NewPolicyInsightsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCancelAtManagementGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") - -read, err := client.RemediationsCancelAtManagementGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCancelAtResource` - -```go -ctx := context.TODO() -id := policyinsights.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") - -read, err := client.RemediationsCancelAtResource(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCancelAtResourceGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") - -read, err := client.RemediationsCancelAtResourceGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCancelAtSubscription` - -```go -ctx := context.TODO() -id := policyinsights.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") - -read, err := client.RemediationsCancelAtSubscription(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCreateOrUpdateAtManagementGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") - -payload := policyinsights.Remediation{ - // ... -} - - -read, err := client.RemediationsCreateOrUpdateAtManagementGroup(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCreateOrUpdateAtResource` - -```go -ctx := context.TODO() -id := policyinsights.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") - -payload := policyinsights.Remediation{ - // ... -} - - -read, err := client.RemediationsCreateOrUpdateAtResource(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCreateOrUpdateAtResourceGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") - -payload := policyinsights.Remediation{ - // ... -} - - -read, err := client.RemediationsCreateOrUpdateAtResourceGroup(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsCreateOrUpdateAtSubscription` - -```go -ctx := context.TODO() -id := policyinsights.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") - -payload := policyinsights.Remediation{ - // ... -} - - -read, err := client.RemediationsCreateOrUpdateAtSubscription(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsDeleteAtManagementGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") - -read, err := client.RemediationsDeleteAtManagementGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsDeleteAtResource` - -```go -ctx := context.TODO() -id := policyinsights.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") - -read, err := client.RemediationsDeleteAtResource(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsDeleteAtResourceGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") - -read, err := client.RemediationsDeleteAtResourceGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsDeleteAtSubscription` - -```go -ctx := context.TODO() -id := policyinsights.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") - -read, err := client.RemediationsDeleteAtSubscription(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsGetAtManagementGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") - -read, err := client.RemediationsGetAtManagementGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsGetAtResource` - -```go -ctx := context.TODO() -id := policyinsights.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") - -read, err := client.RemediationsGetAtResource(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsGetAtResourceGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") - -read, err := client.RemediationsGetAtResourceGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsGetAtSubscription` - -```go -ctx := context.TODO() -id := policyinsights.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") - -read, err := client.RemediationsGetAtSubscription(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListDeploymentsAtManagementGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") - -// alternatively `client.RemediationsListDeploymentsAtManagementGroup(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtManagementGroupOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListDeploymentsAtManagementGroupComplete(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtManagementGroupOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListDeploymentsAtResource` - -```go -ctx := context.TODO() -id := policyinsights.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") - -// alternatively `client.RemediationsListDeploymentsAtResource(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtResourceOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListDeploymentsAtResourceComplete(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtResourceOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListDeploymentsAtResourceGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") - -// alternatively `client.RemediationsListDeploymentsAtResourceGroup(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtResourceGroupOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListDeploymentsAtResourceGroupComplete(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtResourceGroupOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListDeploymentsAtSubscription` - -```go -ctx := context.TODO() -id := policyinsights.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") - -// alternatively `client.RemediationsListDeploymentsAtSubscription(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtSubscriptionOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListDeploymentsAtSubscriptionComplete(ctx, id, policyinsights.DefaultRemediationsListDeploymentsAtSubscriptionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListForManagementGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewManagementGroupID("managementGroupIdValue") - -// alternatively `client.RemediationsListForManagementGroup(ctx, id, policyinsights.DefaultRemediationsListForManagementGroupOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListForManagementGroupComplete(ctx, id, policyinsights.DefaultRemediationsListForManagementGroupOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListForResource` - -```go -ctx := context.TODO() -id := policyinsights.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// alternatively `client.RemediationsListForResource(ctx, id, policyinsights.DefaultRemediationsListForResourceOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListForResourceComplete(ctx, id, policyinsights.DefaultRemediationsListForResourceOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListForResourceGroup` - -```go -ctx := context.TODO() -id := policyinsights.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.RemediationsListForResourceGroup(ctx, id, policyinsights.DefaultRemediationsListForResourceGroupOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListForResourceGroupComplete(ctx, id, policyinsights.DefaultRemediationsListForResourceGroupOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PolicyInsightsClient.RemediationsListForSubscription` - -```go -ctx := context.TODO() -id := policyinsights.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.RemediationsListForSubscription(ctx, id, policyinsights.DefaultRemediationsListForSubscriptionOperationOptions())` can be used to do batched pagination -items, err := client.RemediationsListForSubscriptionComplete(ctx, id, policyinsights.DefaultRemediationsListForSubscriptionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/README.md new file mode 100644 index 0000000000000..5e27d94b3b606 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/README.md @@ -0,0 +1,432 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations` Documentation + +The `remediations` SDK allows for interaction with the Azure Resource Manager Service `policyinsights` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations" +``` + + +### Client Initialization + +```go +client := remediations.NewRemediationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RemediationsClient.RemediationsCancelAtManagementGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") + +read, err := client.RemediationsCancelAtManagementGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsCancelAtResource` + +```go +ctx := context.TODO() +id := remediations.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") + +read, err := client.RemediationsCancelAtResource(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsCancelAtResourceGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") + +read, err := client.RemediationsCancelAtResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsCancelAtSubscription` + +```go +ctx := context.TODO() +id := remediations.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") + +read, err := client.RemediationsCancelAtSubscription(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsCreateOrUpdateAtManagementGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") + +payload := remediations.Remediation{ + // ... +} + + +read, err := client.RemediationsCreateOrUpdateAtManagementGroup(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsCreateOrUpdateAtResource` + +```go +ctx := context.TODO() +id := remediations.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") + +payload := remediations.Remediation{ + // ... +} + + +read, err := client.RemediationsCreateOrUpdateAtResource(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsCreateOrUpdateAtResourceGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") + +payload := remediations.Remediation{ + // ... +} + + +read, err := client.RemediationsCreateOrUpdateAtResourceGroup(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsCreateOrUpdateAtSubscription` + +```go +ctx := context.TODO() +id := remediations.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") + +payload := remediations.Remediation{ + // ... +} + + +read, err := client.RemediationsCreateOrUpdateAtSubscription(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsDeleteAtManagementGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") + +read, err := client.RemediationsDeleteAtManagementGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsDeleteAtResource` + +```go +ctx := context.TODO() +id := remediations.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") + +read, err := client.RemediationsDeleteAtResource(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsDeleteAtResourceGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") + +read, err := client.RemediationsDeleteAtResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsDeleteAtSubscription` + +```go +ctx := context.TODO() +id := remediations.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") + +read, err := client.RemediationsDeleteAtSubscription(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsGetAtManagementGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") + +read, err := client.RemediationsGetAtManagementGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsGetAtResource` + +```go +ctx := context.TODO() +id := remediations.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") + +read, err := client.RemediationsGetAtResource(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsGetAtResourceGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") + +read, err := client.RemediationsGetAtResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsGetAtSubscription` + +```go +ctx := context.TODO() +id := remediations.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") + +read, err := client.RemediationsGetAtSubscription(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListDeploymentsAtManagementGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviders2RemediationID("managementGroupIdValue", "remediationValue") + +// alternatively `client.RemediationsListDeploymentsAtManagementGroup(ctx, id, remediations.DefaultRemediationsListDeploymentsAtManagementGroupOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListDeploymentsAtManagementGroupComplete(ctx, id, remediations.DefaultRemediationsListDeploymentsAtManagementGroupOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListDeploymentsAtResource` + +```go +ctx := context.TODO() +id := remediations.NewScopedRemediationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "remediationValue") + +// alternatively `client.RemediationsListDeploymentsAtResource(ctx, id, remediations.DefaultRemediationsListDeploymentsAtResourceOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListDeploymentsAtResourceComplete(ctx, id, remediations.DefaultRemediationsListDeploymentsAtResourceOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListDeploymentsAtResourceGroup` + +```go +ctx := context.TODO() +id := remediations.NewProviderRemediationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remediationValue") + +// alternatively `client.RemediationsListDeploymentsAtResourceGroup(ctx, id, remediations.DefaultRemediationsListDeploymentsAtResourceGroupOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListDeploymentsAtResourceGroupComplete(ctx, id, remediations.DefaultRemediationsListDeploymentsAtResourceGroupOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListDeploymentsAtSubscription` + +```go +ctx := context.TODO() +id := remediations.NewRemediationID("12345678-1234-9876-4563-123456789012", "remediationValue") + +// alternatively `client.RemediationsListDeploymentsAtSubscription(ctx, id, remediations.DefaultRemediationsListDeploymentsAtSubscriptionOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListDeploymentsAtSubscriptionComplete(ctx, id, remediations.DefaultRemediationsListDeploymentsAtSubscriptionOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListForManagementGroup` + +```go +ctx := context.TODO() +id := remediations.NewManagementGroupID("managementGroupIdValue") + +// alternatively `client.RemediationsListForManagementGroup(ctx, id, remediations.DefaultRemediationsListForManagementGroupOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListForManagementGroupComplete(ctx, id, remediations.DefaultRemediationsListForManagementGroupOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListForResource` + +```go +ctx := context.TODO() +id := remediations.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.RemediationsListForResource(ctx, id, remediations.DefaultRemediationsListForResourceOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListForResourceComplete(ctx, id, remediations.DefaultRemediationsListForResourceOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListForResourceGroup` + +```go +ctx := context.TODO() +id := remediations.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.RemediationsListForResourceGroup(ctx, id, remediations.DefaultRemediationsListForResourceGroupOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListForResourceGroupComplete(ctx, id, remediations.DefaultRemediationsListForResourceGroupOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RemediationsClient.RemediationsListForSubscription` + +```go +ctx := context.TODO() +id := remediations.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.RemediationsListForSubscription(ctx, id, remediations.DefaultRemediationsListForSubscriptionOperationOptions())` can be used to do batched pagination +items, err := client.RemediationsListForSubscriptionComplete(ctx, id, remediations.DefaultRemediationsListForSubscriptionOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/client.go new file mode 100644 index 0000000000000..d1ad12f4efb2b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/client.go @@ -0,0 +1,18 @@ +package remediations + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemediationsClient struct { + Client autorest.Client + baseUri string +} + +func NewRemediationsClientWithBaseURI(endpoint string) RemediationsClient { + return RemediationsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/constants.go similarity index 97% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/constants.go index 26a1a1a6abe5a..e4b3feb5cd65f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/constants.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import "strings" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_managementgroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_managementgroup.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_managementgroup.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_managementgroup.go index 1f098ef546f40..dfce273e8e84d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_managementgroup.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_managementgroup.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_providerremediation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_providerremediation.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_providerremediation.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_providerremediation.go index ec6e2caaabed3..7b2254a3ac43e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_providerremediation.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_providerremediation.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_providers2remediation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_providers2remediation.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_providers2remediation.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_providers2remediation.go index 3094a75bcae70..2dfecf80007f7 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_providers2remediation.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_providers2remediation.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_remediation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_remediation.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_remediation.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_remediation.go index e38039981e3d1..ce9ea88fd70cb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_remediation.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_remediation.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_scopedremediation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_scopedremediation.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_scopedremediation.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_scopedremediation.go index d8c6f2f5f76ba..24a285abe6b6b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/id_scopedremediation.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/id_scopedremediation.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatmanagementgroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatmanagementgroup_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatmanagementgroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatmanagementgroup_autorest.go index a5d4e06b02ebf..accd577ccaa8c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatmanagementgroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatmanagementgroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -18,22 +18,22 @@ type RemediationsCancelAtManagementGroupOperationResponse struct { } // RemediationsCancelAtManagementGroup ... -func (c PolicyInsightsClient) RemediationsCancelAtManagementGroup(ctx context.Context, id Providers2RemediationId) (result RemediationsCancelAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsCancelAtManagementGroup(ctx context.Context, id Providers2RemediationId) (result RemediationsCancelAtManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsCancelAtManagementGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtManagementGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtManagementGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtManagementGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCancelAtManagementGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtManagementGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtManagementGroup", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c PolicyInsightsClient) RemediationsCancelAtManagementGroup(ctx context.Co } // preparerForRemediationsCancelAtManagementGroup prepares the RemediationsCancelAtManagementGroup request. -func (c PolicyInsightsClient) preparerForRemediationsCancelAtManagementGroup(ctx context.Context, id Providers2RemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCancelAtManagementGroup(ctx context.Context, id Providers2RemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCancelAtManagementGroup(ctx // responderForRemediationsCancelAtManagementGroup handles the response to the RemediationsCancelAtManagementGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCancelAtManagementGroup(resp *http.Response) (result RemediationsCancelAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCancelAtManagementGroup(resp *http.Response) (result RemediationsCancelAtManagementGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatresource_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatresource_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatresource_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatresource_autorest.go index 6ab5cccad66ac..323b325735981 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatresource_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatresource_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -18,22 +18,22 @@ type RemediationsCancelAtResourceOperationResponse struct { } // RemediationsCancelAtResource ... -func (c PolicyInsightsClient) RemediationsCancelAtResource(ctx context.Context, id ScopedRemediationId) (result RemediationsCancelAtResourceOperationResponse, err error) { +func (c RemediationsClient) RemediationsCancelAtResource(ctx context.Context, id ScopedRemediationId) (result RemediationsCancelAtResourceOperationResponse, err error) { req, err := c.preparerForRemediationsCancelAtResource(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtResource", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtResource", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtResource", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCancelAtResource(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtResource", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtResource", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c PolicyInsightsClient) RemediationsCancelAtResource(ctx context.Context, } // preparerForRemediationsCancelAtResource prepares the RemediationsCancelAtResource request. -func (c PolicyInsightsClient) preparerForRemediationsCancelAtResource(ctx context.Context, id ScopedRemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCancelAtResource(ctx context.Context, id ScopedRemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCancelAtResource(ctx contex // responderForRemediationsCancelAtResource handles the response to the RemediationsCancelAtResource request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCancelAtResource(resp *http.Response) (result RemediationsCancelAtResourceOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCancelAtResource(resp *http.Response) (result RemediationsCancelAtResourceOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatresourcegroup_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatresourcegroup_autorest.go index 9f4d04af29744..15d4a3b76863a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -18,22 +18,22 @@ type RemediationsCancelAtResourceGroupOperationResponse struct { } // RemediationsCancelAtResourceGroup ... -func (c PolicyInsightsClient) RemediationsCancelAtResourceGroup(ctx context.Context, id ProviderRemediationId) (result RemediationsCancelAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsCancelAtResourceGroup(ctx context.Context, id ProviderRemediationId) (result RemediationsCancelAtResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsCancelAtResourceGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCancelAtResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c PolicyInsightsClient) RemediationsCancelAtResourceGroup(ctx context.Cont } // preparerForRemediationsCancelAtResourceGroup prepares the RemediationsCancelAtResourceGroup request. -func (c PolicyInsightsClient) preparerForRemediationsCancelAtResourceGroup(ctx context.Context, id ProviderRemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCancelAtResourceGroup(ctx context.Context, id ProviderRemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCancelAtResourceGroup(ctx c // responderForRemediationsCancelAtResourceGroup handles the response to the RemediationsCancelAtResourceGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCancelAtResourceGroup(resp *http.Response) (result RemediationsCancelAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCancelAtResourceGroup(resp *http.Response) (result RemediationsCancelAtResourceGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatsubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatsubscription_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatsubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatsubscription_autorest.go index f99881e45ca87..a1575b72aed78 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscancelatsubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscancelatsubscription_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -18,22 +18,22 @@ type RemediationsCancelAtSubscriptionOperationResponse struct { } // RemediationsCancelAtSubscription ... -func (c PolicyInsightsClient) RemediationsCancelAtSubscription(ctx context.Context, id RemediationId) (result RemediationsCancelAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) RemediationsCancelAtSubscription(ctx context.Context, id RemediationId) (result RemediationsCancelAtSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsCancelAtSubscription(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtSubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtSubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtSubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCancelAtSubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCancelAtSubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCancelAtSubscription", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c PolicyInsightsClient) RemediationsCancelAtSubscription(ctx context.Conte } // preparerForRemediationsCancelAtSubscription prepares the RemediationsCancelAtSubscription request. -func (c PolicyInsightsClient) preparerForRemediationsCancelAtSubscription(ctx context.Context, id RemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCancelAtSubscription(ctx context.Context, id RemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCancelAtSubscription(ctx co // responderForRemediationsCancelAtSubscription handles the response to the RemediationsCancelAtSubscription request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCancelAtSubscription(resp *http.Response) (result RemediationsCancelAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCancelAtSubscription(resp *http.Response) (result RemediationsCancelAtSubscriptionOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatmanagementgroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatmanagementgroup_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatmanagementgroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatmanagementgroup_autorest.go index 0ac65993d4dd5..e9f8c0df2a2b4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatmanagementgroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatmanagementgroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsCreateOrUpdateAtManagementGroupOperationResponse struct { } // RemediationsCreateOrUpdateAtManagementGroup ... -func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtManagementGroup(ctx context.Context, id Providers2RemediationId, input Remediation) (result RemediationsCreateOrUpdateAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsCreateOrUpdateAtManagementGroup(ctx context.Context, id Providers2RemediationId, input Remediation) (result RemediationsCreateOrUpdateAtManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsCreateOrUpdateAtManagementGroup(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtManagementGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtManagementGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtManagementGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCreateOrUpdateAtManagementGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtManagementGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtManagementGroup", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtManagementGroup(ctx co } // preparerForRemediationsCreateOrUpdateAtManagementGroup prepares the RemediationsCreateOrUpdateAtManagementGroup request. -func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtManagementGroup(ctx context.Context, id Providers2RemediationId, input Remediation) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCreateOrUpdateAtManagementGroup(ctx context.Context, id Providers2RemediationId, input Remediation) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtManagementG // responderForRemediationsCreateOrUpdateAtManagementGroup handles the response to the RemediationsCreateOrUpdateAtManagementGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCreateOrUpdateAtManagementGroup(resp *http.Response) (result RemediationsCreateOrUpdateAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCreateOrUpdateAtManagementGroup(resp *http.Response) (result RemediationsCreateOrUpdateAtManagementGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatresource_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatresource_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatresource_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatresource_autorest.go index bcffae080e13f..61d4ec43f4fe2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatresource_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatresource_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsCreateOrUpdateAtResourceOperationResponse struct { } // RemediationsCreateOrUpdateAtResource ... -func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtResource(ctx context.Context, id ScopedRemediationId, input Remediation) (result RemediationsCreateOrUpdateAtResourceOperationResponse, err error) { +func (c RemediationsClient) RemediationsCreateOrUpdateAtResource(ctx context.Context, id ScopedRemediationId, input Remediation) (result RemediationsCreateOrUpdateAtResourceOperationResponse, err error) { req, err := c.preparerForRemediationsCreateOrUpdateAtResource(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtResource", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtResource", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtResource", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCreateOrUpdateAtResource(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtResource", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtResource", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtResource(ctx context.C } // preparerForRemediationsCreateOrUpdateAtResource prepares the RemediationsCreateOrUpdateAtResource request. -func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtResource(ctx context.Context, id ScopedRemediationId, input Remediation) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCreateOrUpdateAtResource(ctx context.Context, id ScopedRemediationId, input Remediation) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtResource(ct // responderForRemediationsCreateOrUpdateAtResource handles the response to the RemediationsCreateOrUpdateAtResource request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCreateOrUpdateAtResource(resp *http.Response) (result RemediationsCreateOrUpdateAtResourceOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCreateOrUpdateAtResource(resp *http.Response) (result RemediationsCreateOrUpdateAtResourceOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatresourcegroup_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatresourcegroup_autorest.go index 92dd81e12ce4e..b6cb95e99c764 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsCreateOrUpdateAtResourceGroupOperationResponse struct { } // RemediationsCreateOrUpdateAtResourceGroup ... -func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtResourceGroup(ctx context.Context, id ProviderRemediationId, input Remediation) (result RemediationsCreateOrUpdateAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsCreateOrUpdateAtResourceGroup(ctx context.Context, id ProviderRemediationId, input Remediation) (result RemediationsCreateOrUpdateAtResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsCreateOrUpdateAtResourceGroup(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCreateOrUpdateAtResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtResourceGroup(ctx cont } // preparerForRemediationsCreateOrUpdateAtResourceGroup prepares the RemediationsCreateOrUpdateAtResourceGroup request. -func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtResourceGroup(ctx context.Context, id ProviderRemediationId, input Remediation) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCreateOrUpdateAtResourceGroup(ctx context.Context, id ProviderRemediationId, input Remediation) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtResourceGro // responderForRemediationsCreateOrUpdateAtResourceGroup handles the response to the RemediationsCreateOrUpdateAtResourceGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCreateOrUpdateAtResourceGroup(resp *http.Response) (result RemediationsCreateOrUpdateAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCreateOrUpdateAtResourceGroup(resp *http.Response) (result RemediationsCreateOrUpdateAtResourceGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatsubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatsubscription_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatsubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatsubscription_autorest.go index 09ea6e7d7fe8c..bece31c044a61 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationscreateorupdateatsubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationscreateorupdateatsubscription_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsCreateOrUpdateAtSubscriptionOperationResponse struct { } // RemediationsCreateOrUpdateAtSubscription ... -func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtSubscription(ctx context.Context, id RemediationId, input Remediation) (result RemediationsCreateOrUpdateAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) RemediationsCreateOrUpdateAtSubscription(ctx context.Context, id RemediationId, input Remediation) (result RemediationsCreateOrUpdateAtSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsCreateOrUpdateAtSubscription(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtSubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtSubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtSubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsCreateOrUpdateAtSubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsCreateOrUpdateAtSubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsCreateOrUpdateAtSubscription", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsCreateOrUpdateAtSubscription(ctx conte } // preparerForRemediationsCreateOrUpdateAtSubscription prepares the RemediationsCreateOrUpdateAtSubscription request. -func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtSubscription(ctx context.Context, id RemediationId, input Remediation) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsCreateOrUpdateAtSubscription(ctx context.Context, id RemediationId, input Remediation) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c PolicyInsightsClient) preparerForRemediationsCreateOrUpdateAtSubscriptio // responderForRemediationsCreateOrUpdateAtSubscription handles the response to the RemediationsCreateOrUpdateAtSubscription request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsCreateOrUpdateAtSubscription(resp *http.Response) (result RemediationsCreateOrUpdateAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsCreateOrUpdateAtSubscription(resp *http.Response) (result RemediationsCreateOrUpdateAtSubscriptionOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatmanagementgroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatmanagementgroup_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatmanagementgroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatmanagementgroup_autorest.go index 2506accd30ac8..e62fd228f40b0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatmanagementgroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatmanagementgroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsDeleteAtManagementGroupOperationResponse struct { } // RemediationsDeleteAtManagementGroup ... -func (c PolicyInsightsClient) RemediationsDeleteAtManagementGroup(ctx context.Context, id Providers2RemediationId) (result RemediationsDeleteAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsDeleteAtManagementGroup(ctx context.Context, id Providers2RemediationId) (result RemediationsDeleteAtManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsDeleteAtManagementGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtManagementGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtManagementGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtManagementGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsDeleteAtManagementGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtManagementGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtManagementGroup", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsDeleteAtManagementGroup(ctx context.Co } // preparerForRemediationsDeleteAtManagementGroup prepares the RemediationsDeleteAtManagementGroup request. -func (c PolicyInsightsClient) preparerForRemediationsDeleteAtManagementGroup(ctx context.Context, id Providers2RemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsDeleteAtManagementGroup(ctx context.Context, id Providers2RemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsDeleteAtManagementGroup(ctx // responderForRemediationsDeleteAtManagementGroup handles the response to the RemediationsDeleteAtManagementGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsDeleteAtManagementGroup(resp *http.Response) (result RemediationsDeleteAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsDeleteAtManagementGroup(resp *http.Response) (result RemediationsDeleteAtManagementGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatresource_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatresource_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatresource_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatresource_autorest.go index f71fea023ea4a..5caaa3d04bfff 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatresource_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatresource_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsDeleteAtResourceOperationResponse struct { } // RemediationsDeleteAtResource ... -func (c PolicyInsightsClient) RemediationsDeleteAtResource(ctx context.Context, id ScopedRemediationId) (result RemediationsDeleteAtResourceOperationResponse, err error) { +func (c RemediationsClient) RemediationsDeleteAtResource(ctx context.Context, id ScopedRemediationId) (result RemediationsDeleteAtResourceOperationResponse, err error) { req, err := c.preparerForRemediationsDeleteAtResource(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtResource", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtResource", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtResource", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsDeleteAtResource(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtResource", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtResource", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsDeleteAtResource(ctx context.Context, } // preparerForRemediationsDeleteAtResource prepares the RemediationsDeleteAtResource request. -func (c PolicyInsightsClient) preparerForRemediationsDeleteAtResource(ctx context.Context, id ScopedRemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsDeleteAtResource(ctx context.Context, id ScopedRemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsDeleteAtResource(ctx contex // responderForRemediationsDeleteAtResource handles the response to the RemediationsDeleteAtResource request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsDeleteAtResource(resp *http.Response) (result RemediationsDeleteAtResourceOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsDeleteAtResource(resp *http.Response) (result RemediationsDeleteAtResourceOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatresourcegroup_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatresourcegroup_autorest.go index b0a3eeb7cfb50..90fc0ff91b589 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsDeleteAtResourceGroupOperationResponse struct { } // RemediationsDeleteAtResourceGroup ... -func (c PolicyInsightsClient) RemediationsDeleteAtResourceGroup(ctx context.Context, id ProviderRemediationId) (result RemediationsDeleteAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsDeleteAtResourceGroup(ctx context.Context, id ProviderRemediationId) (result RemediationsDeleteAtResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsDeleteAtResourceGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsDeleteAtResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsDeleteAtResourceGroup(ctx context.Cont } // preparerForRemediationsDeleteAtResourceGroup prepares the RemediationsDeleteAtResourceGroup request. -func (c PolicyInsightsClient) preparerForRemediationsDeleteAtResourceGroup(ctx context.Context, id ProviderRemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsDeleteAtResourceGroup(ctx context.Context, id ProviderRemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsDeleteAtResourceGroup(ctx c // responderForRemediationsDeleteAtResourceGroup handles the response to the RemediationsDeleteAtResourceGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsDeleteAtResourceGroup(resp *http.Response) (result RemediationsDeleteAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsDeleteAtResourceGroup(resp *http.Response) (result RemediationsDeleteAtResourceGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatsubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatsubscription_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatsubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatsubscription_autorest.go index c521299f16013..bedb33fa50518 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsdeleteatsubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsdeleteatsubscription_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsDeleteAtSubscriptionOperationResponse struct { } // RemediationsDeleteAtSubscription ... -func (c PolicyInsightsClient) RemediationsDeleteAtSubscription(ctx context.Context, id RemediationId) (result RemediationsDeleteAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) RemediationsDeleteAtSubscription(ctx context.Context, id RemediationId) (result RemediationsDeleteAtSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsDeleteAtSubscription(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtSubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtSubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtSubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsDeleteAtSubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsDeleteAtSubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsDeleteAtSubscription", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsDeleteAtSubscription(ctx context.Conte } // preparerForRemediationsDeleteAtSubscription prepares the RemediationsDeleteAtSubscription request. -func (c PolicyInsightsClient) preparerForRemediationsDeleteAtSubscription(ctx context.Context, id RemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsDeleteAtSubscription(ctx context.Context, id RemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsDeleteAtSubscription(ctx co // responderForRemediationsDeleteAtSubscription handles the response to the RemediationsDeleteAtSubscription request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsDeleteAtSubscription(resp *http.Response) (result RemediationsDeleteAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsDeleteAtSubscription(resp *http.Response) (result RemediationsDeleteAtSubscriptionOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatmanagementgroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatmanagementgroup_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatmanagementgroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatmanagementgroup_autorest.go index c03210a5216ed..d32c1d7cb85f4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatmanagementgroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatmanagementgroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsGetAtManagementGroupOperationResponse struct { } // RemediationsGetAtManagementGroup ... -func (c PolicyInsightsClient) RemediationsGetAtManagementGroup(ctx context.Context, id Providers2RemediationId) (result RemediationsGetAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsGetAtManagementGroup(ctx context.Context, id Providers2RemediationId) (result RemediationsGetAtManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsGetAtManagementGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtManagementGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtManagementGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtManagementGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsGetAtManagementGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtManagementGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtManagementGroup", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsGetAtManagementGroup(ctx context.Conte } // preparerForRemediationsGetAtManagementGroup prepares the RemediationsGetAtManagementGroup request. -func (c PolicyInsightsClient) preparerForRemediationsGetAtManagementGroup(ctx context.Context, id Providers2RemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsGetAtManagementGroup(ctx context.Context, id Providers2RemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsGetAtManagementGroup(ctx co // responderForRemediationsGetAtManagementGroup handles the response to the RemediationsGetAtManagementGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsGetAtManagementGroup(resp *http.Response) (result RemediationsGetAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsGetAtManagementGroup(resp *http.Response) (result RemediationsGetAtManagementGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatresource_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatresource_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatresource_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatresource_autorest.go index 9fdadcce8197d..c21c86edbf2ab 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatresource_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatresource_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsGetAtResourceOperationResponse struct { } // RemediationsGetAtResource ... -func (c PolicyInsightsClient) RemediationsGetAtResource(ctx context.Context, id ScopedRemediationId) (result RemediationsGetAtResourceOperationResponse, err error) { +func (c RemediationsClient) RemediationsGetAtResource(ctx context.Context, id ScopedRemediationId) (result RemediationsGetAtResourceOperationResponse, err error) { req, err := c.preparerForRemediationsGetAtResource(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtResource", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtResource", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtResource", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsGetAtResource(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtResource", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtResource", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsGetAtResource(ctx context.Context, id } // preparerForRemediationsGetAtResource prepares the RemediationsGetAtResource request. -func (c PolicyInsightsClient) preparerForRemediationsGetAtResource(ctx context.Context, id ScopedRemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsGetAtResource(ctx context.Context, id ScopedRemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsGetAtResource(ctx context.C // responderForRemediationsGetAtResource handles the response to the RemediationsGetAtResource request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsGetAtResource(resp *http.Response) (result RemediationsGetAtResourceOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsGetAtResource(resp *http.Response) (result RemediationsGetAtResourceOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatresourcegroup_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatresourcegroup_autorest.go index 340a889727e62..de938e787b2a6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsGetAtResourceGroupOperationResponse struct { } // RemediationsGetAtResourceGroup ... -func (c PolicyInsightsClient) RemediationsGetAtResourceGroup(ctx context.Context, id ProviderRemediationId) (result RemediationsGetAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsGetAtResourceGroup(ctx context.Context, id ProviderRemediationId) (result RemediationsGetAtResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsGetAtResourceGroup(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsGetAtResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsGetAtResourceGroup(ctx context.Context } // preparerForRemediationsGetAtResourceGroup prepares the RemediationsGetAtResourceGroup request. -func (c PolicyInsightsClient) preparerForRemediationsGetAtResourceGroup(ctx context.Context, id ProviderRemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsGetAtResourceGroup(ctx context.Context, id ProviderRemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsGetAtResourceGroup(ctx cont // responderForRemediationsGetAtResourceGroup handles the response to the RemediationsGetAtResourceGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsGetAtResourceGroup(resp *http.Response) (result RemediationsGetAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsGetAtResourceGroup(resp *http.Response) (result RemediationsGetAtResourceGroupOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatsubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatsubscription_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatsubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatsubscription_autorest.go index 8d5cfb814735d..3e94c0ee59c56 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationsgetatsubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationsgetatsubscription_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -17,22 +17,22 @@ type RemediationsGetAtSubscriptionOperationResponse struct { } // RemediationsGetAtSubscription ... -func (c PolicyInsightsClient) RemediationsGetAtSubscription(ctx context.Context, id RemediationId) (result RemediationsGetAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) RemediationsGetAtSubscription(ctx context.Context, id RemediationId) (result RemediationsGetAtSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsGetAtSubscription(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtSubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtSubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtSubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsGetAtSubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsGetAtSubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsGetAtSubscription", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c PolicyInsightsClient) RemediationsGetAtSubscription(ctx context.Context, } // preparerForRemediationsGetAtSubscription prepares the RemediationsGetAtSubscription request. -func (c PolicyInsightsClient) preparerForRemediationsGetAtSubscription(ctx context.Context, id RemediationId) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsGetAtSubscription(ctx context.Context, id RemediationId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c PolicyInsightsClient) preparerForRemediationsGetAtSubscription(ctx conte // responderForRemediationsGetAtSubscription handles the response to the RemediationsGetAtSubscription request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsGetAtSubscription(resp *http.Response) (result RemediationsGetAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsGetAtSubscription(resp *http.Response) (result RemediationsGetAtSubscriptionOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatmanagementgroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatmanagementgroup_autorest.go similarity index 70% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatmanagementgroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatmanagementgroup_autorest.go index c9f369689d9e3..7fc7568da917c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatmanagementgroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatmanagementgroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -62,29 +62,29 @@ func (o RemediationsListDeploymentsAtManagementGroupOperationOptions) toQueryStr } // RemediationsListDeploymentsAtManagementGroup ... -func (c PolicyInsightsClient) RemediationsListDeploymentsAtManagementGroup(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions) (resp RemediationsListDeploymentsAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtManagementGroup(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions) (resp RemediationsListDeploymentsAtManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtManagementGroup(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtManagementGroup", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtManagementGroup", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtManagementGroup", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListDeploymentsAtManagementGroup(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtManagementGroup", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtManagementGroup", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListDeploymentsAtManagementGroup prepares the RemediationsListDeploymentsAtManagementGroup request. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtManagementGroup(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtManagementGroup(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -104,7 +104,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtManagement } // preparerForRemediationsListDeploymentsAtManagementGroupWithNextLink prepares the RemediationsListDeploymentsAtManagementGroup request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtManagementGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtManagementGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -130,7 +130,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtManagement // responderForRemediationsListDeploymentsAtManagementGroup handles the response to the RemediationsListDeploymentsAtManagementGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtManagementGroup(resp *http.Response) (result RemediationsListDeploymentsAtManagementGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListDeploymentsAtManagementGroup(resp *http.Response) (result RemediationsListDeploymentsAtManagementGroupOperationResponse, err error) { type page struct { Values []RemediationDeployment `json:"value"` NextLink *string `json:"nextLink"` @@ -148,19 +148,19 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtManagemen result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListDeploymentsAtManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtManagementGroupWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtManagementGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtManagementGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtManagementGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListDeploymentsAtManagementGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtManagementGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtManagementGroup", result.HttpResponse, "Failure responding to request") return } @@ -171,12 +171,12 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtManagemen } // RemediationsListDeploymentsAtManagementGroupComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListDeploymentsAtManagementGroupComplete(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions) (RemediationsListDeploymentsAtManagementGroupCompleteResult, error) { +func (c RemediationsClient) RemediationsListDeploymentsAtManagementGroupComplete(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions) (RemediationsListDeploymentsAtManagementGroupCompleteResult, error) { return c.RemediationsListDeploymentsAtManagementGroupCompleteMatchingPredicate(ctx, id, options, RemediationDeploymentOperationPredicate{}) } // RemediationsListDeploymentsAtManagementGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListDeploymentsAtManagementGroupCompleteMatchingPredicate(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtManagementGroupCompleteResult, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtManagementGroupCompleteMatchingPredicate(ctx context.Context, id Providers2RemediationId, options RemediationsListDeploymentsAtManagementGroupOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtManagementGroupCompleteResult, err error) { items := make([]RemediationDeployment, 0) page, err := c.RemediationsListDeploymentsAtManagementGroup(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatresource_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatresource_autorest.go similarity index 71% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatresource_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatresource_autorest.go index 3865d9156a1fe..c7cb20e0c96cb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatresource_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatresource_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -62,29 +62,29 @@ func (o RemediationsListDeploymentsAtResourceOperationOptions) toQueryString() m } // RemediationsListDeploymentsAtResource ... -func (c PolicyInsightsClient) RemediationsListDeploymentsAtResource(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions) (resp RemediationsListDeploymentsAtResourceOperationResponse, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtResource(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions) (resp RemediationsListDeploymentsAtResourceOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtResource(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResource", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResource", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResource", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListDeploymentsAtResource(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResource", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResource", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListDeploymentsAtResource prepares the RemediationsListDeploymentsAtResource request. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResource(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtResource(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -104,7 +104,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResource(c } // preparerForRemediationsListDeploymentsAtResourceWithNextLink prepares the RemediationsListDeploymentsAtResource request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResourceWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtResourceWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -130,7 +130,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResourceWi // responderForRemediationsListDeploymentsAtResource handles the response to the RemediationsListDeploymentsAtResource request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtResource(resp *http.Response) (result RemediationsListDeploymentsAtResourceOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListDeploymentsAtResource(resp *http.Response) (result RemediationsListDeploymentsAtResourceOperationResponse, err error) { type page struct { Values []RemediationDeployment `json:"value"` NextLink *string `json:"nextLink"` @@ -148,19 +148,19 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtResource( result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListDeploymentsAtResourceOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtResourceWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResource", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResource", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResource", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListDeploymentsAtResource(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResource", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResource", result.HttpResponse, "Failure responding to request") return } @@ -171,12 +171,12 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtResource( } // RemediationsListDeploymentsAtResourceComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListDeploymentsAtResourceComplete(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions) (RemediationsListDeploymentsAtResourceCompleteResult, error) { +func (c RemediationsClient) RemediationsListDeploymentsAtResourceComplete(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions) (RemediationsListDeploymentsAtResourceCompleteResult, error) { return c.RemediationsListDeploymentsAtResourceCompleteMatchingPredicate(ctx, id, options, RemediationDeploymentOperationPredicate{}) } // RemediationsListDeploymentsAtResourceCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListDeploymentsAtResourceCompleteMatchingPredicate(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtResourceCompleteResult, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtResourceCompleteMatchingPredicate(ctx context.Context, id ScopedRemediationId, options RemediationsListDeploymentsAtResourceOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtResourceCompleteResult, err error) { items := make([]RemediationDeployment, 0) page, err := c.RemediationsListDeploymentsAtResource(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatresourcegroup_autorest.go similarity index 70% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatresourcegroup_autorest.go index 25afc17b63337..d6b08226e506f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -62,29 +62,29 @@ func (o RemediationsListDeploymentsAtResourceGroupOperationOptions) toQueryStrin } // RemediationsListDeploymentsAtResourceGroup ... -func (c PolicyInsightsClient) RemediationsListDeploymentsAtResourceGroup(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions) (resp RemediationsListDeploymentsAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtResourceGroup(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions) (resp RemediationsListDeploymentsAtResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtResourceGroup(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResourceGroup", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResourceGroup", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResourceGroup", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListDeploymentsAtResourceGroup(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResourceGroup", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResourceGroup", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListDeploymentsAtResourceGroup prepares the RemediationsListDeploymentsAtResourceGroup request. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResourceGroup(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtResourceGroup(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -104,7 +104,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResourceGr } // preparerForRemediationsListDeploymentsAtResourceGroupWithNextLink prepares the RemediationsListDeploymentsAtResourceGroup request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -130,7 +130,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtResourceGr // responderForRemediationsListDeploymentsAtResourceGroup handles the response to the RemediationsListDeploymentsAtResourceGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtResourceGroup(resp *http.Response) (result RemediationsListDeploymentsAtResourceGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListDeploymentsAtResourceGroup(resp *http.Response) (result RemediationsListDeploymentsAtResourceGroupOperationResponse, err error) { type page struct { Values []RemediationDeployment `json:"value"` NextLink *string `json:"nextLink"` @@ -148,19 +148,19 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtResourceG result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListDeploymentsAtResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtResourceGroupWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListDeploymentsAtResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -171,12 +171,12 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtResourceG } // RemediationsListDeploymentsAtResourceGroupComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListDeploymentsAtResourceGroupComplete(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions) (RemediationsListDeploymentsAtResourceGroupCompleteResult, error) { +func (c RemediationsClient) RemediationsListDeploymentsAtResourceGroupComplete(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions) (RemediationsListDeploymentsAtResourceGroupCompleteResult, error) { return c.RemediationsListDeploymentsAtResourceGroupCompleteMatchingPredicate(ctx, id, options, RemediationDeploymentOperationPredicate{}) } // RemediationsListDeploymentsAtResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListDeploymentsAtResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtResourceGroupCompleteResult, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderRemediationId, options RemediationsListDeploymentsAtResourceGroupOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtResourceGroupCompleteResult, err error) { items := make([]RemediationDeployment, 0) page, err := c.RemediationsListDeploymentsAtResourceGroup(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatsubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatsubscription_autorest.go similarity index 71% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatsubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatsubscription_autorest.go index 36dbcee3fdf4f..d916e05fce19c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistdeploymentsatsubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistdeploymentsatsubscription_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -62,29 +62,29 @@ func (o RemediationsListDeploymentsAtSubscriptionOperationOptions) toQueryString } // RemediationsListDeploymentsAtSubscription ... -func (c PolicyInsightsClient) RemediationsListDeploymentsAtSubscription(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions) (resp RemediationsListDeploymentsAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtSubscription(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions) (resp RemediationsListDeploymentsAtSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtSubscription(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtSubscription", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtSubscription", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtSubscription", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListDeploymentsAtSubscription(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtSubscription", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtSubscription", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListDeploymentsAtSubscription prepares the RemediationsListDeploymentsAtSubscription request. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtSubscription(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtSubscription(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -104,7 +104,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtSubscripti } // preparerForRemediationsListDeploymentsAtSubscriptionWithNextLink prepares the RemediationsListDeploymentsAtSubscription request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtSubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListDeploymentsAtSubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -130,7 +130,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListDeploymentsAtSubscripti // responderForRemediationsListDeploymentsAtSubscription handles the response to the RemediationsListDeploymentsAtSubscription request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtSubscription(resp *http.Response) (result RemediationsListDeploymentsAtSubscriptionOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListDeploymentsAtSubscription(resp *http.Response) (result RemediationsListDeploymentsAtSubscriptionOperationResponse, err error) { type page struct { Values []RemediationDeployment `json:"value"` NextLink *string `json:"nextLink"` @@ -148,19 +148,19 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtSubscript result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListDeploymentsAtSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsListDeploymentsAtSubscriptionWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtSubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtSubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtSubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListDeploymentsAtSubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListDeploymentsAtSubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListDeploymentsAtSubscription", result.HttpResponse, "Failure responding to request") return } @@ -171,12 +171,12 @@ func (c PolicyInsightsClient) responderForRemediationsListDeploymentsAtSubscript } // RemediationsListDeploymentsAtSubscriptionComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListDeploymentsAtSubscriptionComplete(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions) (RemediationsListDeploymentsAtSubscriptionCompleteResult, error) { +func (c RemediationsClient) RemediationsListDeploymentsAtSubscriptionComplete(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions) (RemediationsListDeploymentsAtSubscriptionCompleteResult, error) { return c.RemediationsListDeploymentsAtSubscriptionCompleteMatchingPredicate(ctx, id, options, RemediationDeploymentOperationPredicate{}) } // RemediationsListDeploymentsAtSubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListDeploymentsAtSubscriptionCompleteMatchingPredicate(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtSubscriptionCompleteResult, err error) { +func (c RemediationsClient) RemediationsListDeploymentsAtSubscriptionCompleteMatchingPredicate(ctx context.Context, id RemediationId, options RemediationsListDeploymentsAtSubscriptionOperationOptions, predicate RemediationDeploymentOperationPredicate) (resp RemediationsListDeploymentsAtSubscriptionCompleteResult, err error) { items := make([]RemediationDeployment, 0) page, err := c.RemediationsListDeploymentsAtSubscription(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistformanagementgroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistformanagementgroup_autorest.go similarity index 72% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistformanagementgroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistformanagementgroup_autorest.go index 8a5767596d02d..3f3459951d17b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistformanagementgroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistformanagementgroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -67,29 +67,29 @@ func (o RemediationsListForManagementGroupOperationOptions) toQueryString() map[ } // RemediationsListForManagementGroup ... -func (c PolicyInsightsClient) RemediationsListForManagementGroup(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions) (resp RemediationsListForManagementGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsListForManagementGroup(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions) (resp RemediationsListForManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListForManagementGroup(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForManagementGroup", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForManagementGroup", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForManagementGroup", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListForManagementGroup(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForManagementGroup", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForManagementGroup", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListForManagementGroup prepares the RemediationsListForManagementGroup request. -func (c PolicyInsightsClient) preparerForRemediationsListForManagementGroup(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForManagementGroup(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -109,7 +109,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForManagementGroup(ctx } // preparerForRemediationsListForManagementGroupWithNextLink prepares the RemediationsListForManagementGroup request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListForManagementGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForManagementGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -135,7 +135,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForManagementGroupWithN // responderForRemediationsListForManagementGroup handles the response to the RemediationsListForManagementGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListForManagementGroup(resp *http.Response) (result RemediationsListForManagementGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListForManagementGroup(resp *http.Response) (result RemediationsListForManagementGroupOperationResponse, err error) { type page struct { Values []Remediation `json:"value"` NextLink *string `json:"nextLink"` @@ -153,19 +153,19 @@ func (c PolicyInsightsClient) responderForRemediationsListForManagementGroup(res result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListForManagementGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListForManagementGroupWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForManagementGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForManagementGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForManagementGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForManagementGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListForManagementGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForManagementGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForManagementGroup", result.HttpResponse, "Failure responding to request") return } @@ -176,12 +176,12 @@ func (c PolicyInsightsClient) responderForRemediationsListForManagementGroup(res } // RemediationsListForManagementGroupComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListForManagementGroupComplete(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions) (RemediationsListForManagementGroupCompleteResult, error) { +func (c RemediationsClient) RemediationsListForManagementGroupComplete(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions) (RemediationsListForManagementGroupCompleteResult, error) { return c.RemediationsListForManagementGroupCompleteMatchingPredicate(ctx, id, options, RemediationOperationPredicate{}) } // RemediationsListForManagementGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListForManagementGroupCompleteMatchingPredicate(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForManagementGroupCompleteResult, err error) { +func (c RemediationsClient) RemediationsListForManagementGroupCompleteMatchingPredicate(ctx context.Context, id ManagementGroupId, options RemediationsListForManagementGroupOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForManagementGroupCompleteResult, err error) { items := make([]Remediation, 0) page, err := c.RemediationsListForManagementGroup(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforresource_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforresource_autorest.go similarity index 72% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforresource_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforresource_autorest.go index d9cd061f60dfb..ee6be7ef65906 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforresource_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforresource_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -68,29 +68,29 @@ func (o RemediationsListForResourceOperationOptions) toQueryString() map[string] } // RemediationsListForResource ... -func (c PolicyInsightsClient) RemediationsListForResource(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions) (resp RemediationsListForResourceOperationResponse, err error) { +func (c RemediationsClient) RemediationsListForResource(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions) (resp RemediationsListForResourceOperationResponse, err error) { req, err := c.preparerForRemediationsListForResource(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResource", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResource", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResource", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListForResource(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResource", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResource", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListForResource prepares the RemediationsListForResource request. -func (c PolicyInsightsClient) preparerForRemediationsListForResource(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForResource(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -110,7 +110,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForResource(ctx context } // preparerForRemediationsListForResourceWithNextLink prepares the RemediationsListForResource request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListForResourceWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForResourceWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -136,7 +136,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForResourceWithNextLink // responderForRemediationsListForResource handles the response to the RemediationsListForResource request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListForResource(resp *http.Response) (result RemediationsListForResourceOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListForResource(resp *http.Response) (result RemediationsListForResourceOperationResponse, err error) { type page struct { Values []Remediation `json:"value"` NextLink *string `json:"nextLink"` @@ -154,19 +154,19 @@ func (c PolicyInsightsClient) responderForRemediationsListForResource(resp *http result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListForResourceOperationResponse, err error) { req, err := c.preparerForRemediationsListForResourceWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResource", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResource", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResource", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResource", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListForResource(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResource", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResource", result.HttpResponse, "Failure responding to request") return } @@ -177,12 +177,12 @@ func (c PolicyInsightsClient) responderForRemediationsListForResource(resp *http } // RemediationsListForResourceComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListForResourceComplete(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions) (RemediationsListForResourceCompleteResult, error) { +func (c RemediationsClient) RemediationsListForResourceComplete(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions) (RemediationsListForResourceCompleteResult, error) { return c.RemediationsListForResourceCompleteMatchingPredicate(ctx, id, options, RemediationOperationPredicate{}) } // RemediationsListForResourceCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListForResourceCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForResourceCompleteResult, err error) { +func (c RemediationsClient) RemediationsListForResourceCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options RemediationsListForResourceOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForResourceCompleteResult, err error) { items := make([]Remediation, 0) page, err := c.RemediationsListForResource(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforresourcegroup_autorest.go similarity index 72% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforresourcegroup_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforresourcegroup_autorest.go index dfc5abea38083..97b870c47d05c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforresourcegroup_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforresourcegroup_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -68,29 +68,29 @@ func (o RemediationsListForResourceGroupOperationOptions) toQueryString() map[st } // RemediationsListForResourceGroup ... -func (c PolicyInsightsClient) RemediationsListForResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions) (resp RemediationsListForResourceGroupOperationResponse, err error) { +func (c RemediationsClient) RemediationsListForResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions) (resp RemediationsListForResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListForResourceGroup(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResourceGroup", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResourceGroup", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResourceGroup", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListForResourceGroup(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResourceGroup", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResourceGroup", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListForResourceGroup prepares the RemediationsListForResourceGroup request. -func (c PolicyInsightsClient) preparerForRemediationsListForResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -110,7 +110,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForResourceGroup(ctx co } // preparerForRemediationsListForResourceGroupWithNextLink prepares the RemediationsListForResourceGroup request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListForResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -136,7 +136,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForResourceGroupWithNex // responderForRemediationsListForResourceGroup handles the response to the RemediationsListForResourceGroup request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListForResourceGroup(resp *http.Response) (result RemediationsListForResourceGroupOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListForResourceGroup(resp *http.Response) (result RemediationsListForResourceGroupOperationResponse, err error) { type page struct { Values []Remediation `json:"value"` NextLink *string `json:"nextLink"` @@ -154,19 +154,19 @@ func (c PolicyInsightsClient) responderForRemediationsListForResourceGroup(resp result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListForResourceGroupOperationResponse, err error) { req, err := c.preparerForRemediationsListForResourceGroupWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResourceGroup", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResourceGroup", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResourceGroup", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListForResourceGroup(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForResourceGroup", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForResourceGroup", result.HttpResponse, "Failure responding to request") return } @@ -177,12 +177,12 @@ func (c PolicyInsightsClient) responderForRemediationsListForResourceGroup(resp } // RemediationsListForResourceGroupComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListForResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions) (RemediationsListForResourceGroupCompleteResult, error) { +func (c RemediationsClient) RemediationsListForResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions) (RemediationsListForResourceGroupCompleteResult, error) { return c.RemediationsListForResourceGroupCompleteMatchingPredicate(ctx, id, options, RemediationOperationPredicate{}) } // RemediationsListForResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListForResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForResourceGroupCompleteResult, err error) { +func (c RemediationsClient) RemediationsListForResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options RemediationsListForResourceGroupOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForResourceGroupCompleteResult, err error) { items := make([]Remediation, 0) page, err := c.RemediationsListForResourceGroup(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforsubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforsubscription_autorest.go similarity index 72% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforsubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforsubscription_autorest.go index 00c7fd2791009..2af372127de7c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/method_remediationslistforsubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/method_remediationslistforsubscription_autorest.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "context" @@ -68,29 +68,29 @@ func (o RemediationsListForSubscriptionOperationOptions) toQueryString() map[str } // RemediationsListForSubscription ... -func (c PolicyInsightsClient) RemediationsListForSubscription(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions) (resp RemediationsListForSubscriptionOperationResponse, err error) { +func (c RemediationsClient) RemediationsListForSubscription(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions) (resp RemediationsListForSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsListForSubscription(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForSubscription", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForSubscription", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForSubscription", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForRemediationsListForSubscription(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForSubscription", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForSubscription", resp.HttpResponse, "Failure responding to request") return } return } // preparerForRemediationsListForSubscription prepares the RemediationsListForSubscription request. -func (c PolicyInsightsClient) preparerForRemediationsListForSubscription(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForSubscription(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -110,7 +110,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForSubscription(ctx con } // preparerForRemediationsListForSubscriptionWithNextLink prepares the RemediationsListForSubscription request with the given nextLink token. -func (c PolicyInsightsClient) preparerForRemediationsListForSubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c RemediationsClient) preparerForRemediationsListForSubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -136,7 +136,7 @@ func (c PolicyInsightsClient) preparerForRemediationsListForSubscriptionWithNext // responderForRemediationsListForSubscription handles the response to the RemediationsListForSubscription request. The method always // closes the http.Response Body. -func (c PolicyInsightsClient) responderForRemediationsListForSubscription(resp *http.Response) (result RemediationsListForSubscriptionOperationResponse, err error) { +func (c RemediationsClient) responderForRemediationsListForSubscription(resp *http.Response) (result RemediationsListForSubscriptionOperationResponse, err error) { type page struct { Values []Remediation `json:"value"` NextLink *string `json:"nextLink"` @@ -154,19 +154,19 @@ func (c PolicyInsightsClient) responderForRemediationsListForSubscription(resp * result.nextPageFunc = func(ctx context.Context, nextLink string) (result RemediationsListForSubscriptionOperationResponse, err error) { req, err := c.preparerForRemediationsListForSubscriptionWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForSubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForSubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForSubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForSubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForRemediationsListForSubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyInsightsClient", "RemediationsListForSubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "remediations.RemediationsClient", "RemediationsListForSubscription", result.HttpResponse, "Failure responding to request") return } @@ -177,12 +177,12 @@ func (c PolicyInsightsClient) responderForRemediationsListForSubscription(resp * } // RemediationsListForSubscriptionComplete retrieves all of the results into a single object -func (c PolicyInsightsClient) RemediationsListForSubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions) (RemediationsListForSubscriptionCompleteResult, error) { +func (c RemediationsClient) RemediationsListForSubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions) (RemediationsListForSubscriptionCompleteResult, error) { return c.RemediationsListForSubscriptionCompleteMatchingPredicate(ctx, id, options, RemediationOperationPredicate{}) } // RemediationsListForSubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c PolicyInsightsClient) RemediationsListForSubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForSubscriptionCompleteResult, err error) { +func (c RemediationsClient) RemediationsListForSubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options RemediationsListForSubscriptionOperationOptions, predicate RemediationOperationPredicate) (resp RemediationsListForSubscriptionCompleteResult, err error) { items := make([]Remediation, 0) page, err := c.RemediationsListForSubscription(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_errordefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_errordefinition.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_errordefinition.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_errordefinition.go index 73d281600885c..7d2cb5ba7007b 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_errordefinition.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_errordefinition.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediation.go similarity index 96% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediation.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediation.go index d9f3726df76b0..f19bbad75442a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediation.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediation.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationdeployment.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationdeployment.go similarity index 98% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationdeployment.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationdeployment.go index 76cb6af039db6..456d19467246a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationdeployment.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationdeployment.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "time" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationdeploymentsummary.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationdeploymentsummary.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationdeploymentsummary.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationdeploymentsummary.go index 442bd3a52c292..db2a3e65be5a3 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationdeploymentsummary.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationdeploymentsummary.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationfilters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationfilters.go similarity index 91% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationfilters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationfilters.go index af747350aa102..4ded0931be97a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationfilters.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationfilters.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationproperties.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationproperties.go index df6a5980148fb..501085bcf65fe 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationproperties.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations import ( "time" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationpropertiesfailurethreshold.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationpropertiesfailurethreshold.go similarity index 91% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationpropertiesfailurethreshold.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationpropertiesfailurethreshold.go index 2c193699940a4..f3a8d59c959a9 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_remediationpropertiesfailurethreshold.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_remediationpropertiesfailurethreshold.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_typederrorinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_typederrorinfo.go similarity index 92% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_typederrorinfo.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_typederrorinfo.go index 7315369e27122..3819fb61aff15 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/model_typederrorinfo.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/model_typederrorinfo.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/predicates.go similarity index 98% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/predicates.go index d96f35a073f02..308b956527d70 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights/predicates.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/predicates.go @@ -1,4 +1,4 @@ -package policyinsights +package remediations type RemediationOperationPredicate struct { Id *string diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/version.go new file mode 100644 index 0000000000000..17f0e394ae040 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations/version.go @@ -0,0 +1,12 @@ +package remediations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/remediations/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/README.md new file mode 100644 index 0000000000000..8d9c12144a84b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules` Documentation + +The `edgemodules` SDK allows for interaction with the Azure Resource Manager Service `videoanalyzer` (API Version `2021-05-01-preview`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules" +``` + + +### Client Initialization + +```go +client := edgemodules.NewEdgeModulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `EdgeModulesClient.EdgeModulesCreateOrUpdate` + +```go +ctx := context.TODO() +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") + +payload := edgemodules.EdgeModuleEntity{ + // ... +} + + +read, err := client.EdgeModulesCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `EdgeModulesClient.EdgeModulesDelete` + +```go +ctx := context.TODO() +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") + +read, err := client.EdgeModulesDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `EdgeModulesClient.EdgeModulesGet` + +```go +ctx := context.TODO() +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") + +read, err := client.EdgeModulesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `EdgeModulesClient.EdgeModulesList` + +```go +ctx := context.TODO() +id := edgemodules.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +// alternatively `client.EdgeModulesList(ctx, id, edgemodules.DefaultEdgeModulesListOperationOptions())` can be used to do batched pagination +items, err := client.EdgeModulesListComplete(ctx, id, edgemodules.DefaultEdgeModulesListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `EdgeModulesClient.EdgeModulesListProvisioningToken` + +```go +ctx := context.TODO() +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") + +payload := edgemodules.ListProvisioningTokenInput{ + // ... +} + + +read, err := client.EdgeModulesListProvisioningToken(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/client.go new file mode 100644 index 0000000000000..d0e00fc9f5b80 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/client.go @@ -0,0 +1,18 @@ +package edgemodules + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EdgeModulesClient struct { + Client autorest.Client + baseUri string +} + +func NewEdgeModulesClientWithBaseURI(endpoint string) EdgeModulesClient { + return EdgeModulesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_edgemodule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_edgemodule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule.go index 10fa71d5b9183..3b094b76bd621 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_edgemodule.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_videoanalyzer.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_videoanalyzer.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer.go index 8eba6a0e47cc8..191685e54799c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_videoanalyzer.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulescreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulescreateorupdate_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulescreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulescreateorupdate_autorest.go index ae5370e1fc86c..3e66660b15d71 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulescreateorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulescreateorupdate_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "context" @@ -17,22 +17,22 @@ type EdgeModulesCreateOrUpdateOperationResponse struct { } // EdgeModulesCreateOrUpdate ... -func (c VideoAnalyzerClient) EdgeModulesCreateOrUpdate(ctx context.Context, id EdgeModuleId, input EdgeModuleEntity) (result EdgeModulesCreateOrUpdateOperationResponse, err error) { +func (c EdgeModulesClient) EdgeModulesCreateOrUpdate(ctx context.Context, id EdgeModuleId, input EdgeModuleEntity) (result EdgeModulesCreateOrUpdateOperationResponse, err error) { req, err := c.preparerForEdgeModulesCreateOrUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesCreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesCreateOrUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesCreateOrUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesCreateOrUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForEdgeModulesCreateOrUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesCreateOrUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesCreateOrUpdate", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c VideoAnalyzerClient) EdgeModulesCreateOrUpdate(ctx context.Context, id E } // preparerForEdgeModulesCreateOrUpdate prepares the EdgeModulesCreateOrUpdate request. -func (c VideoAnalyzerClient) preparerForEdgeModulesCreateOrUpdate(ctx context.Context, id EdgeModuleId, input EdgeModuleEntity) (*http.Request, error) { +func (c EdgeModulesClient) preparerForEdgeModulesCreateOrUpdate(ctx context.Context, id EdgeModuleId, input EdgeModuleEntity) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c VideoAnalyzerClient) preparerForEdgeModulesCreateOrUpdate(ctx context.Co // responderForEdgeModulesCreateOrUpdate handles the response to the EdgeModulesCreateOrUpdate request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForEdgeModulesCreateOrUpdate(resp *http.Response) (result EdgeModulesCreateOrUpdateOperationResponse, err error) { +func (c EdgeModulesClient) responderForEdgeModulesCreateOrUpdate(resp *http.Response) (result EdgeModulesCreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulesdelete_autorest.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulesdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulesdelete_autorest.go index 6ea68cc817354..142b4cce69cef 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulesdelete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulesdelete_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "context" @@ -16,22 +16,22 @@ type EdgeModulesDeleteOperationResponse struct { } // EdgeModulesDelete ... -func (c VideoAnalyzerClient) EdgeModulesDelete(ctx context.Context, id EdgeModuleId) (result EdgeModulesDeleteOperationResponse, err error) { +func (c EdgeModulesClient) EdgeModulesDelete(ctx context.Context, id EdgeModuleId) (result EdgeModulesDeleteOperationResponse, err error) { req, err := c.preparerForEdgeModulesDelete(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesDelete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesDelete", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesDelete", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesDelete", result.HttpResponse, "Failure sending request") return } result, err = c.responderForEdgeModulesDelete(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesDelete", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesDelete", result.HttpResponse, "Failure responding to request") return } @@ -39,7 +39,7 @@ func (c VideoAnalyzerClient) EdgeModulesDelete(ctx context.Context, id EdgeModul } // preparerForEdgeModulesDelete prepares the EdgeModulesDelete request. -func (c VideoAnalyzerClient) preparerForEdgeModulesDelete(ctx context.Context, id EdgeModuleId) (*http.Request, error) { +func (c EdgeModulesClient) preparerForEdgeModulesDelete(ctx context.Context, id EdgeModuleId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -55,7 +55,7 @@ func (c VideoAnalyzerClient) preparerForEdgeModulesDelete(ctx context.Context, i // responderForEdgeModulesDelete handles the response to the EdgeModulesDelete request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForEdgeModulesDelete(resp *http.Response) (result EdgeModulesDeleteOperationResponse, err error) { +func (c EdgeModulesClient) responderForEdgeModulesDelete(resp *http.Response) (result EdgeModulesDeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulesget_autorest.go similarity index 64% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulesget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulesget_autorest.go index 0671cb79c1b42..7456b2b153749 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemodulesget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemodulesget_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "context" @@ -17,22 +17,22 @@ type EdgeModulesGetOperationResponse struct { } // EdgeModulesGet ... -func (c VideoAnalyzerClient) EdgeModulesGet(ctx context.Context, id EdgeModuleId) (result EdgeModulesGetOperationResponse, err error) { +func (c EdgeModulesClient) EdgeModulesGet(ctx context.Context, id EdgeModuleId) (result EdgeModulesGetOperationResponse, err error) { req, err := c.preparerForEdgeModulesGet(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesGet", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesGet", result.HttpResponse, "Failure sending request") return } result, err = c.responderForEdgeModulesGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesGet", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c VideoAnalyzerClient) EdgeModulesGet(ctx context.Context, id EdgeModuleId } // preparerForEdgeModulesGet prepares the EdgeModulesGet request. -func (c VideoAnalyzerClient) preparerForEdgeModulesGet(ctx context.Context, id EdgeModuleId) (*http.Request, error) { +func (c EdgeModulesClient) preparerForEdgeModulesGet(ctx context.Context, id EdgeModuleId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c VideoAnalyzerClient) preparerForEdgeModulesGet(ctx context.Context, id E // responderForEdgeModulesGet handles the response to the EdgeModulesGet request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForEdgeModulesGet(resp *http.Response) (result EdgeModulesGetOperationResponse, err error) { +func (c EdgeModulesClient) responderForEdgeModulesGet(resp *http.Response) (result EdgeModulesGetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemoduleslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemoduleslist_autorest.go similarity index 73% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemoduleslist_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemoduleslist_autorest.go index 41f3f31b1af7a..9d99a07be6abf 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemoduleslist_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemoduleslist_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "context" @@ -72,29 +72,29 @@ func (o EdgeModulesListOperationOptions) toQueryString() map[string]interface{} } // EdgeModulesList ... -func (c VideoAnalyzerClient) EdgeModulesList(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions) (resp EdgeModulesListOperationResponse, err error) { +func (c EdgeModulesClient) EdgeModulesList(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions) (resp EdgeModulesListOperationResponse, err error) { req, err := c.preparerForEdgeModulesList(ctx, id, options) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesList", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesList", nil, "Failure preparing request") return } resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesList", resp.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesList", resp.HttpResponse, "Failure sending request") return } resp, err = c.responderForEdgeModulesList(resp.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesList", resp.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesList", resp.HttpResponse, "Failure responding to request") return } return } // preparerForEdgeModulesList prepares the EdgeModulesList request. -func (c VideoAnalyzerClient) preparerForEdgeModulesList(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions) (*http.Request, error) { +func (c EdgeModulesClient) preparerForEdgeModulesList(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -114,7 +114,7 @@ func (c VideoAnalyzerClient) preparerForEdgeModulesList(ctx context.Context, id } // preparerForEdgeModulesListWithNextLink prepares the EdgeModulesList request with the given nextLink token. -func (c VideoAnalyzerClient) preparerForEdgeModulesListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { +func (c EdgeModulesClient) preparerForEdgeModulesListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { uri, err := url.Parse(nextLink) if err != nil { return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) @@ -140,7 +140,7 @@ func (c VideoAnalyzerClient) preparerForEdgeModulesListWithNextLink(ctx context. // responderForEdgeModulesList handles the response to the EdgeModulesList request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForEdgeModulesList(resp *http.Response) (result EdgeModulesListOperationResponse, err error) { +func (c EdgeModulesClient) responderForEdgeModulesList(resp *http.Response) (result EdgeModulesListOperationResponse, err error) { type page struct { Values []EdgeModuleEntity `json:"value"` NextLink *string `json:"@nextLink"` @@ -158,19 +158,19 @@ func (c VideoAnalyzerClient) responderForEdgeModulesList(resp *http.Response) (r result.nextPageFunc = func(ctx context.Context, nextLink string) (result EdgeModulesListOperationResponse, err error) { req, err := c.preparerForEdgeModulesListWithNextLink(ctx, nextLink) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesList", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesList", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesList", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesList", result.HttpResponse, "Failure sending request") return } result, err = c.responderForEdgeModulesList(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesList", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesList", result.HttpResponse, "Failure responding to request") return } @@ -181,12 +181,12 @@ func (c VideoAnalyzerClient) responderForEdgeModulesList(resp *http.Response) (r } // EdgeModulesListComplete retrieves all of the results into a single object -func (c VideoAnalyzerClient) EdgeModulesListComplete(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions) (EdgeModulesListCompleteResult, error) { +func (c EdgeModulesClient) EdgeModulesListComplete(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions) (EdgeModulesListCompleteResult, error) { return c.EdgeModulesListCompleteMatchingPredicate(ctx, id, options, EdgeModuleEntityOperationPredicate{}) } // EdgeModulesListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c VideoAnalyzerClient) EdgeModulesListCompleteMatchingPredicate(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions, predicate EdgeModuleEntityOperationPredicate) (resp EdgeModulesListCompleteResult, err error) { +func (c EdgeModulesClient) EdgeModulesListCompleteMatchingPredicate(ctx context.Context, id VideoAnalyzerId, options EdgeModulesListOperationOptions, predicate EdgeModuleEntityOperationPredicate) (resp EdgeModulesListCompleteResult, err error) { items := make([]EdgeModuleEntity, 0) page, err := c.EdgeModulesList(ctx, id, options) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemoduleslistprovisioningtoken_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemoduleslistprovisioningtoken_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemoduleslistprovisioningtoken_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemoduleslistprovisioningtoken_autorest.go index c1d136886f1b0..b519ad431c241 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_edgemoduleslistprovisioningtoken_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/method_edgemoduleslistprovisioningtoken_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "context" @@ -18,22 +18,22 @@ type EdgeModulesListProvisioningTokenOperationResponse struct { } // EdgeModulesListProvisioningToken ... -func (c VideoAnalyzerClient) EdgeModulesListProvisioningToken(ctx context.Context, id EdgeModuleId, input ListProvisioningTokenInput) (result EdgeModulesListProvisioningTokenOperationResponse, err error) { +func (c EdgeModulesClient) EdgeModulesListProvisioningToken(ctx context.Context, id EdgeModuleId, input ListProvisioningTokenInput) (result EdgeModulesListProvisioningTokenOperationResponse, err error) { req, err := c.preparerForEdgeModulesListProvisioningToken(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesListProvisioningToken", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesListProvisioningToken", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesListProvisioningToken", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesListProvisioningToken", result.HttpResponse, "Failure sending request") return } result, err = c.responderForEdgeModulesListProvisioningToken(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "EdgeModulesListProvisioningToken", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "edgemodules.EdgeModulesClient", "EdgeModulesListProvisioningToken", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c VideoAnalyzerClient) EdgeModulesListProvisioningToken(ctx context.Contex } // preparerForEdgeModulesListProvisioningToken prepares the EdgeModulesListProvisioningToken request. -func (c VideoAnalyzerClient) preparerForEdgeModulesListProvisioningToken(ctx context.Context, id EdgeModuleId, input ListProvisioningTokenInput) (*http.Request, error) { +func (c EdgeModulesClient) preparerForEdgeModulesListProvisioningToken(ctx context.Context, id EdgeModuleId, input ListProvisioningTokenInput) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c VideoAnalyzerClient) preparerForEdgeModulesListProvisioningToken(ctx con // responderForEdgeModulesListProvisioningToken handles the response to the EdgeModulesListProvisioningToken request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForEdgeModulesListProvisioningToken(resp *http.Response) (result EdgeModulesListProvisioningTokenOperationResponse, err error) { +func (c EdgeModulesClient) responderForEdgeModulesListProvisioningToken(resp *http.Response) (result EdgeModulesListProvisioningTokenOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleentity.go similarity index 96% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleentity.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleentity.go index 5e8efb0a55214..d1a3fa65bcb67 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleentity.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleentity.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleproperties.go similarity index 91% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleproperties.go index 1e0ebbdca4494..dd298c382ab84 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleproperties.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleprovisioningtoken.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleprovisioningtoken.go similarity index 97% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleprovisioningtoken.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleprovisioningtoken.go index 7c1a40996c61c..86022d2bf166c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_edgemoduleprovisioningtoken.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_edgemoduleprovisioningtoken.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "time" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_listprovisioningtokeninput.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_listprovisioningtokeninput.go similarity index 96% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_listprovisioningtokeninput.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_listprovisioningtokeninput.go index 3634f3f4014e2..ae06f6b8fdeeb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_listprovisioningtokeninput.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/model_listprovisioningtokeninput.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import ( "time" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/predicates.go new file mode 100644 index 0000000000000..ef1784802790e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/predicates.go @@ -0,0 +1,24 @@ +package edgemodules + +type EdgeModuleEntityOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p EdgeModuleEntityOperationPredicate) Matches(input EdgeModuleEntity) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/version.go similarity index 70% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/version.go index 2f8fb11b3b7e4..037c0dfcd38c8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/version.go @@ -1,4 +1,4 @@ -package videoanalyzer +package edgemodules import "fmt" @@ -8,5 +8,5 @@ import "fmt" const defaultApiVersion = "2021-05-01-preview" func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/videoanalyzer/%s", defaultApiVersion) + return fmt.Sprintf("hashicorp/go-azure-sdk/edgemodules/%s", defaultApiVersion) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/README.md deleted file mode 100644 index d49b019437027..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/README.md +++ /dev/null @@ -1,457 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer` Documentation - -The `videoanalyzer` SDK allows for interaction with the Azure Resource Manager Service `videoanalyzer` (API Version `2021-05-01-preview`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer" -``` - - -### Client Initialization - -```go -client := videoanalyzer.NewVideoAnalyzerClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VideoAnalyzerClient.AccessPoliciesCreateOrUpdate` - -```go -ctx := context.TODO() -id := videoanalyzer.NewAccessPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "accessPolicyValue") - -payload := videoanalyzer.AccessPolicyEntity{ - // ... -} - - -read, err := client.AccessPoliciesCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.AccessPoliciesDelete` - -```go -ctx := context.TODO() -id := videoanalyzer.NewAccessPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "accessPolicyValue") - -read, err := client.AccessPoliciesDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.AccessPoliciesGet` - -```go -ctx := context.TODO() -id := videoanalyzer.NewAccessPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "accessPolicyValue") - -read, err := client.AccessPoliciesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.AccessPoliciesList` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -// alternatively `client.AccessPoliciesList(ctx, id, videoanalyzer.DefaultAccessPoliciesListOperationOptions())` can be used to do batched pagination -items, err := client.AccessPoliciesListComplete(ctx, id, videoanalyzer.DefaultAccessPoliciesListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VideoAnalyzerClient.AccessPoliciesUpdate` - -```go -ctx := context.TODO() -id := videoanalyzer.NewAccessPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "accessPolicyValue") - -payload := videoanalyzer.AccessPolicyEntity{ - // ... -} - - -read, err := client.AccessPoliciesUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.EdgeModulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := videoanalyzer.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") - -payload := videoanalyzer.EdgeModuleEntity{ - // ... -} - - -read, err := client.EdgeModulesCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.EdgeModulesDelete` - -```go -ctx := context.TODO() -id := videoanalyzer.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") - -read, err := client.EdgeModulesDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.EdgeModulesGet` - -```go -ctx := context.TODO() -id := videoanalyzer.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") - -read, err := client.EdgeModulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.EdgeModulesList` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -// alternatively `client.EdgeModulesList(ctx, id, videoanalyzer.DefaultEdgeModulesListOperationOptions())` can be used to do batched pagination -items, err := client.EdgeModulesListComplete(ctx, id, videoanalyzer.DefaultEdgeModulesListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VideoAnalyzerClient.EdgeModulesListProvisioningToken` - -```go -ctx := context.TODO() -id := videoanalyzer.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "edgeModuleValue") - -payload := videoanalyzer.ListProvisioningTokenInput{ - // ... -} - - -read, err := client.EdgeModulesListProvisioningToken(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.LocationsCheckNameAvailability` - -```go -ctx := context.TODO() -id := videoanalyzer.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := videoanalyzer.CheckNameAvailabilityRequest{ - // ... -} - - -read, err := client.LocationsCheckNameAvailability(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideoAnalyzersCreateOrUpdate` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -payload := videoanalyzer.VideoAnalyzer{ - // ... -} - - -read, err := client.VideoAnalyzersCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideoAnalyzersDelete` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.VideoAnalyzersDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideoAnalyzersGet` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.VideoAnalyzersGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideoAnalyzersList` - -```go -ctx := context.TODO() -id := videoanalyzer.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.VideoAnalyzersList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideoAnalyzersListBySubscription` - -```go -ctx := context.TODO() -id := videoanalyzer.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.VideoAnalyzersListBySubscription(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideoAnalyzersSyncStorageKeys` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -payload := videoanalyzer.SyncStorageKeysInput{ - // ... -} - - -read, err := client.VideoAnalyzersSyncStorageKeys(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideoAnalyzersUpdate` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -payload := videoanalyzer.VideoAnalyzerUpdate{ - // ... -} - - -read, err := client.VideoAnalyzersUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideosCreateOrUpdate` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "videoValue") - -payload := videoanalyzer.VideoEntity{ - // ... -} - - -read, err := client.VideosCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideosDelete` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "videoValue") - -read, err := client.VideosDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideosGet` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "videoValue") - -read, err := client.VideosGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideosList` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -// alternatively `client.VideosList(ctx, id, videoanalyzer.DefaultVideosListOperationOptions())` can be used to do batched pagination -items, err := client.VideosListComplete(ctx, id, videoanalyzer.DefaultVideosListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideosListStreamingToken` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "videoValue") - -read, err := client.VideosListStreamingToken(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VideoAnalyzerClient.VideosUpdate` - -```go -ctx := context.TODO() -id := videoanalyzer.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "videoValue") - -payload := videoanalyzer.VideoEntity{ - // ... -} - - -read, err := client.VideosUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/constants.go deleted file mode 100644 index 00b7ccc837109..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/constants.go +++ /dev/null @@ -1,199 +0,0 @@ -package videoanalyzer - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPolicyEccAlgo string - -const ( - AccessPolicyEccAlgoESFiveOneTwo AccessPolicyEccAlgo = "ES512" - AccessPolicyEccAlgoESThreeEightFour AccessPolicyEccAlgo = "ES384" - AccessPolicyEccAlgoESTwoFiveSix AccessPolicyEccAlgo = "ES256" -) - -func PossibleValuesForAccessPolicyEccAlgo() []string { - return []string{ - string(AccessPolicyEccAlgoESFiveOneTwo), - string(AccessPolicyEccAlgoESThreeEightFour), - string(AccessPolicyEccAlgoESTwoFiveSix), - } -} - -func parseAccessPolicyEccAlgo(input string) (*AccessPolicyEccAlgo, error) { - vals := map[string]AccessPolicyEccAlgo{ - "es512": AccessPolicyEccAlgoESFiveOneTwo, - "es384": AccessPolicyEccAlgoESThreeEightFour, - "es256": AccessPolicyEccAlgoESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AccessPolicyEccAlgo(input) - return &out, nil -} - -type AccessPolicyRole string - -const ( - AccessPolicyRoleReader AccessPolicyRole = "Reader" -) - -func PossibleValuesForAccessPolicyRole() []string { - return []string{ - string(AccessPolicyRoleReader), - } -} - -func parseAccessPolicyRole(input string) (*AccessPolicyRole, error) { - vals := map[string]AccessPolicyRole{ - "reader": AccessPolicyRoleReader, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AccessPolicyRole(input) - return &out, nil -} - -type AccessPolicyRsaAlgo string - -const ( - AccessPolicyRsaAlgoRSFiveOneTwo AccessPolicyRsaAlgo = "RS512" - AccessPolicyRsaAlgoRSThreeEightFour AccessPolicyRsaAlgo = "RS384" - AccessPolicyRsaAlgoRSTwoFiveSix AccessPolicyRsaAlgo = "RS256" -) - -func PossibleValuesForAccessPolicyRsaAlgo() []string { - return []string{ - string(AccessPolicyRsaAlgoRSFiveOneTwo), - string(AccessPolicyRsaAlgoRSThreeEightFour), - string(AccessPolicyRsaAlgoRSTwoFiveSix), - } -} - -func parseAccessPolicyRsaAlgo(input string) (*AccessPolicyRsaAlgo, error) { - vals := map[string]AccessPolicyRsaAlgo{ - "rs512": AccessPolicyRsaAlgoRSFiveOneTwo, - "rs384": AccessPolicyRsaAlgoRSThreeEightFour, - "rs256": AccessPolicyRsaAlgoRSTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AccessPolicyRsaAlgo(input) - return &out, nil -} - -type AccountEncryptionKeyType string - -const ( - AccountEncryptionKeyTypeCustomerKey AccountEncryptionKeyType = "CustomerKey" - AccountEncryptionKeyTypeSystemKey AccountEncryptionKeyType = "SystemKey" -) - -func PossibleValuesForAccountEncryptionKeyType() []string { - return []string{ - string(AccountEncryptionKeyTypeCustomerKey), - string(AccountEncryptionKeyTypeSystemKey), - } -} - -func parseAccountEncryptionKeyType(input string) (*AccountEncryptionKeyType, error) { - vals := map[string]AccountEncryptionKeyType{ - "customerkey": AccountEncryptionKeyTypeCustomerKey, - "systemkey": AccountEncryptionKeyTypeSystemKey, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AccountEncryptionKeyType(input) - return &out, nil -} - -type CheckNameAvailabilityReason string - -const ( - CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists" - CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" -) - -func PossibleValuesForCheckNameAvailabilityReason() []string { - return []string{ - string(CheckNameAvailabilityReasonAlreadyExists), - string(CheckNameAvailabilityReasonInvalid), - } -} - -func parseCheckNameAvailabilityReason(input string) (*CheckNameAvailabilityReason, error) { - vals := map[string]CheckNameAvailabilityReason{ - "alreadyexists": CheckNameAvailabilityReasonAlreadyExists, - "invalid": CheckNameAvailabilityReasonInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CheckNameAvailabilityReason(input) - return &out, nil -} - -type VideoAnalyzerEndpointType string - -const ( - VideoAnalyzerEndpointTypeClientApi VideoAnalyzerEndpointType = "ClientApi" -) - -func PossibleValuesForVideoAnalyzerEndpointType() []string { - return []string{ - string(VideoAnalyzerEndpointTypeClientApi), - } -} - -func parseVideoAnalyzerEndpointType(input string) (*VideoAnalyzerEndpointType, error) { - vals := map[string]VideoAnalyzerEndpointType{ - "clientapi": VideoAnalyzerEndpointTypeClientApi, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VideoAnalyzerEndpointType(input) - return &out, nil -} - -type VideoType string - -const ( - VideoTypeArchive VideoType = "Archive" -) - -func PossibleValuesForVideoType() []string { - return []string{ - string(VideoTypeArchive), - } -} - -func parseVideoType(input string) (*VideoType, error) { - vals := map[string]VideoType{ - "archive": VideoTypeArchive, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VideoType(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_accesspolicies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_accesspolicies.go deleted file mode 100644 index 858b038713c4c..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_accesspolicies.go +++ /dev/null @@ -1,137 +0,0 @@ -package videoanalyzer - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = AccessPoliciesId{} - -// AccessPoliciesId is a struct representing the Resource ID for a Access Policies -type AccessPoliciesId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - AccessPolicyName string -} - -// NewAccessPoliciesID returns a new AccessPoliciesId struct -func NewAccessPoliciesID(subscriptionId string, resourceGroupName string, accountName string, accessPolicyName string) AccessPoliciesId { - return AccessPoliciesId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - AccessPolicyName: accessPolicyName, - } -} - -// ParseAccessPoliciesID parses 'input' into a AccessPoliciesId -func ParseAccessPoliciesID(input string) (*AccessPoliciesId, error) { - parser := resourceids.NewParserFromResourceIdType(AccessPoliciesId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := AccessPoliciesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.AccessPolicyName, ok = parsed.Parsed["accessPolicyName"]; !ok { - return nil, fmt.Errorf("the segment 'accessPolicyName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseAccessPoliciesIDInsensitively parses 'input' case-insensitively into a AccessPoliciesId -// note: this method should only be used for API response data and not user input -func ParseAccessPoliciesIDInsensitively(input string) (*AccessPoliciesId, error) { - parser := resourceids.NewParserFromResourceIdType(AccessPoliciesId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := AccessPoliciesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.AccessPolicyName, ok = parsed.Parsed["accessPolicyName"]; !ok { - return nil, fmt.Errorf("the segment 'accessPolicyName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateAccessPoliciesID checks that 'input' can be parsed as a Access Policies ID -func ValidateAccessPoliciesID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseAccessPoliciesID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Access Policies ID -func (id AccessPoliciesId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Media/videoAnalyzers/%s/accessPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.AccessPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Access Policies ID -func (id AccessPoliciesId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), - resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticAccessPolicies", "accessPolicies", "accessPolicies"), - resourceids.UserSpecifiedSegment("accessPolicyName", "accessPolicyValue"), - } -} - -// String returns a human-readable description of this Access Policies ID -func (id AccessPoliciesId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Access Policy Name: %q", id.AccessPolicyName), - } - return fmt.Sprintf("Access Policies (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciescreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciescreateorupdate_autorest.go deleted file mode 100644 index c0456bc59ebd6..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciescreateorupdate_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package videoanalyzer - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPoliciesCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - Model *AccessPolicyEntity -} - -// AccessPoliciesCreateOrUpdate ... -func (c VideoAnalyzerClient) AccessPoliciesCreateOrUpdate(ctx context.Context, id AccessPoliciesId, input AccessPolicyEntity) (result AccessPoliciesCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForAccessPoliciesCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesCreateOrUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccessPoliciesCreateOrUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesCreateOrUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForAccessPoliciesCreateOrUpdate prepares the AccessPoliciesCreateOrUpdate request. -func (c VideoAnalyzerClient) preparerForAccessPoliciesCreateOrUpdate(ctx context.Context, id AccessPoliciesId, input AccessPolicyEntity) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccessPoliciesCreateOrUpdate handles the response to the AccessPoliciesCreateOrUpdate request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForAccessPoliciesCreateOrUpdate(resp *http.Response) (result AccessPoliciesCreateOrUpdateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesdelete_autorest.go deleted file mode 100644 index 945eee1215346..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesdelete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package videoanalyzer - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPoliciesDeleteOperationResponse struct { - HttpResponse *http.Response -} - -// AccessPoliciesDelete ... -func (c VideoAnalyzerClient) AccessPoliciesDelete(ctx context.Context, id AccessPoliciesId) (result AccessPoliciesDeleteOperationResponse, err error) { - req, err := c.preparerForAccessPoliciesDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesDelete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesDelete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccessPoliciesDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesDelete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForAccessPoliciesDelete prepares the AccessPoliciesDelete request. -func (c VideoAnalyzerClient) preparerForAccessPoliciesDelete(ctx context.Context, id AccessPoliciesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccessPoliciesDelete handles the response to the AccessPoliciesDelete request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForAccessPoliciesDelete(resp *http.Response) (result AccessPoliciesDeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesget_autorest.go deleted file mode 100644 index 7239c195542c5..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesget_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package videoanalyzer - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPoliciesGetOperationResponse struct { - HttpResponse *http.Response - Model *AccessPolicyEntity -} - -// AccessPoliciesGet ... -func (c VideoAnalyzerClient) AccessPoliciesGet(ctx context.Context, id AccessPoliciesId) (result AccessPoliciesGetOperationResponse, err error) { - req, err := c.preparerForAccessPoliciesGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccessPoliciesGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForAccessPoliciesGet prepares the AccessPoliciesGet request. -func (c VideoAnalyzerClient) preparerForAccessPoliciesGet(ctx context.Context, id AccessPoliciesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccessPoliciesGet handles the response to the AccessPoliciesGet request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForAccessPoliciesGet(resp *http.Response) (result AccessPoliciesGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspolicieslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspolicieslist_autorest.go deleted file mode 100644 index 0fb820dcefeb1..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspolicieslist_autorest.go +++ /dev/null @@ -1,215 +0,0 @@ -package videoanalyzer - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPoliciesListOperationResponse struct { - HttpResponse *http.Response - Model *[]AccessPolicyEntity - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (AccessPoliciesListOperationResponse, error) -} - -type AccessPoliciesListCompleteResult struct { - Items []AccessPolicyEntity -} - -func (r AccessPoliciesListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r AccessPoliciesListOperationResponse) LoadMore(ctx context.Context) (resp AccessPoliciesListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type AccessPoliciesListOperationOptions struct { - Top *int64 -} - -func DefaultAccessPoliciesListOperationOptions() AccessPoliciesListOperationOptions { - return AccessPoliciesListOperationOptions{} -} - -func (o AccessPoliciesListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o AccessPoliciesListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Top != nil { - out["$top"] = *o.Top - } - - return out -} - -// AccessPoliciesList ... -func (c VideoAnalyzerClient) AccessPoliciesList(ctx context.Context, id VideoAnalyzerId, options AccessPoliciesListOperationOptions) (resp AccessPoliciesListOperationResponse, err error) { - req, err := c.preparerForAccessPoliciesList(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForAccessPoliciesList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForAccessPoliciesList prepares the AccessPoliciesList request. -func (c VideoAnalyzerClient) preparerForAccessPoliciesList(ctx context.Context, id VideoAnalyzerId, options AccessPoliciesListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/accessPolicies", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForAccessPoliciesListWithNextLink prepares the AccessPoliciesList request with the given nextLink token. -func (c VideoAnalyzerClient) preparerForAccessPoliciesListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccessPoliciesList handles the response to the AccessPoliciesList request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForAccessPoliciesList(resp *http.Response) (result AccessPoliciesListOperationResponse, err error) { - type page struct { - Values []AccessPolicyEntity `json:"value"` - NextLink *string `json:"@nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccessPoliciesListOperationResponse, err error) { - req, err := c.preparerForAccessPoliciesListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccessPoliciesList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// AccessPoliciesListComplete retrieves all of the results into a single object -func (c VideoAnalyzerClient) AccessPoliciesListComplete(ctx context.Context, id VideoAnalyzerId, options AccessPoliciesListOperationOptions) (AccessPoliciesListCompleteResult, error) { - return c.AccessPoliciesListCompleteMatchingPredicate(ctx, id, options, AccessPolicyEntityOperationPredicate{}) -} - -// AccessPoliciesListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c VideoAnalyzerClient) AccessPoliciesListCompleteMatchingPredicate(ctx context.Context, id VideoAnalyzerId, options AccessPoliciesListOperationOptions, predicate AccessPolicyEntityOperationPredicate) (resp AccessPoliciesListCompleteResult, err error) { - items := make([]AccessPolicyEntity, 0) - - page, err := c.AccessPoliciesList(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := AccessPoliciesListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesupdate_autorest.go deleted file mode 100644 index 74d5eeb96b7bf..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_accesspoliciesupdate_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package videoanalyzer - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPoliciesUpdateOperationResponse struct { - HttpResponse *http.Response - Model *AccessPolicyEntity -} - -// AccessPoliciesUpdate ... -func (c VideoAnalyzerClient) AccessPoliciesUpdate(ctx context.Context, id AccessPoliciesId, input AccessPolicyEntity) (result AccessPoliciesUpdateOperationResponse, err error) { - req, err := c.preparerForAccessPoliciesUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccessPoliciesUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "AccessPoliciesUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForAccessPoliciesUpdate prepares the AccessPoliciesUpdate request. -func (c VideoAnalyzerClient) preparerForAccessPoliciesUpdate(ctx context.Context, id AccessPoliciesId, input AccessPolicyEntity) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccessPoliciesUpdate handles the response to the AccessPoliciesUpdate request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForAccessPoliciesUpdate(resp *http.Response) (result AccessPoliciesUpdateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoscreateorupdate_autorest.go deleted file mode 100644 index e660981067852..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoscreateorupdate_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package videoanalyzer - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VideosCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - Model *VideoEntity -} - -// VideosCreateOrUpdate ... -func (c VideoAnalyzerClient) VideosCreateOrUpdate(ctx context.Context, id VideoId, input VideoEntity) (result VideosCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForVideosCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosCreateOrUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVideosCreateOrUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosCreateOrUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVideosCreateOrUpdate prepares the VideosCreateOrUpdate request. -func (c VideoAnalyzerClient) preparerForVideosCreateOrUpdate(ctx context.Context, id VideoId, input VideoEntity) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVideosCreateOrUpdate handles the response to the VideosCreateOrUpdate request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideosCreateOrUpdate(resp *http.Response) (result VideosCreateOrUpdateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosdelete_autorest.go deleted file mode 100644 index 0ff16b8a5e430..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosdelete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package videoanalyzer - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VideosDeleteOperationResponse struct { - HttpResponse *http.Response -} - -// VideosDelete ... -func (c VideoAnalyzerClient) VideosDelete(ctx context.Context, id VideoId) (result VideosDeleteOperationResponse, err error) { - req, err := c.preparerForVideosDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosDelete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosDelete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVideosDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosDelete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVideosDelete prepares the VideosDelete request. -func (c VideoAnalyzerClient) preparerForVideosDelete(ctx context.Context, id VideoId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVideosDelete handles the response to the VideosDelete request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideosDelete(resp *http.Response) (result VideosDeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoslist_autorest.go deleted file mode 100644 index 887b866cb8ebf..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoslist_autorest.go +++ /dev/null @@ -1,215 +0,0 @@ -package videoanalyzer - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VideosListOperationResponse struct { - HttpResponse *http.Response - Model *[]VideoEntity - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (VideosListOperationResponse, error) -} - -type VideosListCompleteResult struct { - Items []VideoEntity -} - -func (r VideosListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r VideosListOperationResponse) LoadMore(ctx context.Context) (resp VideosListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type VideosListOperationOptions struct { - Top *int64 -} - -func DefaultVideosListOperationOptions() VideosListOperationOptions { - return VideosListOperationOptions{} -} - -func (o VideosListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o VideosListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Top != nil { - out["$top"] = *o.Top - } - - return out -} - -// VideosList ... -func (c VideoAnalyzerClient) VideosList(ctx context.Context, id VideoAnalyzerId, options VideosListOperationOptions) (resp VideosListOperationResponse, err error) { - req, err := c.preparerForVideosList(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForVideosList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForVideosList prepares the VideosList request. -func (c VideoAnalyzerClient) preparerForVideosList(ctx context.Context, id VideoAnalyzerId, options VideosListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/videos", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForVideosListWithNextLink prepares the VideosList request with the given nextLink token. -func (c VideoAnalyzerClient) preparerForVideosListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVideosList handles the response to the VideosList request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideosList(resp *http.Response) (result VideosListOperationResponse, err error) { - type page struct { - Values []VideoEntity `json:"value"` - NextLink *string `json:"@nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result VideosListOperationResponse, err error) { - req, err := c.preparerForVideosListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVideosList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// VideosListComplete retrieves all of the results into a single object -func (c VideoAnalyzerClient) VideosListComplete(ctx context.Context, id VideoAnalyzerId, options VideosListOperationOptions) (VideosListCompleteResult, error) { - return c.VideosListCompleteMatchingPredicate(ctx, id, options, VideoEntityOperationPredicate{}) -} - -// VideosListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c VideoAnalyzerClient) VideosListCompleteMatchingPredicate(ctx context.Context, id VideoAnalyzerId, options VideosListOperationOptions, predicate VideoEntityOperationPredicate) (resp VideosListCompleteResult, err error) { - items := make([]VideoEntity, 0) - - page, err := c.VideosList(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := VideosListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosliststreamingtoken_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosliststreamingtoken_autorest.go deleted file mode 100644 index 3d8c269d30e97..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosliststreamingtoken_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package videoanalyzer - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VideosListStreamingTokenOperationResponse struct { - HttpResponse *http.Response - Model *VideoStreamingToken -} - -// VideosListStreamingToken ... -func (c VideoAnalyzerClient) VideosListStreamingToken(ctx context.Context, id VideoId) (result VideosListStreamingTokenOperationResponse, err error) { - req, err := c.preparerForVideosListStreamingToken(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosListStreamingToken", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosListStreamingToken", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVideosListStreamingToken(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosListStreamingToken", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVideosListStreamingToken prepares the VideosListStreamingToken request. -func (c VideoAnalyzerClient) preparerForVideosListStreamingToken(ctx context.Context, id VideoId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/listStreamingToken", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVideosListStreamingToken handles the response to the VideosListStreamingToken request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideosListStreamingToken(resp *http.Response) (result VideosListStreamingTokenOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosupdate_autorest.go deleted file mode 100644 index 1c5d0498159b9..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videosupdate_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package videoanalyzer - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VideosUpdateOperationResponse struct { - HttpResponse *http.Response - Model *VideoEntity -} - -// VideosUpdate ... -func (c VideoAnalyzerClient) VideosUpdate(ctx context.Context, id VideoId, input VideoEntity) (result VideosUpdateOperationResponse, err error) { - req, err := c.preparerForVideosUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVideosUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideosUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVideosUpdate prepares the VideosUpdate request. -func (c VideoAnalyzerClient) preparerForVideosUpdate(ctx context.Context, id VideoId, input VideoEntity) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVideosUpdate handles the response to the VideosUpdate request. The method always -// closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideosUpdate(resp *http.Response) (result VideosUpdateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accesspolicyentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accesspolicyentity.go deleted file mode 100644 index ffcd0a25c959b..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accesspolicyentity.go +++ /dev/null @@ -1,16 +0,0 @@ -package videoanalyzer - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPolicyEntity struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AccessPolicyProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accesspolicyproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accesspolicyproperties.go deleted file mode 100644 index b2d12bfc6ef96..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accesspolicyproperties.go +++ /dev/null @@ -1,40 +0,0 @@ -package videoanalyzer - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessPolicyProperties struct { - Authentication AuthenticationBase `json:"authentication"` - Role *AccessPolicyRole `json:"role,omitempty"` -} - -var _ json.Unmarshaler = &AccessPolicyProperties{} - -func (s *AccessPolicyProperties) UnmarshalJSON(bytes []byte) error { - type alias AccessPolicyProperties - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into AccessPolicyProperties: %+v", err) - } - - s.Role = decoded.Role - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling AccessPolicyProperties into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["authentication"]; ok { - impl, err := unmarshalAuthenticationBaseImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Authentication' for 'AccessPolicyProperties': %+v", err) - } - s.Authentication = impl - } - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_authenticationbase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_authenticationbase.go deleted file mode 100644 index d6d7b9f9ad6c8..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_authenticationbase.go +++ /dev/null @@ -1,48 +0,0 @@ -package videoanalyzer - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AuthenticationBase interface { -} - -func unmarshalAuthenticationBaseImplementation(input []byte) (AuthenticationBase, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AuthenticationBase into map[string]interface: %+v", err) - } - - value, ok := temp["@type"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "#Microsoft.VideoAnalyzer.JwtAuthentication") { - var out JwtAuthentication - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into JwtAuthentication: %+v", err) - } - return out, nil - } - - type RawAuthenticationBaseImpl struct { - Type string `json:"-"` - Values map[string]interface{} `json:"-"` - } - out := RawAuthenticationBaseImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_ecctokenkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_ecctokenkey.go deleted file mode 100644 index 4d1b7f22d934e..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_ecctokenkey.go +++ /dev/null @@ -1,44 +0,0 @@ -package videoanalyzer - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ TokenKey = EccTokenKey{} - -type EccTokenKey struct { - Alg AccessPolicyEccAlgo `json:"alg"` - X string `json:"x"` - Y string `json:"y"` - - // Fields inherited from TokenKey - Kid string `json:"kid"` -} - -var _ json.Marshaler = EccTokenKey{} - -func (s EccTokenKey) MarshalJSON() ([]byte, error) { - type wrapper EccTokenKey - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EccTokenKey: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EccTokenKey: %+v", err) - } - decoded["@type"] = "#Microsoft.VideoAnalyzer.EccTokenKey" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EccTokenKey: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_jwtauthentication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_jwtauthentication.go deleted file mode 100644 index 20a2bd31646e8..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_jwtauthentication.go +++ /dev/null @@ -1,81 +0,0 @@ -package videoanalyzer - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AuthenticationBase = JwtAuthentication{} - -type JwtAuthentication struct { - Audiences *[]string `json:"audiences,omitempty"` - Claims *[]TokenClaim `json:"claims,omitempty"` - Issuers *[]string `json:"issuers,omitempty"` - Keys *[]TokenKey `json:"keys,omitempty"` - - // Fields inherited from AuthenticationBase -} - -var _ json.Marshaler = JwtAuthentication{} - -func (s JwtAuthentication) MarshalJSON() ([]byte, error) { - type wrapper JwtAuthentication - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling JwtAuthentication: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling JwtAuthentication: %+v", err) - } - decoded["@type"] = "#Microsoft.VideoAnalyzer.JwtAuthentication" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling JwtAuthentication: %+v", err) - } - - return encoded, nil -} - -var _ json.Unmarshaler = &JwtAuthentication{} - -func (s *JwtAuthentication) UnmarshalJSON(bytes []byte) error { - type alias JwtAuthentication - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into JwtAuthentication: %+v", err) - } - - s.Audiences = decoded.Audiences - s.Claims = decoded.Claims - s.Issuers = decoded.Issuers - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling JwtAuthentication into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["keys"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Keys into list []json.RawMessage: %+v", err) - } - - output := make([]TokenKey, 0) - for i, val := range listTemp { - impl, err := unmarshalTokenKeyImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Keys' for 'JwtAuthentication': %+v", i, err) - } - output = append(output, impl) - } - s.Keys = &output - } - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_rsatokenkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_rsatokenkey.go deleted file mode 100644 index 0f0e52f936cb3..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_rsatokenkey.go +++ /dev/null @@ -1,44 +0,0 @@ -package videoanalyzer - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ TokenKey = RsaTokenKey{} - -type RsaTokenKey struct { - Alg AccessPolicyRsaAlgo `json:"alg"` - E string `json:"e"` - N string `json:"n"` - - // Fields inherited from TokenKey - Kid string `json:"kid"` -} - -var _ json.Marshaler = RsaTokenKey{} - -func (s RsaTokenKey) MarshalJSON() ([]byte, error) { - type wrapper RsaTokenKey - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling RsaTokenKey: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling RsaTokenKey: %+v", err) - } - decoded["@type"] = "#Microsoft.VideoAnalyzer.RsaTokenKey" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling RsaTokenKey: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_tokenkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_tokenkey.go deleted file mode 100644 index b629a9935c534..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_tokenkey.go +++ /dev/null @@ -1,56 +0,0 @@ -package videoanalyzer - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TokenKey interface { -} - -func unmarshalTokenKeyImplementation(input []byte) (TokenKey, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling TokenKey into map[string]interface: %+v", err) - } - - value, ok := temp["@type"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "#Microsoft.VideoAnalyzer.EccTokenKey") { - var out EccTokenKey - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EccTokenKey: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "#Microsoft.VideoAnalyzer.RsaTokenKey") { - var out RsaTokenKey - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into RsaTokenKey: %+v", err) - } - return out, nil - } - - type RawTokenKeyImpl struct { - Type string `json:"-"` - Values map[string]interface{} `json:"-"` - } - out := RawTokenKeyImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoproperties.go deleted file mode 100644 index fa59afb91c000..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package videoanalyzer - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VideoProperties struct { - Description *string `json:"description,omitempty"` - Flags *VideoFlags `json:"flags,omitempty"` - MediaInfo *VideoMediaInfo `json:"mediaInfo,omitempty"` - Streaming *VideoStreaming `json:"streaming,omitempty"` - Title *string `json:"title,omitempty"` - Type *VideoType `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videostreamingtoken.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videostreamingtoken.go deleted file mode 100644 index afbe34759367f..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videostreamingtoken.go +++ /dev/null @@ -1,27 +0,0 @@ -package videoanalyzer - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VideoStreamingToken struct { - ExpirationDate *string `json:"expirationDate,omitempty"` - Token *string `json:"token,omitempty"` -} - -func (o *VideoStreamingToken) GetExpirationDateAsTime() (*time.Time, error) { - if o.ExpirationDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ExpirationDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *VideoStreamingToken) SetExpirationDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ExpirationDate = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/predicates.go deleted file mode 100644 index fbb57afb28f86..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/predicates.go +++ /dev/null @@ -1,70 +0,0 @@ -package videoanalyzer - -type AccessPolicyEntityOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p AccessPolicyEntityOperationPredicate) Matches(input AccessPolicyEntity) bool { - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} - -type EdgeModuleEntityOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p EdgeModuleEntityOperationPredicate) Matches(input EdgeModuleEntity) bool { - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} - -type VideoEntityOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p VideoEntityOperationPredicate) Matches(input VideoEntity) bool { - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/README.md new file mode 100644 index 0000000000000..b460d0b5783f6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/README.md @@ -0,0 +1,168 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers` Documentation + +The `videoanalyzers` SDK allows for interaction with the Azure Resource Manager Service `videoanalyzer` (API Version `2021-05-01-preview`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers" +``` + + +### Client Initialization + +```go +client := videoanalyzers.NewVideoAnalyzersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VideoAnalyzersClient.LocationsCheckNameAvailability` + +```go +ctx := context.TODO() +id := videoanalyzers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := videoanalyzers.CheckNameAvailabilityRequest{ + // ... +} + + +read, err := client.LocationsCheckNameAvailability(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VideoAnalyzersClient.VideoAnalyzersCreateOrUpdate` + +```go +ctx := context.TODO() +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := videoanalyzers.VideoAnalyzer{ + // ... +} + + +read, err := client.VideoAnalyzersCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VideoAnalyzersClient.VideoAnalyzersDelete` + +```go +ctx := context.TODO() +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.VideoAnalyzersDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VideoAnalyzersClient.VideoAnalyzersGet` + +```go +ctx := context.TODO() +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.VideoAnalyzersGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VideoAnalyzersClient.VideoAnalyzersList` + +```go +ctx := context.TODO() +id := videoanalyzers.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +read, err := client.VideoAnalyzersList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VideoAnalyzersClient.VideoAnalyzersListBySubscription` + +```go +ctx := context.TODO() +id := videoanalyzers.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.VideoAnalyzersListBySubscription(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VideoAnalyzersClient.VideoAnalyzersSyncStorageKeys` + +```go +ctx := context.TODO() +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := videoanalyzers.SyncStorageKeysInput{ + // ... +} + + +read, err := client.VideoAnalyzersSyncStorageKeys(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VideoAnalyzersClient.VideoAnalyzersUpdate` + +```go +ctx := context.TODO() +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := videoanalyzers.VideoAnalyzerUpdate{ + // ... +} + + +read, err := client.VideoAnalyzersUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/client.go new file mode 100644 index 0000000000000..115344c04b7c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/client.go @@ -0,0 +1,18 @@ +package videoanalyzers + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VideoAnalyzersClient struct { + Client autorest.Client + baseUri string +} + +func NewVideoAnalyzersClientWithBaseURI(endpoint string) VideoAnalyzersClient { + return VideoAnalyzersClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/constants.go new file mode 100644 index 0000000000000..9c9b8fcb36a82 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/constants.go @@ -0,0 +1,87 @@ +package videoanalyzers + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEncryptionKeyType string + +const ( + AccountEncryptionKeyTypeCustomerKey AccountEncryptionKeyType = "CustomerKey" + AccountEncryptionKeyTypeSystemKey AccountEncryptionKeyType = "SystemKey" +) + +func PossibleValuesForAccountEncryptionKeyType() []string { + return []string{ + string(AccountEncryptionKeyTypeCustomerKey), + string(AccountEncryptionKeyTypeSystemKey), + } +} + +func parseAccountEncryptionKeyType(input string) (*AccountEncryptionKeyType, error) { + vals := map[string]AccountEncryptionKeyType{ + "customerkey": AccountEncryptionKeyTypeCustomerKey, + "systemkey": AccountEncryptionKeyTypeSystemKey, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AccountEncryptionKeyType(input) + return &out, nil +} + +type CheckNameAvailabilityReason string + +const ( + CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists" + CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" +) + +func PossibleValuesForCheckNameAvailabilityReason() []string { + return []string{ + string(CheckNameAvailabilityReasonAlreadyExists), + string(CheckNameAvailabilityReasonInvalid), + } +} + +func parseCheckNameAvailabilityReason(input string) (*CheckNameAvailabilityReason, error) { + vals := map[string]CheckNameAvailabilityReason{ + "alreadyexists": CheckNameAvailabilityReasonAlreadyExists, + "invalid": CheckNameAvailabilityReasonInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CheckNameAvailabilityReason(input) + return &out, nil +} + +type VideoAnalyzerEndpointType string + +const ( + VideoAnalyzerEndpointTypeClientApi VideoAnalyzerEndpointType = "ClientApi" +) + +func PossibleValuesForVideoAnalyzerEndpointType() []string { + return []string{ + string(VideoAnalyzerEndpointTypeClientApi), + } +} + +func parseVideoAnalyzerEndpointType(input string) (*VideoAnalyzerEndpointType, error) { + vals := map[string]VideoAnalyzerEndpointType{ + "clientapi": VideoAnalyzerEndpointTypeClientApi, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VideoAnalyzerEndpointType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_location.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_location.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_location.go index 2a9a9f7158847..8405bc97c96a8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_location.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_location.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_video.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_video.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer.go index c6139ec3b3833..9f86b938430e5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/id_video.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "fmt" @@ -7,36 +7,34 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) -var _ resourceids.ResourceId = VideoId{} +var _ resourceids.ResourceId = VideoAnalyzerId{} -// VideoId is a struct representing the Resource ID for a Video -type VideoId struct { +// VideoAnalyzerId is a struct representing the Resource ID for a Video Analyzer +type VideoAnalyzerId struct { SubscriptionId string ResourceGroupName string AccountName string - VideoName string } -// NewVideoID returns a new VideoId struct -func NewVideoID(subscriptionId string, resourceGroupName string, accountName string, videoName string) VideoId { - return VideoId{ +// NewVideoAnalyzerID returns a new VideoAnalyzerId struct +func NewVideoAnalyzerID(subscriptionId string, resourceGroupName string, accountName string) VideoAnalyzerId { + return VideoAnalyzerId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, AccountName: accountName, - VideoName: videoName, } } -// ParseVideoID parses 'input' into a VideoId -func ParseVideoID(input string) (*VideoId, error) { - parser := resourceids.NewParserFromResourceIdType(VideoId{}) +// ParseVideoAnalyzerID parses 'input' into a VideoAnalyzerId +func ParseVideoAnalyzerID(input string) (*VideoAnalyzerId, error) { + parser := resourceids.NewParserFromResourceIdType(VideoAnalyzerId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } var ok bool - id := VideoId{} + id := VideoAnalyzerId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) @@ -50,24 +48,20 @@ func ParseVideoID(input string) (*VideoId, error) { return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) } - if id.VideoName, ok = parsed.Parsed["videoName"]; !ok { - return nil, fmt.Errorf("the segment 'videoName' was not found in the resource id %q", input) - } - return &id, nil } -// ParseVideoIDInsensitively parses 'input' case-insensitively into a VideoId +// ParseVideoAnalyzerIDInsensitively parses 'input' case-insensitively into a VideoAnalyzerId // note: this method should only be used for API response data and not user input -func ParseVideoIDInsensitively(input string) (*VideoId, error) { - parser := resourceids.NewParserFromResourceIdType(VideoId{}) +func ParseVideoAnalyzerIDInsensitively(input string) (*VideoAnalyzerId, error) { + parser := resourceids.NewParserFromResourceIdType(VideoAnalyzerId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } var ok bool - id := VideoId{} + id := VideoAnalyzerId{} if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) @@ -81,36 +75,32 @@ func ParseVideoIDInsensitively(input string) (*VideoId, error) { return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) } - if id.VideoName, ok = parsed.Parsed["videoName"]; !ok { - return nil, fmt.Errorf("the segment 'videoName' was not found in the resource id %q", input) - } - return &id, nil } -// ValidateVideoID checks that 'input' can be parsed as a Video ID -func ValidateVideoID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateVideoAnalyzerID checks that 'input' can be parsed as a Video Analyzer ID +func ValidateVideoAnalyzerID(input interface{}, key string) (warnings []string, errors []error) { v, ok := input.(string) if !ok { errors = append(errors, fmt.Errorf("expected %q to be a string", key)) return } - if _, err := ParseVideoID(v); err != nil { + if _, err := ParseVideoAnalyzerID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Video ID -func (id VideoId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Media/videoAnalyzers/%s/videos/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VideoName) +// ID returns the formatted Video Analyzer ID +func (id VideoAnalyzerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Media/videoAnalyzers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) } -// Segments returns a slice of Resource ID Segments which comprise this Video ID -func (id VideoId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Video Analyzer ID +func (id VideoAnalyzerId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -120,18 +110,15 @@ func (id VideoId) Segments() []resourceids.Segment { resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticVideos", "videos", "videos"), - resourceids.UserSpecifiedSegment("videoName", "videoValue"), } } -// String returns a human-readable description of this Video ID -func (id VideoId) String() string { +// String returns a human-readable description of this Video Analyzer ID +func (id VideoAnalyzerId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Video Name: %q", id.VideoName), } - return fmt.Sprintf("Video (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Video Analyzer (%s)", strings.Join(components, "\n")) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_locationschecknameavailability_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_locationschecknameavailability_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_locationschecknameavailability_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_locationschecknameavailability_autorest.go index fd02bcc551d24..a2c647e30ee2c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_locationschecknameavailability_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_locationschecknameavailability_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -18,22 +18,22 @@ type LocationsCheckNameAvailabilityOperationResponse struct { } // LocationsCheckNameAvailability ... -func (c VideoAnalyzerClient) LocationsCheckNameAvailability(ctx context.Context, id LocationId, input CheckNameAvailabilityRequest) (result LocationsCheckNameAvailabilityOperationResponse, err error) { +func (c VideoAnalyzersClient) LocationsCheckNameAvailability(ctx context.Context, id LocationId, input CheckNameAvailabilityRequest) (result LocationsCheckNameAvailabilityOperationResponse, err error) { req, err := c.preparerForLocationsCheckNameAvailability(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "LocationsCheckNameAvailability", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "LocationsCheckNameAvailability", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "LocationsCheckNameAvailability", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "LocationsCheckNameAvailability", result.HttpResponse, "Failure sending request") return } result, err = c.responderForLocationsCheckNameAvailability(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "LocationsCheckNameAvailability", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "LocationsCheckNameAvailability", result.HttpResponse, "Failure responding to request") return } @@ -41,7 +41,7 @@ func (c VideoAnalyzerClient) LocationsCheckNameAvailability(ctx context.Context, } // preparerForLocationsCheckNameAvailability prepares the LocationsCheckNameAvailability request. -func (c VideoAnalyzerClient) preparerForLocationsCheckNameAvailability(ctx context.Context, id LocationId, input CheckNameAvailabilityRequest) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForLocationsCheckNameAvailability(ctx context.Context, id LocationId, input CheckNameAvailabilityRequest) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c VideoAnalyzerClient) preparerForLocationsCheckNameAvailability(ctx conte // responderForLocationsCheckNameAvailability handles the response to the LocationsCheckNameAvailability request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForLocationsCheckNameAvailability(resp *http.Response) (result LocationsCheckNameAvailabilityOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForLocationsCheckNameAvailability(resp *http.Response) (result LocationsCheckNameAvailabilityOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerscreateorupdate_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerscreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerscreateorupdate_autorest.go index 09cdb8cc82b25..a993d2730dcd0 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerscreateorupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerscreateorupdate_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -17,22 +17,22 @@ type VideoAnalyzersCreateOrUpdateOperationResponse struct { } // VideoAnalyzersCreateOrUpdate ... -func (c VideoAnalyzerClient) VideoAnalyzersCreateOrUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzer) (result VideoAnalyzersCreateOrUpdateOperationResponse, err error) { +func (c VideoAnalyzersClient) VideoAnalyzersCreateOrUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzer) (result VideoAnalyzersCreateOrUpdateOperationResponse, err error) { req, err := c.preparerForVideoAnalyzersCreateOrUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersCreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersCreateOrUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersCreateOrUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersCreateOrUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForVideoAnalyzersCreateOrUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersCreateOrUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersCreateOrUpdate", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c VideoAnalyzerClient) VideoAnalyzersCreateOrUpdate(ctx context.Context, i } // preparerForVideoAnalyzersCreateOrUpdate prepares the VideoAnalyzersCreateOrUpdate request. -func (c VideoAnalyzerClient) preparerForVideoAnalyzersCreateOrUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzer) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForVideoAnalyzersCreateOrUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzer) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c VideoAnalyzerClient) preparerForVideoAnalyzersCreateOrUpdate(ctx context // responderForVideoAnalyzersCreateOrUpdate handles the response to the VideoAnalyzersCreateOrUpdate request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideoAnalyzersCreateOrUpdate(resp *http.Response) (result VideoAnalyzersCreateOrUpdateOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForVideoAnalyzersCreateOrUpdate(resp *http.Response) (result VideoAnalyzersCreateOrUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersdelete_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersdelete_autorest.go index 63b67dd003473..4d24a307e2588 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersdelete_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersdelete_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -16,22 +16,22 @@ type VideoAnalyzersDeleteOperationResponse struct { } // VideoAnalyzersDelete ... -func (c VideoAnalyzerClient) VideoAnalyzersDelete(ctx context.Context, id VideoAnalyzerId) (result VideoAnalyzersDeleteOperationResponse, err error) { +func (c VideoAnalyzersClient) VideoAnalyzersDelete(ctx context.Context, id VideoAnalyzerId) (result VideoAnalyzersDeleteOperationResponse, err error) { req, err := c.preparerForVideoAnalyzersDelete(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersDelete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersDelete", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersDelete", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersDelete", result.HttpResponse, "Failure sending request") return } result, err = c.responderForVideoAnalyzersDelete(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersDelete", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersDelete", result.HttpResponse, "Failure responding to request") return } @@ -39,7 +39,7 @@ func (c VideoAnalyzerClient) VideoAnalyzersDelete(ctx context.Context, id VideoA } // preparerForVideoAnalyzersDelete prepares the VideoAnalyzersDelete request. -func (c VideoAnalyzerClient) preparerForVideoAnalyzersDelete(ctx context.Context, id VideoAnalyzerId) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForVideoAnalyzersDelete(ctx context.Context, id VideoAnalyzerId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -55,7 +55,7 @@ func (c VideoAnalyzerClient) preparerForVideoAnalyzersDelete(ctx context.Context // responderForVideoAnalyzersDelete handles the response to the VideoAnalyzersDelete request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideoAnalyzersDelete(resp *http.Response) (result VideoAnalyzersDeleteOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForVideoAnalyzersDelete(resp *http.Response) (result VideoAnalyzersDeleteOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersget_autorest.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersget_autorest.go index 727e0ffb3f350..ba3a4446c7c5c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersget_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -17,22 +17,22 @@ type VideoAnalyzersGetOperationResponse struct { } // VideoAnalyzersGet ... -func (c VideoAnalyzerClient) VideoAnalyzersGet(ctx context.Context, id VideoAnalyzerId) (result VideoAnalyzersGetOperationResponse, err error) { +func (c VideoAnalyzersClient) VideoAnalyzersGet(ctx context.Context, id VideoAnalyzerId) (result VideoAnalyzersGetOperationResponse, err error) { req, err := c.preparerForVideoAnalyzersGet(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersGet", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersGet", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersGet", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersGet", result.HttpResponse, "Failure sending request") return } result, err = c.responderForVideoAnalyzersGet(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersGet", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersGet", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c VideoAnalyzerClient) VideoAnalyzersGet(ctx context.Context, id VideoAnal } // preparerForVideoAnalyzersGet prepares the VideoAnalyzersGet request. -func (c VideoAnalyzerClient) preparerForVideoAnalyzersGet(ctx context.Context, id VideoAnalyzerId) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForVideoAnalyzersGet(ctx context.Context, id VideoAnalyzerId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -56,7 +56,7 @@ func (c VideoAnalyzerClient) preparerForVideoAnalyzersGet(ctx context.Context, i // responderForVideoAnalyzersGet handles the response to the VideoAnalyzersGet request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideoAnalyzersGet(resp *http.Response) (result VideoAnalyzersGetOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForVideoAnalyzersGet(resp *http.Response) (result VideoAnalyzersGetOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerslist_autorest.go similarity index 65% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerslist_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerslist_autorest.go index f67c7fcea31f4..fa6b56028fdc1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerslist_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerslist_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -19,22 +19,22 @@ type VideoAnalyzersListOperationResponse struct { } // VideoAnalyzersList ... -func (c VideoAnalyzerClient) VideoAnalyzersList(ctx context.Context, id commonids.ResourceGroupId) (result VideoAnalyzersListOperationResponse, err error) { +func (c VideoAnalyzersClient) VideoAnalyzersList(ctx context.Context, id commonids.ResourceGroupId) (result VideoAnalyzersListOperationResponse, err error) { req, err := c.preparerForVideoAnalyzersList(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersList", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersList", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersList", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersList", result.HttpResponse, "Failure sending request") return } result, err = c.responderForVideoAnalyzersList(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersList", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersList", result.HttpResponse, "Failure responding to request") return } @@ -42,7 +42,7 @@ func (c VideoAnalyzerClient) VideoAnalyzersList(ctx context.Context, id commonid } // preparerForVideoAnalyzersList prepares the VideoAnalyzersList request. -func (c VideoAnalyzerClient) preparerForVideoAnalyzersList(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForVideoAnalyzersList(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c VideoAnalyzerClient) preparerForVideoAnalyzersList(ctx context.Context, // responderForVideoAnalyzersList handles the response to the VideoAnalyzersList request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideoAnalyzersList(resp *http.Response) (result VideoAnalyzersListOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForVideoAnalyzersList(resp *http.Response) (result VideoAnalyzersListOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerslistbysubscription_autorest.go similarity index 63% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerslistbysubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerslistbysubscription_autorest.go index 0a2c1e768620f..ff1762177b3ec 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerslistbysubscription_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerslistbysubscription_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -19,22 +19,22 @@ type VideoAnalyzersListBySubscriptionOperationResponse struct { } // VideoAnalyzersListBySubscription ... -func (c VideoAnalyzerClient) VideoAnalyzersListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result VideoAnalyzersListBySubscriptionOperationResponse, err error) { +func (c VideoAnalyzersClient) VideoAnalyzersListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result VideoAnalyzersListBySubscriptionOperationResponse, err error) { req, err := c.preparerForVideoAnalyzersListBySubscription(ctx, id) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersListBySubscription", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersListBySubscription", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersListBySubscription", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersListBySubscription", result.HttpResponse, "Failure sending request") return } result, err = c.responderForVideoAnalyzersListBySubscription(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersListBySubscription", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersListBySubscription", result.HttpResponse, "Failure responding to request") return } @@ -42,7 +42,7 @@ func (c VideoAnalyzerClient) VideoAnalyzersListBySubscription(ctx context.Contex } // preparerForVideoAnalyzersListBySubscription prepares the VideoAnalyzersListBySubscription request. -func (c VideoAnalyzerClient) preparerForVideoAnalyzersListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForVideoAnalyzersListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -58,7 +58,7 @@ func (c VideoAnalyzerClient) preparerForVideoAnalyzersListBySubscription(ctx con // responderForVideoAnalyzersListBySubscription handles the response to the VideoAnalyzersListBySubscription request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideoAnalyzersListBySubscription(resp *http.Response) (result VideoAnalyzersListBySubscriptionOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForVideoAnalyzersListBySubscription(resp *http.Response) (result VideoAnalyzersListBySubscriptionOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerssyncstoragekeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerssyncstoragekeys_autorest.go similarity index 61% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerssyncstoragekeys_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerssyncstoragekeys_autorest.go index bec50f0b590e8..da5895bcc27c2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzerssyncstoragekeys_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzerssyncstoragekeys_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -17,22 +17,22 @@ type VideoAnalyzersSyncStorageKeysOperationResponse struct { } // VideoAnalyzersSyncStorageKeys ... -func (c VideoAnalyzerClient) VideoAnalyzersSyncStorageKeys(ctx context.Context, id VideoAnalyzerId, input SyncStorageKeysInput) (result VideoAnalyzersSyncStorageKeysOperationResponse, err error) { +func (c VideoAnalyzersClient) VideoAnalyzersSyncStorageKeys(ctx context.Context, id VideoAnalyzerId, input SyncStorageKeysInput) (result VideoAnalyzersSyncStorageKeysOperationResponse, err error) { req, err := c.preparerForVideoAnalyzersSyncStorageKeys(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersSyncStorageKeys", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersSyncStorageKeys", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersSyncStorageKeys", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersSyncStorageKeys", result.HttpResponse, "Failure sending request") return } result, err = c.responderForVideoAnalyzersSyncStorageKeys(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersSyncStorageKeys", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersSyncStorageKeys", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c VideoAnalyzerClient) VideoAnalyzersSyncStorageKeys(ctx context.Context, } // preparerForVideoAnalyzersSyncStorageKeys prepares the VideoAnalyzersSyncStorageKeys request. -func (c VideoAnalyzerClient) preparerForVideoAnalyzersSyncStorageKeys(ctx context.Context, id VideoAnalyzerId, input SyncStorageKeysInput) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForVideoAnalyzersSyncStorageKeys(ctx context.Context, id VideoAnalyzerId, input SyncStorageKeysInput) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c VideoAnalyzerClient) preparerForVideoAnalyzersSyncStorageKeys(ctx contex // responderForVideoAnalyzersSyncStorageKeys handles the response to the VideoAnalyzersSyncStorageKeys request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideoAnalyzersSyncStorageKeys(resp *http.Response) (result VideoAnalyzersSyncStorageKeysOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForVideoAnalyzersSyncStorageKeys(resp *http.Response) (result VideoAnalyzersSyncStorageKeysOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersupdate_autorest.go similarity index 62% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersupdate_autorest.go index 96ae572247bd4..8ab7536c06b4a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/method_videoanalyzersupdate_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/method_videoanalyzersupdate_autorest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "context" @@ -17,22 +17,22 @@ type VideoAnalyzersUpdateOperationResponse struct { } // VideoAnalyzersUpdate ... -func (c VideoAnalyzerClient) VideoAnalyzersUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzerUpdate) (result VideoAnalyzersUpdateOperationResponse, err error) { +func (c VideoAnalyzersClient) VideoAnalyzersUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzerUpdate) (result VideoAnalyzersUpdateOperationResponse, err error) { req, err := c.preparerForVideoAnalyzersUpdate(ctx, id, input) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersUpdate", nil, "Failure preparing request") return } result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersUpdate", result.HttpResponse, "Failure sending request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersUpdate", result.HttpResponse, "Failure sending request") return } result, err = c.responderForVideoAnalyzersUpdate(result.HttpResponse) if err != nil { - err = autorest.NewErrorWithError(err, "videoanalyzer.VideoAnalyzerClient", "VideoAnalyzersUpdate", result.HttpResponse, "Failure responding to request") + err = autorest.NewErrorWithError(err, "videoanalyzers.VideoAnalyzersClient", "VideoAnalyzersUpdate", result.HttpResponse, "Failure responding to request") return } @@ -40,7 +40,7 @@ func (c VideoAnalyzerClient) VideoAnalyzersUpdate(ctx context.Context, id VideoA } // preparerForVideoAnalyzersUpdate prepares the VideoAnalyzersUpdate request. -func (c VideoAnalyzerClient) preparerForVideoAnalyzersUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzerUpdate) (*http.Request, error) { +func (c VideoAnalyzersClient) preparerForVideoAnalyzersUpdate(ctx context.Context, id VideoAnalyzerId, input VideoAnalyzerUpdate) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": defaultApiVersion, } @@ -57,7 +57,7 @@ func (c VideoAnalyzerClient) preparerForVideoAnalyzersUpdate(ctx context.Context // responderForVideoAnalyzersUpdate handles the response to the VideoAnalyzersUpdate request. The method always // closes the http.Response Body. -func (c VideoAnalyzerClient) responderForVideoAnalyzersUpdate(resp *http.Response) (result VideoAnalyzersUpdateOperationResponse, err error) { +func (c VideoAnalyzersClient) responderForVideoAnalyzersUpdate(resp *http.Response) (result VideoAnalyzersUpdateOperationResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accountencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_accountencryption.go similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accountencryption.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_accountencryption.go index d06694c0ed07a..34f08dfc82f07 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_accountencryption.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_accountencryption.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_checknameavailabilityrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_checknameavailabilityrequest.go similarity index 92% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_checknameavailabilityrequest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_checknameavailabilityrequest.go index 78af81f7706cc..a53efdc08c7c3 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_checknameavailabilityrequest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_checknameavailabilityrequest.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_checknameavailabilityresponse.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_checknameavailabilityresponse.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_checknameavailabilityresponse.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_checknameavailabilityresponse.go index 49aebc53afb5d..6bc73d1afbba5 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_checknameavailabilityresponse.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_checknameavailabilityresponse.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_endpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_endpoint.go similarity index 93% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_endpoint.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_endpoint.go index 2157ed6b1d2f4..2278823733661 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_endpoint.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_endpoint.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_keyvaultproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_keyvaultproperties.go similarity index 93% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_keyvaultproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_keyvaultproperties.go index 2791f4a93c89f..ef30930b304ee 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_keyvaultproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_keyvaultproperties.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_resourceidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_resourceidentity.go similarity index 91% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_resourceidentity.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_resourceidentity.go index ff421f8922c34..a5a1ef99e4123 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_resourceidentity.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_resourceidentity.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_storageaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_storageaccount.go similarity index 93% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_storageaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_storageaccount.go index 5c316117f1b56..d450687d423ae 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_storageaccount.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_storageaccount.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_syncstoragekeysinput.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_syncstoragekeysinput.go similarity index 90% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_syncstoragekeysinput.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_syncstoragekeysinput.go index 6e432668fce0b..c38b61caf4900 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_syncstoragekeysinput.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_syncstoragekeysinput.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_userassignedmanagedidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_userassignedmanagedidentity.go similarity index 92% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_userassignedmanagedidentity.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_userassignedmanagedidentity.go index 354a7cfe2494d..dc30c306f3c68 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_userassignedmanagedidentity.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_userassignedmanagedidentity.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzer.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzer.go similarity index 97% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzer.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzer.go index d21542ae7736b..30326d205791a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzer.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzer.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzercollection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzercollection.go similarity index 91% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzercollection.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzercollection.go index 47e544f4c5513..100e14e5a13ff 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzercollection.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzercollection.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzeridentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzeridentity.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzeridentity.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzeridentity.go index 1d90859d8885d..ac2da6867b3da 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzeridentity.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzeridentity.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzerpropertiesupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzerpropertiesupdate.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzerpropertiesupdate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzerpropertiesupdate.go index 40396ffdb56d6..59fcd01795c94 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzerpropertiesupdate.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzerpropertiesupdate.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzerupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzerupdate.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzerupdate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzerupdate.go index 215f0610872ea..47556dbbd88bb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer/model_videoanalyzerupdate.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_videoanalyzerupdate.go @@ -1,4 +1,4 @@ -package videoanalyzer +package videoanalyzers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/version.go new file mode 100644 index 0000000000000..275b8e34c2eea --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/version.go @@ -0,0 +1,12 @@ +package videoanalyzers + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-05-01-preview" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/videoanalyzers/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 749cefaa7d323..804f534b6c857 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -13,7 +13,6 @@ github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2019-10-01/consumption github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2019-08-01/containerservice github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-15/documentdb -github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2020-06-01/costmanagement github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2020-12-01/databoxedge github.com/Azure/azure-sdk-for-go/services/datadog/mgmt/2021-03-01/datadog github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory @@ -37,7 +36,6 @@ github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices github.com/Azure/azure-sdk-for-go/services/maintenance/mgmt/2021-05-01/maintenance -github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights @@ -171,7 +169,7 @@ github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.37.0 +# github.com/hashicorp/go-azure-helpers v0.39.0 ## explicit; go 1.17 github.com/hashicorp/go-azure-helpers/authentication github.com/hashicorp/go-azure-helpers/lang/dates @@ -191,24 +189,27 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/zones github.com/hashicorp/go-azure-helpers/resourceproviders github.com/hashicorp/go-azure-helpers/sender github.com/hashicorp/go-azure-helpers/storage -# github.com/hashicorp/go-azure-sdk v0.20220809.1122626 +# github.com/hashicorp/go-azure-sdk v0.20220815.1092453 ## explicit; go 1.18 github.com/hashicorp/go-azure-sdk/resource-manager/aad/2021-05-01/domainservices github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview/tenants github.com/hashicorp/go-azure-sdk/resource-manager/analysisservices/2017-08-01/servers github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2022-05-01/configurationstores -github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/applicationinsights -github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/applicationinsights +github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis +github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-01/workbooksapis github.com/hashicorp/go-azure-sdk/resource-manager/attestation/2020-10-01/attestationproviders github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2020-10-01/clusters github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2021-04-30/cognitiveservicesaccounts github.com/hashicorp/go-azure-sdk/resource-manager/communication/2020-08-20/communicationservice github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/availabilitysets +github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups +github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/proximityplacementgroups github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/sshpublickeys github.com/hashicorp/go-azure-sdk/resource-manager/confidentialledger/2022-05-13/confidentialledger github.com/hashicorp/go-azure-sdk/resource-manager/containerinstance/2021-10-01/containerinstance +github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2021-10-01/exports github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2021-04-01-preview/workspaces github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-04-01/resourceguards github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2021-09-03-preview/application @@ -227,7 +228,9 @@ github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/consumerg github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/eventhubs github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/eventhubsclusters +github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/namespaces github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/networkrulesets +github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2021-11-01/schemaregistry github.com/hashicorp/go-azure-sdk/resource-manager/eventhub/2022-01-01-preview/namespaces github.com/hashicorp/go-azure-sdk/resource-manager/fluidrelay/2022-05-26/fluidrelayservers github.com/hashicorp/go-azure-sdk/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms @@ -235,11 +238,16 @@ github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacolle github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionrules github.com/hashicorp/go-azure-sdk/resource-manager/iotcentral/2021-11-01-preview/apps github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2021-12-01-preview/loadtests -github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentity +github.com/hashicorp/go-azure-sdk/resource-manager/managedidentity/2018-11-30/managedidentities github.com/hashicorp/go-azure-sdk/resource-manager/managedservices/2019-06-01/registrationassignments github.com/hashicorp/go-azure-sdk/resource-manager/managedservices/2019-06-01/registrationdefinitions github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/accounts github.com/hashicorp/go-azure-sdk/resource-manager/maps/2021-02-01/creators +github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/configurations +github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/databases +github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/firewallrules +github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers +github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/virtualnetworkrules github.com/hashicorp/go-azure-sdk/resource-manager/mixedreality/2021-01-01/resource github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts @@ -249,8 +257,8 @@ github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/namespaces github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/notificationhubs -github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/operationalinsights -github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights +github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2019-09-01/querypacks +github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/remediations github.com/hashicorp/go-azure-sdk/resource-manager/portal/2019-01-01-preview/dashboard github.com/hashicorp/go-azure-sdk/resource-manager/portal/2019-01-01-preview/tenantconfiguration github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2017-12-01/configurations @@ -296,7 +304,8 @@ github.com/hashicorp/go-azure-sdk/resource-manager/storage/2021-04-01/objectrepl github.com/hashicorp/go-azure-sdk/resource-manager/trafficmanager/2018-08-01/endpoints github.com/hashicorp/go-azure-sdk/resource-manager/trafficmanager/2018-08-01/geographichierarchies github.com/hashicorp/go-azure-sdk/resource-manager/trafficmanager/2018-08-01/profiles -github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzer +github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules +github.com/hashicorp/go-azure-sdk/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/authorizations github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/clusters github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds diff --git a/website/docs/d/active_directory_domain_service.html.markdown b/website/docs/d/active_directory_domain_service.html.markdown index dd0c6bd55d711..985b2fa0ae2ad 100644 --- a/website/docs/d/active_directory_domain_service.html.markdown +++ b/website/docs/d/active_directory_domain_service.html.markdown @@ -95,6 +95,10 @@ A `replica_set` block exports the following: A `security` block exports the following: +* `kerberos_armoring_enabled` - (Optional) Whether the Kerberos Armoring is enabled. + +* `kerberos_rc4_encryption_enabled` - (Optional) Whether the Kerberos RC4 Encryption is enabled. + * `ntlm_v1_enabled` - Whether legacy NTLM v1 support is enabled. * `sync_kerberos_passwords` - Whether Kerberos password hashes are synchronized to the managed domain. diff --git a/website/docs/d/batch_pool.html.markdown b/website/docs/d/batch_pool.html.markdown index c1e733525c542..c0d1bc8878c97 100644 --- a/website/docs/d/batch_pool.html.markdown +++ b/website/docs/d/batch_pool.html.markdown @@ -151,6 +151,8 @@ A `container_registries` block exports the following: * `password` - The password to log into the registry server. +* `user_assigned_identity_id` - The reference to the user assigned identity to use to access an Azure Container Registry instead of username and password. + --- A `network_configuration` block exports the following: diff --git a/website/docs/d/dns_a_record.html.markdown b/website/docs/d/dns_a_record.html.markdown new file mode 100644 index 0000000000000..127923338701e --- /dev/null +++ b/website/docs/d/dns_a_record.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_a_record" +description: |- + Gets information about an existing DNS A Record. +--- + +# Data Source: azurerm_dns_a_record + +Use this data source to access information about an existing DNS A Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +data "azurerm_dns_a_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_a_record_id" { + value = data.azurerm_dns_a_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS A Record. + +* `resource_group_name` - Specifies the resource group where the DNS Zone (parent resource) exists. + +* `zone_name` - Specifies the DNS Zone where the resource exists. + +## Attributes Reference + +* `id` - The DNS A Record ID. + +* `fqdn` - The FQDN of the DNS A Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `records` - List of IPv4 Addresses. + +* `target_resource_id` - The Azure resource id of the target object from where the dns resource value is taken. + +* `tags` - A mapping of tags assigned to the DNS A Record. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS A Record. diff --git a/website/docs/d/dns_aaaa_record.html.markdown b/website/docs/d/dns_aaaa_record.html.markdown new file mode 100644 index 0000000000000..0a8cc37608936 --- /dev/null +++ b/website/docs/d/dns_aaaa_record.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_aaaa_record" +description: |- + Gets information about an existing DNS AAAA Record. +--- + +# Data Source: azurerm_dns_aaaa_record + +Use this data source to access information about an existing DNS AAAA Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_aaaa_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_aaaa_record_id" { + value = data.azurerm_dns_aaaa_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS AAAA Record. + +* `resource_group_name` - Specifies the resource group where the DNS Zone (parent resource) exists. + +* `zone_name` - Specifies the DNS Zone where the resource exists. + +## Attributes Reference + +* `id` - The DNS AAAA Record ID. + +* `fqdn` - The FQDN of the DNS AAAA Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `records` - List of IPv6 Addresses. + +* `target_resource_id` - The Azure resource id of the target object from where the dns resource value is taken. + +* `tags` - A mapping of tags assigned to the resource. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS AAAA Record. diff --git a/website/docs/d/dns_caa_record.html.markdown b/website/docs/d/dns_caa_record.html.markdown new file mode 100644 index 0000000000000..285b001babe90 --- /dev/null +++ b/website/docs/d/dns_caa_record.html.markdown @@ -0,0 +1,63 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_caa_record" +description: |- + Gets information about an existing DNS CAA Record. +--- + +# Data Source: azurerm_dns_caa_record + +Use this data source to access information about an existing DNS CAA Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_caa_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_caa_record_id" { + value = data.azurerm_dns_caa_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS CAA Record. + +* `resource_group_name` - Specifies the resource group where the DNS Zone (parent resource) exists. + +* `zone_name` - Specifies the DNS Zone where the resource exists. + +## Attributes Reference + +* `id` - The DNS CAA Record ID. + +* `fqdn` - The FQDN of the DNS CAA Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `record` - A list of values that make up the CAA record. Each `record` block supports fields documented below. + +* `tags` - A mapping of tags assigned to the resource. + +--- + +The `record` block supports: + +* `flags` - Extensible CAA flags, currently only 1 is implemented to set the issuer critical flag. + +* `tag` - A property tag, options are `issue`, `issuewild` and `iodef`. + +* `value` - A property value such as a registrar domain. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS CAA Record. diff --git a/website/docs/d/dns_cname_record.html.markdown b/website/docs/d/dns_cname_record.html.markdown new file mode 100644 index 0000000000000..5cd3990947d1b --- /dev/null +++ b/website/docs/d/dns_cname_record.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_cname_record" +description: |- + Gets information about an existing DNS CNAME Record. +--- + +# Data Source: azurerm_dns_cname_record + +Use this data source to access information about an existing DNS CNAME Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_cname_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_cname_record_id" { + value = data.azurerm_dns_cname_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS CNAME Record. + +* `resource_group_name` - Specifies the resource group where the DNS Zone (parent resource) exists. + +* `zone_name` - Specifies the DNS Zone where the resource exists. + +## Attributes Reference + +* `id` - The DNS CName Record ID. + +* `fqdn` - The FQDN of the DNS CName Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `record` - The target of the CNAME. + +* `target_resource_id` - The Azure resource id of the target object from where the dns resource value is taken. + +* `tags` - A mapping of tags assigned to the resource. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS CNAME Record. diff --git a/website/docs/d/dns_mx_record.html.markdown b/website/docs/d/dns_mx_record.html.markdown new file mode 100644 index 0000000000000..de7221ddeec36 --- /dev/null +++ b/website/docs/d/dns_mx_record.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_mx_record" +description: |- + Gets information about an existing DNS MX Record. +--- + +# Data Source: azurerm_dns_mx_record + +Use this data source to access information about an existing DNS MX Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_mx_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_mx_record_id" { + value = data.azurerm_dns_mx_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS MX Record. + +* `resource_group_name` - Specifies the resource group where the resource exists. + +* `zone_name` - Specifies the DNS Zone where the DNS Zone (parent resource) exists. + +## Attributes Reference + +* `id` - The DNS MX Record ID. + +* `fqdn` - The FQDN of the DNS MX Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `record` - A list of values that make up the MX record. Each `record` block supports fields documented below. + +* `tags` - A mapping of tags assigned to the resource. + +--- + +The `record` block supports: + +* `preference` - String representing the "preference” value of the MX records. Records with lower preference value take priority. + +* `exchange` - The mail server responsible for the domain covered by the MX record. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS MX Record. diff --git a/website/docs/d/dns_ns_record.html.markdown b/website/docs/d/dns_ns_record.html.markdown new file mode 100644 index 0000000000000..d7e130c7b9d6f --- /dev/null +++ b/website/docs/d/dns_ns_record.html.markdown @@ -0,0 +1,53 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_ns_record" +description: |- + Gets information about an existing DNS NS Record. +--- + +# Data Source: azurerm_dns_ns_record + +Use this data source to access information about an existing DNS NS Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_ns_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_ns_record_id" { + value = data.azurerm_dns_ns_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS NS Record. + +* `resource_group_name` - Specifies the resource group where the resource exists. + +* `zone_name` - Specifies the DNS Zone where the DNS Zone (parent resource) exists. + +## Attributes Reference + +* `id` - The DNS NS Record ID. + +* `fqdn` - The FQDN of the DNS NS Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `records` - A list of values that make up the NS record. + +* `tags` - A mapping of tags assigned to the resource. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS NS Record. diff --git a/website/docs/d/dns_ptr_record.html.markdown b/website/docs/d/dns_ptr_record.html.markdown new file mode 100644 index 0000000000000..0b55582f1da1d --- /dev/null +++ b/website/docs/d/dns_ptr_record.html.markdown @@ -0,0 +1,53 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_ptr_record" +description: |- + Gets information about an existing DNS PTR Record. +--- + +# Data Source: azurerm_dns_ptr_record + +Use this data source to access information about an existing DNS PTR Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_ptr_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_ptr_record_id" { + value = data.azurerm_dns_ptr_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS PTR Record. + +* `resource_group_name` - Specifies the resource group where the resource exists. + +* `zone_name` - Specifies the DNS Zone where the DNS Zone (parent resource) exists. + +## Attributes Reference + +* `id` - The DNS PTR Record ID. + +* `fqdn` - The FQDN of the DNS PTR Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `records` - List of Fully Qualified Domain Names. + +* `tags` - A mapping of tags assigned to the resource. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS PTR Record. diff --git a/website/docs/d/dns_soa_record.html.markdown b/website/docs/d/dns_soa_record.html.markdown new file mode 100644 index 0000000000000..c4c5211af4e9d --- /dev/null +++ b/website/docs/d/dns_soa_record.html.markdown @@ -0,0 +1,64 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_soa_record" +description: |- + Gets information about an existing DNS SOA Record. +--- + +# Data Source: azurerm_dns_soa_record + +Use this data source to access information about an existing DNS SOA Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_soa_record" "example" { + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_soa_record_id" { + value = data.azurerm_dns_soa_record.example.id +} +``` + +## Argument Reference + +* `resource_group_name` - Specifies the resource group where the resource exists. + +* `zone_name` - Specifies the DNS Zone where the DNS Zone (parent resource) exists. + +## Attributes Reference + +* `id` - The DNS SOA Record ID. + +* `name` - The name of the DNS SOA Record. + +* `fqdn` - The FQDN of the DNS SOA Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `email` - The email contact for the SOA record. + +* `host_name` - The domain name of the authoritative name server for the SOA record. + +* `expire_time` - The expire time for the SOA record. + +* `minimum_ttl` - The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration. + +* `refresh_time` - The refresh time for the SOA record. + +* `retry_time` - The retry time for the SOA record. + +* `serial_number` - The serial number for the SOA record. + +* `tags` - A mapping of tags assigned to the resource. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS SOA Record. diff --git a/website/docs/d/dns_srv_record.html.markdown b/website/docs/d/dns_srv_record.html.markdown new file mode 100644 index 0000000000000..3b944c3f4611b --- /dev/null +++ b/website/docs/d/dns_srv_record.html.markdown @@ -0,0 +1,65 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_srv_record" +description: |- + Gets information about an existing DNS SRV Record. +--- + +# Data Source: azurerm_dns_srv_record + +Use this data source to access information about an existing DNS SRV Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_srv_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_srv_record_id" { + value = data.azurerm_dns_srv_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS SRV Record. + +* `resource_group_name` - Specifies the resource group where the resource exists. + +* `zone_name` - Specifies the DNS Zone where the DNS Zone (parent resource) exists. + +## Attributes Reference + +* `id` - The DNS SRV Record ID. + +* `fqdn` - The FQDN of the DNS SRV Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `record` - A list of values that make up the SRV record. Each `record` block supports fields documented below. + +* `tags` - A mapping of tags assigned to the resource. + +--- + +The `record` block supports: + +* `priority` - Priority of the SRV record. + +* `weight` - Weight of the SRV record. + +* `port` - Port the service is listening on. + +* `target` - FQDN of the service. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS SRV Record. diff --git a/website/docs/d/dns_txt_record.html.markdown b/website/docs/d/dns_txt_record.html.markdown new file mode 100644 index 0000000000000..4542899126f7e --- /dev/null +++ b/website/docs/d/dns_txt_record.html.markdown @@ -0,0 +1,59 @@ +--- +subcategory: "DNS" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_dns_txt_record" +description: |- + Gets information about an existing DNS TXT Record. +--- + +# Data Source: azurerm_dns_txt_record + +Use this data source to access information about an existing DNS TXT Record within Azure DNS. + +~> **Note:** [The Azure DNS API has a throttle limit of 500 read (GET) operations per 5 minutes](https://docs.microsoft.com/azure/azure-resource-manager/management/request-limits-and-throttling#network-throttling) - whilst the default read timeouts will work for most cases - in larger configurations you may need to set a larger [read timeout](https://www.terraform.io/language/resources/syntax#operation-timeouts) then the default 5min. Although, we'd generally recommend that you split the resources out into smaller Terraform configurations to avoid the problem entirely. + +## Example Usage + +```hcl +resource "azurerm_dns_txt_record" "example" { + name = "test" + zone_name = "test-zone" + resource_group_name = "test-rg" +} + +output "dns_txt_record_id" { + value = data.azurerm_dns_txt_record.example.id +} +``` + +## Argument Reference + +* `name` - The name of the DNS TXT Record. + +* `resource_group_name` - Specifies the resource group where the resource exists. + +* `zone_name` - Specifies the DNS Zone where the DNS Zone (parent resource) exists. + +## Attributes Reference + +* `id` - The DNS TXT Record ID. + +* `fqdn` - The FQDN of the DNS TXT Record. + +* `ttl` - The Time To Live (TTL) of the DNS record in seconds. + +* `record` - A list of values that make up the txt record. Each `record` block supports fields documented below. + +* `tags` - A mapping of tags assigned to the resource. + +--- + +The `record` block supports: + +* `value` - The value of the record. Max length: 1024 characters + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS TXT Record. diff --git a/website/docs/d/dns_zone.html.markdown b/website/docs/d/dns_zone.html.markdown index 4310dd339764a..ca1a88f1bcf47 100644 --- a/website/docs/d/dns_zone.html.markdown +++ b/website/docs/d/dns_zone.html.markdown @@ -27,6 +27,7 @@ output "dns_zone_id" { ## Argument Reference * `name` - The name of the DNS Zone. + * `resource_group_name` - (Optional) The Name of the Resource Group where the DNS Zone exists. If the Name of the Resource Group is not provided, the first DNS Zone from the list of DNS Zones in your subscription that matches `name` will be returned. @@ -36,9 +37,12 @@ in your subscription that matches `name` will be returned. * `id` - The ID of the DNS Zone. * `max_number_of_record_sets` - Maximum number of Records in the zone. + * `number_of_record_sets` - The number of records already in the zone. + * `name_servers` - A list of values that make up the NS record for the zone. -* `tags` - A mapping of tags to assign to the EventHub Namespace. + +* `tags` - A mapping of tags assigned to the DNS Zone. ## Timeouts diff --git a/website/docs/d/key_vault_certificate.html.markdown b/website/docs/d/key_vault_certificate.html.markdown index 53ed08a96032e..2a6cfa2f7791f 100644 --- a/website/docs/d/key_vault_certificate.html.markdown +++ b/website/docs/d/key_vault_certificate.html.markdown @@ -147,4 +147,4 @@ The following attributes are exported: The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `read` - (Defaults to 5 minutes) Used when retrieving the Key Vault Certificate. +* `read` - (Defaults to 30 minutes) Used when retrieving the Key Vault Certificate. diff --git a/website/docs/d/key_vault_key.html.markdown b/website/docs/d/key_vault_key.html.markdown index d52fd7e1bdc59..c2d4bd56d15a9 100644 --- a/website/docs/d/key_vault_key.html.markdown +++ b/website/docs/d/key_vault_key.html.markdown @@ -78,4 +78,4 @@ The following attributes are exported: The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `read` - (Defaults to 5 minutes) Used when retrieving the Key Vault Key. +* `read` - (Defaults to 30 minutes) Used when retrieving the Key Vault Key. diff --git a/website/docs/d/key_vault_secret.html.markdown b/website/docs/d/key_vault_secret.html.markdown index 6b2b5dddfb405..6d04d3ce2bfc9 100644 --- a/website/docs/d/key_vault_secret.html.markdown +++ b/website/docs/d/key_vault_secret.html.markdown @@ -53,4 +53,4 @@ The following attributes are exported: The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `read` - (Defaults to 5 minutes) Used when retrieving the Key Vault Secret. +* `read` - (Defaults to 30 minutes) Used when retrieving the Key Vault Secret. diff --git a/website/docs/d/management_group.html.markdown b/website/docs/d/management_group.html.markdown index 5fe68cdaabd7a..9cf191cf6253d 100644 --- a/website/docs/d/management_group.html.markdown +++ b/website/docs/d/management_group.html.markdown @@ -40,7 +40,13 @@ The following attributes are exported: * `parent_management_group_id` - The ID of any Parent Management Group. -* `subscription_ids` - A list of Subscription IDs which are assigned to the Management Group. +* `management_group_ids` - A list of Management Group IDs which directly belong to this Management Group. + +* `subscription_ids` - A list of Subscription IDs which are directly assigned to this Management Group. + +* `all_management_group_ids` - A list of Management Group IDs which directly or indirectly belong to this Management Group. + +* `all_subscription_ids` - A list of Subscription IDs which are assigned to this Management Group or its children Management Groups. ## Timeouts diff --git a/website/docs/d/monitor_diagnostic_categories.html.markdown b/website/docs/d/monitor_diagnostic_categories.html.markdown index fa199f97b8e9e..036316d862900 100644 --- a/website/docs/d/monitor_diagnostic_categories.html.markdown +++ b/website/docs/d/monitor_diagnostic_categories.html.markdown @@ -3,7 +3,7 @@ subcategory: "Monitor" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_monitor_diagnostic_categories" description: |- - Gets information about an the Monitor Diagnostics Categories supported by an existing Resource. + Gets information about the Monitor Diagnostics Categories supported by an existing Resource. --- diff --git a/website/docs/guides/3.0-upgrade-guide.html.markdown b/website/docs/guides/3.0-upgrade-guide.html.markdown index 56ebc2d7af250..a067119a2b5a7 100644 --- a/website/docs/guides/3.0-upgrade-guide.html.markdown +++ b/website/docs/guides/3.0-upgrade-guide.html.markdown @@ -343,8 +343,6 @@ The deprecated field `security.enabled_triple_des_ciphers` will be removed in fa ### Resource: `azurerm_application_gateway` -The field `probe.match.body` will become Required. - The field `probe.match.status_code` will become Required. ### Resource: `azurerm_app_service` diff --git a/website/docs/r/active_directory_domain_service.html.markdown b/website/docs/r/active_directory_domain_service.html.markdown index 047aa627aa0c3..7331126fe43db 100644 --- a/website/docs/r/active_directory_domain_service.html.markdown +++ b/website/docs/r/active_directory_domain_service.html.markdown @@ -220,6 +220,10 @@ An `initial_replica_set` block supports the following: A `security` block supports the following: +* `kerberos_armoring_enabled` - (Optional) Whether to enable Kerberos Armoring. Defaults to `false`. + +* `kerberos_rc4_encryption_enabled` - (Optional) Whether to enable Kerberos RC4 Encryption. Defaults to `false`. + * `ntlm_v1_enabled` - (Optional) Whether to enable legacy NTLM v1 support. Defaults to `false`. * `sync_kerberos_passwords` - (Optional) Whether to synchronize Kerberos password hashes to the managed domain. Defaults to `false`. diff --git a/website/docs/r/application_gateway.html.markdown b/website/docs/r/application_gateway.html.markdown index edb1ef1a7ce9f..65171492ca094 100644 --- a/website/docs/r/application_gateway.html.markdown +++ b/website/docs/r/application_gateway.html.markdown @@ -361,7 +361,7 @@ An `ip_configuration` block supports the following: A `match` block supports the following: -* `body` - (Required) A snippet from the Response Body which must be present in the Response. +* `body` - A snippet from the Response Body which must be present in the Response. * `status_code` - (Required) A list of allowed status codes for this Health Probe. @@ -525,7 +525,7 @@ When using a `policy_type` of `Custom` the following fields are supported: A `waf_configuration` block supports the following: -* `enabled` - (Required) Is the Web Application Firewall be enabled? +* `enabled` - (Required) Is the Web Application Firewall enabled? * `firewall_mode` - (Required) The Web Application Firewall Mode. Possible values are `Detection` and `Prevention`. diff --git a/website/docs/r/automation_account.html.markdown b/website/docs/r/automation_account.html.markdown index 5511ecfc81c6f..1e4f412a14fb2 100644 --- a/website/docs/r/automation_account.html.markdown +++ b/website/docs/r/automation_account.html.markdown @@ -44,12 +44,16 @@ The following arguments are supported: * `sku_name` - (Required) The SKU of the account - only `Basic` is supported at this time. +* `local_authentication_enabled` - (Optional) Whether requests using non-AAD authentication are blocked. + --- * `identity` - (Optional) An `identity` block as defined below. * `tags` - (Optional) A mapping of tags to assign to the resource. +* `encryption` - (Optional) An `encryption` block as defined below. + --- An `identity` block supports the following: @@ -60,6 +64,16 @@ An `identity` block supports the following: -> **Note:** `identity_ids` is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`. +-- + +An `encryption` block supports the following: + +* `user_assigned_identity_id` - (Optional) The User Assigned Managed Identity ID to be used for accessing the Customer Managed Key for encryption. + +* `key_source` - (Optional) The source of the encryption key. Possible values are `Microsoft.Keyvault` and `Microsoft.Storage`. + +* `key_vault_key_id` - (Required) The ID of the Key Vault Key which should be used to Encrypt the data in this Automation Account. + --- ## Attributes Reference diff --git a/website/docs/r/batch_pool.html.markdown b/website/docs/r/batch_pool.html.markdown index c7f54f4415850..981ec8dc1a336 100644 --- a/website/docs/r/batch_pool.html.markdown +++ b/website/docs/r/batch_pool.html.markdown @@ -281,6 +281,7 @@ A `container_registries` block supports the following: * `password` - (Optional) The password to log into the registry server. Changing this forces a new resource to be created. +* `user_assigned_identity_id` - (Optional) The reference to the user assigned identity to use to access an Azure Container Registry instead of username and password. Changing this forces a new resource to be created. --- A `network_configuration` block supports the following: diff --git a/website/docs/r/data_factory_integration_runtime_azure_ssis.html.markdown b/website/docs/r/data_factory_integration_runtime_azure_ssis.html.markdown index 9f1a114fbb6aa..0c49f999b2c81 100644 --- a/website/docs/r/data_factory_integration_runtime_azure_ssis.html.markdown +++ b/website/docs/r/data_factory_integration_runtime_azure_ssis.html.markdown @@ -59,6 +59,8 @@ The following arguments are supported: * `express_custom_setup` - (Optional) An `express_custom_setup` block as defined below. +* `express_vnet_integration` - (Optional) A `express_vnet_integration` block as defined below. + * `package_store` - (Optional) One or more `package_store` block as defined below. * `proxy` - (Optional) A `proxy` block as defined below. @@ -105,6 +107,12 @@ An `express_custom_setup` block supports the following: --- +A `express_vnet_integration` block supports the following: + +* `subnet_id` - (Required) id of the subnet to which the nodes of the Azure-SSIS Integration Runtime will be added. + +--- + A `command_key` block supports the following: * `target_name` - (Required) The target computer or domain name. diff --git a/website/docs/r/dns_a_record.html.markdown b/website/docs/r/dns_a_record.html.markdown index b608f45566942..b3c7d0fd59f7d 100644 --- a/website/docs/r/dns_a_record.html.markdown +++ b/website/docs/r/dns_a_record.html.markdown @@ -78,7 +78,7 @@ The following arguments are supported: * `records` - (Optional) List of IPv4 Addresses. Conflicts with `target_resource_id`. -* `target_resource_id` - (Optional) The Azure resource id of the target object. Conflicts with `records` +* `target_resource_id` - (Optional) The Azure resource id of the target object. Conflicts with `records`. * `tags` - (Optional) A mapping of tags to assign to the resource. @@ -89,19 +89,21 @@ The following arguments are supported: The following attributes are exported: * `id` - The DNS A Record ID. + * `fqdn` - The FQDN of the DNS A Record. ~> **Note:** The FQDN of the DNS A Record which has a full-stop at the end is by design. Please [see the documentation](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) for more information. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS A Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS A Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS A Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS A Record. ## Import diff --git a/website/docs/r/dns_aaaa_record.html.markdown b/website/docs/r/dns_aaaa_record.html.markdown index 95e0752113c06..69b4df3369c81 100644 --- a/website/docs/r/dns_aaaa_record.html.markdown +++ b/website/docs/r/dns_aaaa_record.html.markdown @@ -74,11 +74,11 @@ The following arguments are supported: * `zone_name` - (Required) Specifies the DNS Zone where the resource exists. Changing this forces a new resource to be created. -* `TTL` - (Required) The Time To Live (TTL) of the DNS record in seconds. +* `ttl` - (Required) The Time To Live (TTL) of the DNS record in seconds. * `records` - (Optional) List of IPv6 Addresses. Conflicts with `target_resource_id`. -* `target_resource_id` - (Optional) The Azure resource id of the target object. Conflicts with `records` +* `target_resource_id` - (Optional) The Azure resource id of the target object. Conflicts with `records`. * `tags` - (Optional) A mapping of tags to assign to the resource. @@ -89,17 +89,19 @@ The following arguments are supported: The following attributes are exported: * `id` - The DNS AAAA Record ID. + * `fqdn` - The FQDN of the DNS AAAA Record. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS AAAA Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS AAAA Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS AAAA Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS AAAA Record. ## Import diff --git a/website/docs/r/dns_caa_record.html.markdown b/website/docs/r/dns_caa_record.html.markdown index 7174a6187b55b..2d8af9682649d 100644 --- a/website/docs/r/dns_caa_record.html.markdown +++ b/website/docs/r/dns_caa_record.html.markdown @@ -60,6 +60,7 @@ resource "azurerm_dns_caa_record" "example" { } } ``` + ## Argument Reference The following arguments are supported: @@ -76,11 +77,13 @@ The following arguments are supported: * `tags` - (Optional) A mapping of tags to assign to the resource. +--- + The `record` block supports: * `flags` - (Required) Extensible CAA flags, currently only 1 is implemented to set the issuer critical flag. -* `tag` - (Required) A property tag, options are issue, issuewild and iodef. +* `tag` - (Required) A property tag, options are `issue`, `issuewild` and `iodef`. * `value` - (Required) A property value such as a registrar domain. @@ -89,17 +92,19 @@ The `record` block supports: The following attributes are exported: * `id` - The DNS CAA Record ID. + * `fqdn` - The FQDN of the DNS CAA Record. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS CAA Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS CAA Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS CAA Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS CAA Record. ## Import diff --git a/website/docs/r/dns_cname_record.html.markdown b/website/docs/r/dns_cname_record.html.markdown index 02b173f127218..86c181010ddb8 100644 --- a/website/docs/r/dns_cname_record.html.markdown +++ b/website/docs/r/dns_cname_record.html.markdown @@ -74,11 +74,11 @@ The following arguments are supported: * `zone_name` - (Required) Specifies the DNS Zone where the resource exists. Changing this forces a new resource to be created. -* `TTL` - (Required) The Time To Live (TTL) of the DNS record in seconds. +* `ttl` - (Required) The Time To Live (TTL) of the DNS record in seconds. * `record` - (Required) The target of the CNAME. -* `target_resource_id` - (Optional) The Azure resource id of the target object. Conflicts with `records` +* `target_resource_id` - (Optional) The Azure resource id of the target object. Conflicts with `record`. * `tags` - (Optional) A mapping of tags to assign to the resource. @@ -89,20 +89,22 @@ The following arguments are supported: The following attributes are exported: * `id` - The DNS CName Record ID. + * `fqdn` - The FQDN of the DNS CName Record. -~> Note: The FQDN of the DNS CNAME Record which has a full-stop at the end is by design. Please see the documentation for more information. +~> **Note:** The FQDN of the DNS CNAME Record which has a full-stop at the end is by design. Please see the documentation for more information. ## Timeouts +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the DNS CNAME Record. +* `update` - (Defaults to 30 minutes) Used when updating the DNS CNAME Record. -The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: +* `read` - (Defaults to 5 minutes) Used when retrieving the DNS CNAME Record. -* `create` - (Defaults to 30 minutes) Used when creating the DNS CName Record. -* `update` - (Defaults to 30 minutes) Used when updating the DNS CName Record. -* `read` - (Defaults to 5 minutes) Used when retrieving the DNS CName Record. -* `delete` - (Defaults to 30 minutes) Used when deleting the DNS CName Record. +* `delete` - (Defaults to 30 minutes) Used when deleting the DNS CNAME Record. ## Import diff --git a/website/docs/r/dns_mx_record.html.markdown b/website/docs/r/dns_mx_record.html.markdown index 9de7ecbcdfae3..1c5dc6d885c68 100644 --- a/website/docs/r/dns_mx_record.html.markdown +++ b/website/docs/r/dns_mx_record.html.markdown @@ -46,6 +46,7 @@ resource "azurerm_dns_mx_record" "example" { } } ``` + ## Argument Reference The following arguments are supported: @@ -62,6 +63,8 @@ The following arguments are supported: * `tags` - (Optional) A mapping of tags to assign to the resource. +--- + The `record` block supports: * `preference` - (Required) String representing the "preference” value of the MX records. Records with lower preference value take priority. @@ -73,17 +76,19 @@ The `record` block supports: The following attributes are exported: * `id` - The DNS MX Record ID. + * `fqdn` - The FQDN of the DNS MX Record. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS MX Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS MX Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS MX Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS MX Record. ## Import diff --git a/website/docs/r/dns_ns_record.html.markdown b/website/docs/r/dns_ns_record.html.markdown index 436f87b3a8ba0..89897e8dc6aff 100644 --- a/website/docs/r/dns_ns_record.html.markdown +++ b/website/docs/r/dns_ns_record.html.markdown @@ -38,6 +38,7 @@ resource "azurerm_dns_ns_record" "example" { } } ``` + ## Argument Reference The following arguments are supported: @@ -50,7 +51,7 @@ The following arguments are supported: * `ttl` - (Required) The Time To Live (TTL) of the DNS record in seconds. -* `records` - (Required) A list of values that make up the NS record. +* `records` - (Required) A list of values that make up the NS record. * `tags` - (Optional) A mapping of tags to assign to the resource. @@ -59,17 +60,19 @@ The following arguments are supported: The following attributes are exported: * `id` - The DNS NS Record ID. + * `fqdn` - The FQDN of the DNS NS Record. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS NS Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS NS Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS NS Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS NS Record. ## Import diff --git a/website/docs/r/dns_ptr_record.html.markdown b/website/docs/r/dns_ptr_record.html.markdown index 592be2072acda..bbd893170fe6d 100644 --- a/website/docs/r/dns_ptr_record.html.markdown +++ b/website/docs/r/dns_ptr_record.html.markdown @@ -55,17 +55,19 @@ The following arguments are supported: The following attributes are exported: * `id` - The DNS PTR Record ID. + * `fqdn` - The FQDN of the DNS PTR Record. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS PTR Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS PTR Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS PTR Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS PTR Record. ## Import diff --git a/website/docs/r/dns_srv_record.html.markdown b/website/docs/r/dns_srv_record.html.markdown index d37e26ba5b451..06098dd64ecc6 100644 --- a/website/docs/r/dns_srv_record.html.markdown +++ b/website/docs/r/dns_srv_record.html.markdown @@ -43,6 +43,7 @@ resource "azurerm_dns_srv_record" "example" { } } ``` + ## Argument Reference The following arguments are supported: @@ -59,6 +60,8 @@ The following arguments are supported: * `tags` - (Optional) A mapping of tags to assign to the resource. +--- + The `record` block supports: * `priority` - (Required) Priority of the SRV record. @@ -69,23 +72,24 @@ The `record` block supports: * `target` - (Required) FQDN of the service. - ## Attributes Reference The following attributes are exported: * `id` - The DNS SRV Record ID. + * `fqdn` - The FQDN of the DNS SRV Record. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS SRV Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS SRV Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS SRV Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS SRV Record. ## Import diff --git a/website/docs/r/dns_txt_record.html.markdown b/website/docs/r/dns_txt_record.html.markdown index 45bf512fe1606..f495a79db5dd3 100644 --- a/website/docs/r/dns_txt_record.html.markdown +++ b/website/docs/r/dns_txt_record.html.markdown @@ -44,6 +44,7 @@ resource "azurerm_dns_txt_record" "example" { } } ``` + ## Argument Reference The following arguments are supported: @@ -60,6 +61,8 @@ The following arguments are supported: * `tags` - (Optional) A mapping of tags to assign to the resource. +--- + The `record` block supports: * `value` - (Required) The value of the record. Max length: 1024 characters @@ -69,17 +72,19 @@ The `record` block supports: The following attributes are exported: * `id` - The DNS TXT Record ID. + * `fqdn` - The FQDN of the DNS TXT Record. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS TXT Record. + * `update` - (Defaults to 30 minutes) Used when updating the DNS TXT Record. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS TXT Record. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS TXT Record. ## Import diff --git a/website/docs/r/dns_zone.html.markdown b/website/docs/r/dns_zone.html.markdown index b3f775c177e71..9be07c8f034b5 100644 --- a/website/docs/r/dns_zone.html.markdown +++ b/website/docs/r/dns_zone.html.markdown @@ -23,6 +23,7 @@ resource "azurerm_dns_zone" "example-public" { resource_group_name = azurerm_resource_group.example.name } ``` + ## Argument Reference The following arguments are supported: @@ -62,19 +63,23 @@ The `soa_record` block supports: The following attributes are exported: * `id` - The DNS Zone ID. + * `max_number_of_record_sets` - (Optional) Maximum number of Records in the zone. Defaults to `1000`. + * `number_of_record_sets` - (Optional) The number of records already in the zone. + * `name_servers` - (Optional) A list of values that make up the NS record for the zone. ## Timeouts - - The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: * `create` - (Defaults to 30 minutes) Used when creating the DNS Zone. + * `update` - (Defaults to 30 minutes) Used when updating the DNS Zone. + * `read` - (Defaults to 5 minutes) Used when retrieving the DNS Zone. + * `delete` - (Defaults to 30 minutes) Used when deleting the DNS Zone. ## Import diff --git a/website/docs/r/eventhub_namespace_schema_group.html.markdown b/website/docs/r/eventhub_namespace_schema_group.html.markdown new file mode 100644 index 0000000000000..89a86a2af5017 --- /dev/null +++ b/website/docs/r/eventhub_namespace_schema_group.html.markdown @@ -0,0 +1,64 @@ +--- +subcategory: "Messaging" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_eventhub_namespace_schema_group" +description: |- + Manages a Schema Group for a EventHub Namespace. +--- + +# azurerm_eventhub_namespace_schema_group + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "exampleRG-ehn-schemaGroup" + location = "East US" +} + +resource "azurerm_eventhub_namespace" "test" { + name = "example-ehn-schemaGroup" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku = "Standard" +} + +resource "azurerm_eventhub_namespace_schema_group" "test" { + name = "example-schemaGroup" + namespace_id = azurerm_eventhub_namespace.test.id + schema_compatibility = "Forward" + schema_type = "Avro" +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `namespace_id` - (Required) The ID of the EventHub Namespace. Changing this forces a new resource to be created. + +* `schema_compatibility` - (Required) The compatibility of this schema group. Possible values are `None`, `Backward`, `Forward`. Changing this forces a new resource to be created. + +* `schema_type` - (Required) The Type of this schema group. Possible values are `Avro`, `Unknown`. Changing this forces a new resource to be created. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the EventHub Namespace Schema Group. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the EventHub Namespace Schema Group. +* `read` - (Defaults to 5 minutes) Used when retrieving the EventHub Namespace Schema Group. +* `delete` - (Defaults to 30 minutes) Used when deleting the EventHub Namespace Schema Group. + +## Import + +Schema Group for a EventHub Namespace can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_eventhub_namespace_schema_group.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/schemagroups/group1 +``` diff --git a/website/docs/r/firewall_policy.html.markdown b/website/docs/r/firewall_policy.html.markdown index 3b7f9c7de3fb9..bcfde26da8410 100644 --- a/website/docs/r/firewall_policy.html.markdown +++ b/website/docs/r/firewall_policy.html.markdown @@ -59,6 +59,8 @@ The following arguments are supported: * `tls_certificate` - (Optional) A `tls_certificate` block as defined below. +* `sql_redirect_allowed` - (Optional) Whether SQL Redirect traffic filtering is allowed. Enabling this flag requires no rule using ports between `11000`-`11999`. + --- A `dns` block supports the following: @@ -97,6 +99,8 @@ A `intrusion_detection` block supports the following: * `traffic_bypass` - (Optional) One or more `traffic_bypass` blocks as defined below. +* `private_ranges` - (Optional) A list of Private IP address ranges to identify traffic direction. By default, only ranges defined by IANA RFC 1918 are considered private IP addresses. + --- A `log_analytics_workspace` block supports the following: diff --git a/website/docs/r/key_vault_access_policy.html.markdown b/website/docs/r/key_vault_access_policy.html.markdown index 2caeca4c7fac3..48de3bd393623 100644 --- a/website/docs/r/key_vault_access_policy.html.markdown +++ b/website/docs/r/key_vault_access_policy.html.markdown @@ -67,7 +67,7 @@ The following arguments are supported: * `certificate_permissions` - (Optional) List of certificate permissions, must be one or more from the following: `Backup`, `Create`, `Delete`, `DeleteIssuers`, `Get`, `GetIssuers`, `Import`, `List`, `ListIssuers`, `ManageContacts`, `ManageIssuers`, `Purge`, `Recover`, `Restore`, `SetIssuers` and `Update`. -* `key_permissions` - (Optional) List of key permissions, must be one or more from the following: `Backup`, `Create`, `Decrypt`, `Delete`, `Encrypt`, `Get`, `Import`, `List`, `Purge`, `Recover`, `Restore`, `Sign`, `UnwrapKey`, `Update`, `Verify` and `WrapKey`. +* `key_permissions` - (Optional) List of key permissions, must be one or more from the following: `Backup`, `Create`, `Decrypt`, `Delete`, `Encrypt`, `Get`, `Import`, `List`, `Purge`, `Recover`, `Restore`, `Sign`, `UnwrapKey`, `Update`, `Verify`, `WrapKey`, `Release`, `Rotate`, `GetRotationPolicy`, and `SetRotationPolicy`. * `secret_permissions` - (Optional) List of secret permissions, must be one or more from the following: `Backup`, `Delete`, `Get`, `List`, `Purge`, `Recover`, `Restore` and `Set`. diff --git a/website/docs/r/key_vault_certificate.html.markdown b/website/docs/r/key_vault_certificate.html.markdown index ab38ef6d15da4..8cfb67ed8da4e 100644 --- a/website/docs/r/key_vault_certificate.html.markdown +++ b/website/docs/r/key_vault_certificate.html.markdown @@ -327,7 +327,7 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/l * `create` - (Defaults to 30 minutes) Used when creating the Key Vault Certificate. * `update` - (Defaults to 30 minutes) Used when updating the Key Vault Certificate. -* `read` - (Defaults to 5 minutes) Used when retrieving the Key Vault Certificate. +* `read` - (Defaults to 30 minutes) Used when retrieving the Key Vault Certificate. * `delete` - (Defaults to 30 minutes) Used when deleting the Key Vault Certificate. ## Import diff --git a/website/docs/r/key_vault_key.html.markdown b/website/docs/r/key_vault_key.html.markdown index 7624bbd0b64d5..040555d8c8823 100644 --- a/website/docs/r/key_vault_key.html.markdown +++ b/website/docs/r/key_vault_key.html.markdown @@ -109,7 +109,7 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/l * `create` - (Defaults to 30 minutes) Used when creating the Key Vault Key. * `update` - (Defaults to 30 minutes) Used when updating the Key Vault Key. -* `read` - (Defaults to 5 minutes) Used when retrieving the Key Vault Key. +* `read` - (Defaults to 30 minutes) Used when retrieving the Key Vault Key. * `delete` - (Defaults to 30 minutes) Used when deleting the Key Vault Key. ## Import diff --git a/website/docs/r/key_vault_secret.html.markdown b/website/docs/r/key_vault_secret.html.markdown index 42936969e5dd7..a80acd0227a59 100644 --- a/website/docs/r/key_vault_secret.html.markdown +++ b/website/docs/r/key_vault_secret.html.markdown @@ -96,7 +96,7 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/l * `create` - (Defaults to 30 minutes) Used when creating the Key Vault Secret. * `update` - (Defaults to 30 minutes) Used when updating the Key Vault Secret. -* `read` - (Defaults to 5 minutes) Used when retrieving the Key Vault Secret. +* `read` - (Defaults to 30 minutes) Used when retrieving the Key Vault Secret. * `delete` - (Defaults to 30 minutes) Used when deleting the Key Vault Secret. ## Import diff --git a/website/docs/r/linux_virtual_machine.html.markdown b/website/docs/r/linux_virtual_machine.html.markdown index 58d02f81532ee..80f8b66afc746 100644 --- a/website/docs/r/linux_virtual_machine.html.markdown +++ b/website/docs/r/linux_virtual_machine.html.markdown @@ -148,7 +148,7 @@ The following arguments are supported: * `encryption_at_host_enabled` - (Optional) Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host? -* `eviction_policy` - (Optional) Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. At this time the only supported value is `Deallocate`. Changing this forces a new resource to be created. +* `eviction_policy` - (Optional) Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. -> **NOTE:** This can only be configured when `priority` is set to `Spot`. diff --git a/website/docs/r/linux_virtual_machine_scale_set.html.markdown b/website/docs/r/linux_virtual_machine_scale_set.html.markdown index 3be08abb70d4b..ceb4c0c079031 100644 --- a/website/docs/r/linux_virtual_machine_scale_set.html.markdown +++ b/website/docs/r/linux_virtual_machine_scale_set.html.markdown @@ -162,7 +162,7 @@ The following arguments are supported: * `extensions_time_budget` - (Optional) Specifies the duration allocated for all extensions to start. The time duration should be between `15` minutes and `120` minutes (inclusive) and should be specified in ISO 8601 format. Defaults to `90` minutes (`PT1H30M`). -* `eviction_policy` - (Optional) The Policy which should be used Virtual Machines are Evicted from the Scale Set. Changing this forces a new resource to be created. +* `eviction_policy` - (Optional) Specifies the eviction policy for Virtual Machines in this Scale Set. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. -> **NOTE:** This can only be configured when `priority` is set to `Spot`. diff --git a/website/docs/r/mssql_server.html.markdown b/website/docs/r/mssql_server.html.markdown index 015d26098a5ff..7fd5e9c6d23c3 100644 --- a/website/docs/r/mssql_server.html.markdown +++ b/website/docs/r/mssql_server.html.markdown @@ -63,9 +63,9 @@ The following arguments are supported: * `identity` - (Optional) An `identity` block as defined below. -* `minimum_tls_version` - (Optional) The Minimum TLS Version for all SQL Database and SQL Data Warehouse databases associated with the server. Valid values are: `1.0`, `1.1` and `1.2`. +* `minimum_tls_version` - (Optional) The Minimum TLS Version for all SQL Database and SQL Data Warehouse databases associated with the server. Valid values are: `1.0`, `1.1` , `1.2` and `Disabled`. Defaults to `1.2`. -~> **NOTE:** Once `minimum_tls_version` is set it is not possible to remove this setting and must be given a valid value for any further updates to the resource. +~> **NOTE:** The `minimum_tls_version` is set to `Disabled` means all TLS versions are allowed. After you enforce a version of `minimum_tls_version`, it's not possible to revert to `Disabled`. * `public_network_access_enabled` - (Optional) Whether public network access is allowed for this server. Defaults to `true`. diff --git a/website/docs/r/network_interface.html.markdown b/website/docs/r/network_interface.html.markdown index 59356304cbafa..556f2625be47d 100644 --- a/website/docs/r/network_interface.html.markdown +++ b/website/docs/r/network_interface.html.markdown @@ -94,7 +94,7 @@ The `ip_configuration` block supports the following: * `private_ip_address_allocation` - (Required) The allocation method used for the Private IP Address. Possible values are `Dynamic` and `Static`. -~> **Note:** Azure does not assign a Dynamic IP Address until the Network Interface is attached to a running Virtual Machine (or other resource) +~> **Note:** `Dynamic` means "An IP is automatically assigned during creation of this Network Interface"; `Static` means "User supplied IP address will be used" * `public_ip_address_id` - (Optional) Reference to a Public IP Address to associate with this NIC @@ -122,11 +122,11 @@ The following attributes are exported: * `private_ip_address` - The first private IP address of the network interface. -~> **Note:** If a `Dynamic` allocation method is used Azure will not allocate an IP Address until the Network Interface is attached to a running resource (such as a Virtual Machine). +~> **Note:** If a `Dynamic` allocation method is used Azure will allocate an IP Address on Network Interface creation. * `private_ip_addresses` - The private IP addresses of the network interface. -~> **Note:** If a `Dynamic` allocation method is used Azure will not allocate an IP Address until the Network Interface is attached to a running resource (such as a Virtual Machine). +~> **Note:** If a `Dynamic` allocation method is used Azure will allocate an IP Address on Network Interface creation. * `virtual_machine_id` - The ID of the Virtual Machine which this Network Interface is connected to. diff --git a/website/docs/r/shared_image.html.markdown b/website/docs/r/shared_image.html.markdown index dbb39a3ce547a..279f841b85da6 100644 --- a/website/docs/r/shared_image.html.markdown +++ b/website/docs/r/shared_image.html.markdown @@ -78,6 +78,8 @@ The following arguments are supported: !> **Note:** It's recommended to Generalize images where possible - Specialized Images reuse the same UUID internally within each Virtual Machine, which can have unintended side-effects. +* `architecture` - (Optional) CPU architecture supported by an OS. Possible values are `x64` and `Arm64`. Defaults to `x64`. Changing this forces a new resource to be created. + * `hyper_v_generation` - (Optional) The generation of HyperV that the Virtual Machine used to create the Shared Image is based on. Possible values are `V1` and `V2`. Defaults to `V1`. Changing this forces a new resource to be created. * `max_recommended_vcpu_count` - (Optional) Maximum count of vCPUs recommended for the Image. diff --git a/website/docs/r/shared_image_version.html.markdown b/website/docs/r/shared_image_version.html.markdown index bcb6a01364f31..93f02a24e3769 100644 --- a/website/docs/r/shared_image_version.html.markdown +++ b/website/docs/r/shared_image_version.html.markdown @@ -57,6 +57,12 @@ The following arguments are supported: * `target_region` - (Required) One or more `target_region` blocks as documented below. +* `blob_uri` - (Optional) URI of the Azure Storage Blob used to create the Image Version. Changing this forces a new resource to be created. + +-> **NOTE:** You must specify exact one of `blob_uri`, `managed_image_id` and `os_disk_snapshot_id`. + +-> **NOTE:** `blob_uri` and `storage_account_id` must be specified together + * `end_of_life_date` - (Optional) The end of life date in RFC3339 format of the Image Version. * `exclude_from_latest` - (Optional) Should this Image Version be excluded from the `latest` filter? If set to `true` this Image Version won't be returned for the `latest` version. Defaults to `false`. @@ -65,12 +71,18 @@ The following arguments are supported: -> **NOTE:** The ID can be sourced from the `azurerm_image` [Data Source](https://www.terraform.io/docs/providers/azurerm/d/image.html) or [Resource](https://www.terraform.io/docs/providers/azurerm/r/image.html). +-> **NOTE:** You must specify exact one of `blob_uri`, `managed_image_id` and `os_disk_snapshot_id`. + * `os_disk_snapshot_id` - (Optional) The ID of the OS disk snapshot which should be used for this Shared Image Version. Changing this forces a new resource to be created. --> **NOTE:** You must specify exact one of `managed_image_id` and `os_disk_snapshot_id`. +-> **NOTE:** You must specify exact one of `blob_uri`, `managed_image_id` and `os_disk_snapshot_id`. * `replication_mode` - (Optional) Mode to be used for replication. Possible values are `Full` and `Shallow`. Defaults to `Full`. Changing this forces a new resource to be created. +* `storage_account_id` - (Optional) The ID of the Storage Account where the Blob exists. Changing this forces a new resource to be created. + +-> **NOTE:** `blob_uri` and `storage_account_id` must be specified together + * `tags` - (Optional) A collection of tags which should be applied to this resource. --- diff --git a/website/docs/r/storage_account.html.markdown b/website/docs/r/storage_account.html.markdown index dd3ce53895d69..140b4fd2c48ee 100644 --- a/website/docs/r/storage_account.html.markdown +++ b/website/docs/r/storage_account.html.markdown @@ -115,6 +115,8 @@ The following arguments are supported: ~> **Note:** Terraform uses Shared Key Authorisation to provision Storage Containers, Blobs and other items - when Shared Key Access is disabled, you will need to enable [the `storage_use_azuread` flag in the Provider block](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#storage_use_azuread) to use Azure AD for authentication, however not all Azure Storage services support Active Directory authentication. +* `default_to_oauth_authentication` - (Optional) Default to Azure Active Directory authorization in the Azure portal when accessing the Storage Account. The default value is `false` + * `is_hns_enabled` - (Optional) Is Hierarchical Namespace enabled? This can be used with Azure Data Lake Storage Gen 2 ([see here for more information](https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-quickstart-create-account/)). Changing this forces a new resource to be created. -> **NOTE:** This can only be `true` when `account_tier` is `Standard` or when `account_tier` is `Premium` *and* `account_kind` is `BlockBlobStorage` diff --git a/website/docs/r/storage_management_policy.html.markdown b/website/docs/r/storage_management_policy.html.markdown index 9155fe1fdfb35..0d5c50c23fe63 100644 --- a/website/docs/r/storage_management_policy.html.markdown +++ b/website/docs/r/storage_management_policy.html.markdown @@ -94,7 +94,7 @@ The following arguments are supported: * `rule` supports the following: -* `name` - (Required) A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. +* `name` - (Required) The name of the rule. Rule name is case-sensitive. It must be unique within a policy. * `enabled` - (Required) Boolean to specify whether the rule is enabled. * `filters` - A `filter` block as documented below. * `actions` - An `actions` block as documented below. diff --git a/website/docs/r/windows_virtual_machine.html.markdown b/website/docs/r/windows_virtual_machine.html.markdown index 81f980d08777d..60c9314ee8897 100644 --- a/website/docs/r/windows_virtual_machine.html.markdown +++ b/website/docs/r/windows_virtual_machine.html.markdown @@ -137,7 +137,7 @@ The following arguments are supported: * `encryption_at_host_enabled` - (Optional) Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host? -* `eviction_policy` - (Optional) Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. At this time the only supported value is `Deallocate`. Changing this forces a new resource to be created. +* `eviction_policy` - (Optional) Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. -> **NOTE:** This can only be configured when `priority` is set to `Spot`. diff --git a/website/docs/r/windows_virtual_machine_scale_set.html.markdown b/website/docs/r/windows_virtual_machine_scale_set.html.markdown index a31867b5a995f..81cbc72b0e0c3 100644 --- a/website/docs/r/windows_virtual_machine_scale_set.html.markdown +++ b/website/docs/r/windows_virtual_machine_scale_set.html.markdown @@ -146,7 +146,7 @@ The following arguments are supported: * `extensions_time_budget` - (Optional) Specifies the duration allocated for all extensions to start. The time duration should be between `15` minutes and `120` minutes (inclusive) and should be specified in ISO 8601 format. Defaults to `90` minutes (`PT1H30M`). -* `eviction_policy` - (Optional) The Policy which should be used Virtual Machines are Evicted from the Scale Set. Changing this forces a new resource to be created. +* `eviction_policy` - (Optional) Specifies the eviction policy for Virtual Machines in this Scale Set. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. -> **NOTE:** This can only be configured when `priority` is set to `Spot`.