From 004b235ba54d792272614dfcc52a90b92dbf8e7b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 27 Aug 2024 22:52:47 +0000 Subject: [PATCH] CodeGen from PR 3489 in test-repo-billy/azure-rest-api-specs Merge 81cbcc6683dbdde803b169be5c34bee0ea7ea90d into 2b91022c223ed3618c268c750f831b76fe0f4fb5 --- .../armmpcnetworkfunction/CHANGELOG.md | 8 + .../armmpcnetworkfunction/LICENSE.txt | 21 + .../armmpcnetworkfunction/README.md | 92 ++ .../armmpcnetworkfunction/autorest.md | 13 + .../armmpcnetworkfunction/build.go | 7 + .../armmpcnetworkfunction/ci.yml | 28 + .../armmpcnetworkfunction/client_factory.go | 52 + .../armmpcnetworkfunction/constants.go | 223 ++++ .../armmpcnetworkfunction/fake/internal.go | 64 + .../fake/networkfunctions_server.go | 327 +++++ .../fake/operations_server.go | 96 ++ .../fake/server_factory.go | 82 ++ .../fake/time_rfc3339.go | 110 ++ .../armmpcnetworkfunction/go.mod | 11 + .../armmpcnetworkfunction/go.sum | 12 + .../armmpcnetworkfunction/models.go | 151 +++ .../armmpcnetworkfunction/models_serde.go | 364 ++++++ .../networkfunctions_client.go | 427 +++++++ .../operations_client.go | 88 ++ .../armmpcnetworkfunction/options.go | 48 + .../armmpcnetworkfunction/responses.go | 50 + .../armmpcnetworkfunction/time_rfc3339.go | 110 ++ .../armnetworkanalytics/CHANGELOG.md | 4 + .../armnetworkanalytics/autorest.md | 7 +- .../armnetworkanalytics/client_factory.go | 32 +- .../armnetworkanalytics/constants.go | 2 +- .../dataproducts_client_example_test.go | 1115 ----------------- ...ataproductscatalogs_client_example_test.go | 266 ---- .../datatypes_client_example_test.go | 464 ------- .../armnetworkanalytics/fake/time_rfc3339.go | 42 +- .../armnetworkanalytics/go.mod | 12 +- .../armnetworkanalytics/go.sum | 17 - .../armnetworkanalytics/models.go | 4 +- .../armnetworkanalytics/models_serde.go | 2 +- .../operations_client_example_test.go | 85 -- .../{response_types.go => responses.go} | 0 .../armnetworkanalytics/time_rfc3339.go | 42 +- .../armoracledatabase/CHANGELOG.md | 9 + .../autonomousdatabasebackups_client.go | 26 +- ...mousdatabasebackups_client_example_test.go | 226 ---- .../autonomousdatabasecharactersets_client.go | 8 +- ...tabasecharactersets_client_example_test.go | 87 -- ...ousdatabasenationalcharactersets_client.go | 8 +- ...tionalcharactersets_client_example_test.go | 80 -- .../autonomousdatabases_client.go | 58 +- ...autonomousdatabases_client_example_test.go | 783 ------------ .../autonomousdatabaseversions_client.go | 8 +- ...ousdatabaseversions_client_example_test.go | 80 -- .../armoracledatabase/autorest.md | 7 +- .../cloudexadatainfrastructures_client.go | 36 +- ...datainfrastructures_client_example_test.go | 615 --------- .../cloudvmclusters_client.go | 46 +- .../cloudvmclusters_client_example_test.go | 813 ------------ .../armoracledatabase/constants.go | 23 +- .../armoracledatabase/dbnodes_client.go | 14 +- .../dbnodes_client_example_test.go | 171 --- .../armoracledatabase/dbservers_client.go | 8 +- .../dbservers_client_example_test.go | 112 -- .../dbsystemshapes_client.go | 8 +- .../dbsystemshapes_client_example_test.go | 118 -- .../dnsprivateviews_client.go | 8 +- .../dnsprivateviews_client_example_test.go | 105 -- .../dnsprivatezones_client.go | 8 +- .../dnsprivatezones_client_example_test.go | 111 -- .../fake/oraclesubscriptions_server.go | 48 + .../armoracledatabase/giversions_client.go | 8 +- .../giversions_client_example_test.go | 80 -- .../oracledatabase/armoracledatabase/go.mod | 12 +- .../oracledatabase/armoracledatabase/go.sum | 17 - .../armoracledatabase/models.go | 79 +- .../armoracledatabase/models_serde.go | 39 + .../armoracledatabase/operations_client.go | 4 +- .../operations_client_example_test.go | 56 - .../armoracledatabase/options.go | 7 + .../oraclesubscriptions_client.go | 115 +- ...oraclesubscriptions_client_example_test.go | 307 ----- .../armoracledatabase/responses.go | 5 + .../systemversions_client.go | 8 +- .../systemversions_client_example_test.go | 78 -- .../virtualnetworkaddresses_client.go | 20 +- ...ualnetworkaddresses_client_example_test.go | 159 --- .../armplaywrighttesting/CHANGELOG.md | 23 + .../armplaywrighttesting/README.md | 2 +- .../accountquotas_client.go | 178 +++ .../armplaywrighttesting/accounts_client.go | 162 ++- .../accounts_client_example_test.go | 296 ----- .../armplaywrighttesting/autorest.md | 7 +- .../armplaywrighttesting/client_factory.go | 36 +- .../armplaywrighttesting/constants.go | 35 +- .../fake/accountquotas_server.go | 162 +++ .../fake/accounts_server.go | 67 +- .../fake/quotas_server.go | 8 +- .../fake/server_factory.go | 23 +- .../armplaywrighttesting/fake/time_rfc3339.go | 42 +- .../armplaywrighttesting/go.mod | 12 +- .../armplaywrighttesting/go.sum | 17 - .../armplaywrighttesting/models.go | 106 +- .../armplaywrighttesting/models_serde.go | 236 +++- .../armplaywrighttesting/operations_client.go | 4 +- .../operations_client_example_test.go | 76 -- .../armplaywrighttesting/options.go | 17 + .../armplaywrighttesting/quotas_client.go | 28 +- .../quotas_client_example_test.go | 100 -- .../{response_types.go => responses.go} | 26 +- .../armplaywrighttesting/time_rfc3339.go | 42 +- .../portal/armportal/CHANGELOG.md | 49 + .../portal/armportal/autorest.md | 6 +- .../portal/armportal/client_factory.go | 32 +- .../portal/armportal/constants.go | 90 +- .../portal/armportal/dashboards_client.go | 60 +- .../dashboards_client_example_test.go | 520 -------- .../armportal/fake/dashboards_server.go | 16 +- .../portal/armportal/fake/internal.go | 8 - .../fake/tenantconfigurations_server.go | 36 +- .../portal/armportal/fake/time_rfc3339.go | 110 ++ sdk/resourcemanager/portal/armportal/go.mod | 12 +- sdk/resourcemanager/portal/armportal/go.sum | 17 - ...isttenantconfigurationviolations_client.go | 4 +- ...igurationviolations_client_example_test.go | 51 - .../portal/armportal/models.go | 250 ++-- .../portal/armportal/models_serde.go | 386 ++++-- .../portal/armportal/operations_client.go | 8 +- .../operations_client_example_test.go | 86 -- .../portal/armportal/polymorphic_helpers.go | 4 +- .../{response_types.go => responses.go} | 16 +- .../armportal/tenantconfigurations_client.go | 50 +- ...enantconfigurations_client_example_test.go | 132 -- .../portal/armportal/time_rfc3339.go | 110 ++ .../scvmm/armscvmm/CHANGELOG.md | 7 + .../scvmm/armscvmm/autorest.md | 7 +- .../scvmm/armscvmm/availabilitysets_client.go | 30 +- .../availabilitysets_client_example_test.go | 488 -------- .../scvmm/armscvmm/clouds_client.go | 30 +- .../armscvmm/clouds_client_example_test.go | 570 --------- .../scvmm/armscvmm/constants.go | 2 +- sdk/resourcemanager/scvmm/armscvmm/go.mod | 12 +- sdk/resourcemanager/scvmm/armscvmm/go.sum | 17 - .../scvmm/armscvmm/guestagents_client.go | 18 +- .../guestagents_client_example_test.go | 293 ----- .../scvmm/armscvmm/inventoryitems_client.go | 16 +- .../inventoryitems_client_example_test.go | 264 ---- sdk/resourcemanager/scvmm/armscvmm/models.go | 24 + .../scvmm/armscvmm/models_serde.go | 32 + .../scvmm/armscvmm/operations_client.go | 4 +- .../operations_client_example_test.go | 85 -- .../virtualmachineinstances_client.go | 62 +- ...ualmachineinstances_client_example_test.go | 1079 ---------------- .../virtualmachinetemplates_client.go | 30 +- ...ualmachinetemplates_client_example_test.go | 739 ----------- .../scvmm/armscvmm/virtualnetworks_client.go | 30 +- .../virtualnetworks_client_example_test.go | 500 -------- ...minstancehybrididentitymetadatas_client.go | 8 +- ...ididentitymetadatas_client_example_test.go | 156 --- .../scvmm/armscvmm/vmmservers_client.go | 30 +- .../vmmservers_client_example_test.go | 528 -------- .../armservicenetworking/CHANGELOG.md | 4 + .../associationsinterface_client.go | 26 +- ...sociationsinterface_client_example_test.go | 198 --- .../armservicenetworking/autorest.md | 7 +- .../armservicenetworking/client_factory.go | 40 +- .../armservicenetworking/constants.go | 39 +- .../fake/associationsinterface_server.go | 6 +- .../fake/frontendsinterface_server.go | 6 +- .../fake/securitypoliciesinterface_server.go | 319 +++++ .../fake/server_factory.go | 7 + .../armservicenetworking/fake/time_rfc3339.go | 42 +- .../fake/trafficcontrollerinterface_server.go | 6 +- .../frontendsinterface_client.go | 26 +- .../frontendsinterface_client_example_test.go | 175 --- .../armservicenetworking/go.mod | 12 +- .../armservicenetworking/go.sum | 17 - .../armservicenetworking/models.go | 115 +- .../armservicenetworking/models_serde.go | 378 +++++- .../armservicenetworking/operations_client.go | 4 +- .../operations_client_example_test.go | 57 - .../armservicenetworking/options.go | 32 + .../{response_types.go => responses.go} | 35 +- .../securitypoliciesinterface_client.go | 421 +++++++ .../armservicenetworking/time_rfc3339.go | 42 +- .../trafficcontrollerinterface_client.go | 30 +- ...controllerinterface_client_example_test.go | 279 ----- .../sphere/armsphere/CHANGELOG.md | 4 + .../sphere/armsphere/autorest.md | 7 +- .../armsphere/catalogs_client_example_test.go | 432 ------- .../certificates_client_example_test.go | 122 -- .../sphere/armsphere/constants.go | 2 +- .../deployments_client_example_test.go | 173 --- .../devicegroups_client_example_test.go | 230 ---- .../armsphere/devices_client_example_test.go | 205 --- sdk/resourcemanager/sphere/armsphere/go.mod | 12 +- sdk/resourcemanager/sphere/armsphere/go.sum | 17 - .../armsphere/images_client_example_test.go | 135 -- .../sphere/armsphere/models.go | 16 +- .../operations_client_example_test.go | 64 - .../armsphere/products_client_example_test.go | 235 ---- 195 files changed, 6531 insertions(+), 15361 deletions(-) create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/CHANGELOG.md create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/LICENSE.txt create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/README.md create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/autorest.md create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/build.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/ci.yml create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/client_factory.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/constants.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/internal.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/networkfunctions_server.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/operations_server.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/server_factory.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/time_rfc3339.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.mod create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.sum create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models_serde.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/networkfunctions_client.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/operations_client.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/options.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/responses.go create mode 100644 sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/time_rfc3339.go delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go rename sdk/resourcemanager/networkanalytics/armnetworkanalytics/{response_types.go => responses.go} (100%) delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client_example_test.go delete mode 100644 sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client_example_test.go create mode 100644 sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accountquotas_client.go delete mode 100644 sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client_example_test.go create mode 100644 sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accountquotas_server.go delete mode 100644 sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client_example_test.go rename sdk/resourcemanager/playwrighttesting/armplaywrighttesting/{response_types.go => responses.go} (71%) delete mode 100644 sdk/resourcemanager/portal/armportal/dashboards_client_example_test.go create mode 100644 sdk/resourcemanager/portal/armportal/fake/time_rfc3339.go delete mode 100644 sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client_example_test.go delete mode 100644 sdk/resourcemanager/portal/armportal/operations_client_example_test.go rename sdk/resourcemanager/portal/armportal/{response_types.go => responses.go} (86%) delete mode 100644 sdk/resourcemanager/portal/armportal/tenantconfigurations_client_example_test.go create mode 100644 sdk/resourcemanager/portal/armportal/time_rfc3339.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go delete mode 100644 sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go delete mode 100644 sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client_example_test.go create mode 100644 sdk/resourcemanager/servicenetworking/armservicenetworking/fake/securitypoliciesinterface_server.go delete mode 100644 sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client_example_test.go delete mode 100644 sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client_example_test.go rename sdk/resourcemanager/servicenetworking/armservicenetworking/{response_types.go => responses.go} (76%) create mode 100644 sdk/resourcemanager/servicenetworking/armservicenetworking/securitypoliciesinterface_client.go delete mode 100644 sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/catalogs_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/certificates_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/deployments_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/devicegroups_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/devices_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/images_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/sphere/armsphere/products_client_example_test.go diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/CHANGELOG.md b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/CHANGELOG.md new file mode 100644 index 000000000000..533c590ff3a3 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 0.1.0 (2024-08-27) +### Other Changes + +The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/LICENSE.txt b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/LICENSE.txt new file mode 100644 index 000000000000..dc0c2ffb3dc1 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/README.md b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/README.md new file mode 100644 index 000000000000..7c3f378f2df0 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/README.md @@ -0,0 +1,92 @@ +# Azure Mpcnetworkfunction Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction) + +The `armmpcnetworkfunction` module provides operations for working with Azure Mpcnetworkfunction. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction) + +# Getting started + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) + +## Install the package + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure Mpcnetworkfunction module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure Mpcnetworkfunction. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. + +```go +cred, err := azidentity.NewDefaultAzureCredential(nil) +``` + +For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). + +## Client Factory + +Azure Mpcnetworkfunction module consists of one or more clients. We provide a client factory which could be used to create any client in this module. + +```go +clientFactory, err := armmpcnetworkfunction.NewClientFactory(, cred, nil) +``` + +You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). + +```go +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, +} +clientFactory, err := armmpcnetworkfunction.NewClientFactory(, cred, &options) +``` + +## Clients + +A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. + +```go +client := clientFactory.NewNetworkFunctionsClient() +``` + +## Fakes + +The fake package contains types used for constructing in-memory fake servers used in unit tests. +This allows writing tests to cover various success/error conditions without the need for connecting to a live service. + +Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes. + +## Provide Feedback + +If you encounter bugs or have suggestions, please +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Mpcnetworkfunction` label. + +# Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information, see the +[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. \ No newline at end of file diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/autorest.md b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/autorest.md new file mode 100644 index 000000000000..884eaaba80bc --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/autorest.md @@ -0,0 +1,13 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mpcnetworkfunction/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mpcnetworkfunction/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 0.1.0 + +``` \ No newline at end of file diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/build.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/build.go new file mode 100644 index 000000000000..76ea384815d7 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/build.go @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This file enables 'go generate' to regenerate this specific SDK +//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired -removeUnreferencedTypes resourcemanager/mpcnetworkfunction/armmpcnetworkfunction + +package armmpcnetworkfunction diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/ci.yml b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/ci.yml new file mode 100644 index 000000000000..4a1ecd8993a7 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/ci.yml @@ -0,0 +1,28 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/ + +extends: + template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + IncludeRelease: true + ServiceDirectory: 'resourcemanager/mpcnetworkfunction/armmpcnetworkfunction' diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/client_factory.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/client_factory.go new file mode 100644 index 000000000000..5844f1abae58 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/client_factory.go @@ -0,0 +1,52 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + subscriptionID string + internal *arm.Client +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + subscriptionID: subscriptionID, + internal: internal, + }, nil +} + +// NewNetworkFunctionsClient creates a new instance of NetworkFunctionsClient. +func (c *ClientFactory) NewNetworkFunctionsClient() *NetworkFunctionsClient { + return &NetworkFunctionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewOperationsClient creates a new instance of OperationsClient. +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + return &OperationsClient{ + internal: c.internal, + } +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/constants.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/constants.go new file mode 100644 index 000000000000..5c9374bef039 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/constants.go @@ -0,0 +1,223 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction" + moduleVersion = "v0.1.0" +) + +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// NetworkFunctionAdministrativeState - Network Function Administrative State enumerations +type NetworkFunctionAdministrativeState string + +const ( + // NetworkFunctionAdministrativeStateCommissioned - Resource has been commissioned + NetworkFunctionAdministrativeStateCommissioned NetworkFunctionAdministrativeState = "Commissioned" + // NetworkFunctionAdministrativeStateDecommissioned - Resource has been decommissioned + NetworkFunctionAdministrativeStateDecommissioned NetworkFunctionAdministrativeState = "Decommissioned" +) + +// PossibleNetworkFunctionAdministrativeStateValues returns the possible values for the NetworkFunctionAdministrativeState const type. +func PossibleNetworkFunctionAdministrativeStateValues() []NetworkFunctionAdministrativeState { + return []NetworkFunctionAdministrativeState{ + NetworkFunctionAdministrativeStateCommissioned, + NetworkFunctionAdministrativeStateDecommissioned, + } +} + +// NetworkFunctionOperationalStatus - Network Function Operational Status enumerations +type NetworkFunctionOperationalStatus string + +const ( + // NetworkFunctionOperationalStatusActive - Resource is fully deployed and operational + NetworkFunctionOperationalStatusActive NetworkFunctionOperationalStatus = "Active" + // NetworkFunctionOperationalStatusInactive - Resource is inactive + NetworkFunctionOperationalStatusInactive NetworkFunctionOperationalStatus = "Inactive" + // NetworkFunctionOperationalStatusInstantiatedNotProvisioned - Resource has been deployed, awaiting provisioning + NetworkFunctionOperationalStatusInstantiatedNotProvisioned NetworkFunctionOperationalStatus = "InstantiatedNotProvisioned" + // NetworkFunctionOperationalStatusInstantiatedProvisioned - Resource has been deployed and provisioned, awaiting testing + NetworkFunctionOperationalStatusInstantiatedProvisioned NetworkFunctionOperationalStatus = "InstantiatedProvisioned" +) + +// PossibleNetworkFunctionOperationalStatusValues returns the possible values for the NetworkFunctionOperationalStatus const type. +func PossibleNetworkFunctionOperationalStatusValues() []NetworkFunctionOperationalStatus { + return []NetworkFunctionOperationalStatus{ + NetworkFunctionOperationalStatusActive, + NetworkFunctionOperationalStatusInactive, + NetworkFunctionOperationalStatusInstantiatedNotProvisioned, + NetworkFunctionOperationalStatusInstantiatedProvisioned, + } +} + +// NetworkFunctionType - Type of Network Function +type NetworkFunctionType string + +const ( + // NetworkFunctionTypeAMF - Access and Mobility Function + NetworkFunctionTypeAMF NetworkFunctionType = "AMF" + // NetworkFunctionTypeEMS - Element Management System + NetworkFunctionTypeEMS NetworkFunctionType = "EMS" + // NetworkFunctionTypeEPDG - Evolved Packet Data Gateway + NetworkFunctionTypeEPDG NetworkFunctionType = "ePDG" + // NetworkFunctionTypeMME - Mobility Management Entity + NetworkFunctionTypeMME NetworkFunctionType = "MME" + // NetworkFunctionTypeN3IWF - Non-3GPP Interworking Function + NetworkFunctionTypeN3IWF NetworkFunctionType = "N3IWF" + // NetworkFunctionTypeNRF - Network Repository Function + NetworkFunctionTypeNRF NetworkFunctionType = "NRF" + // NetworkFunctionTypeNSSF - Network Slice Selection Function + NetworkFunctionTypeNSSF NetworkFunctionType = "NSSF" + // NetworkFunctionTypeOperationsPolicyManager - Operations and Policy Manager + NetworkFunctionTypeOperationsPolicyManager NetworkFunctionType = "OperationsPolicyManager" + // NetworkFunctionTypeRemotePaaS - Remote Platform As A Service Components + NetworkFunctionTypeRemotePaaS NetworkFunctionType = "RemotePaaS" + // NetworkFunctionTypeSMF - Session Management Function + NetworkFunctionTypeSMF NetworkFunctionType = "SMF" + // NetworkFunctionTypeSaegw - System Architecture Evolution Gateway. This combines the Serving Gateway (SGW) and the Packet + // Data Network Gateway (PGW) functionality + NetworkFunctionTypeSaegw NetworkFunctionType = "Saegw" + // NetworkFunctionTypeSaegwControlPlane - System Architecture Evolution Gateway Control Plane, control and user plane separation + // (CUPS) architecture + NetworkFunctionTypeSaegwControlPlane NetworkFunctionType = "SaegwControlPlane" + // NetworkFunctionTypeSaegwUserPlane - System Architecture Evolution Gateway User Plane, control and user plane separation + // (CUPS) architecture + NetworkFunctionTypeSaegwUserPlane NetworkFunctionType = "SaegwUserPlane" + // NetworkFunctionTypeUPF - User Plane Function + NetworkFunctionTypeUPF NetworkFunctionType = "UPF" +) + +// PossibleNetworkFunctionTypeValues returns the possible values for the NetworkFunctionType const type. +func PossibleNetworkFunctionTypeValues() []NetworkFunctionType { + return []NetworkFunctionType{ + NetworkFunctionTypeAMF, + NetworkFunctionTypeEMS, + NetworkFunctionTypeEPDG, + NetworkFunctionTypeMME, + NetworkFunctionTypeN3IWF, + NetworkFunctionTypeNRF, + NetworkFunctionTypeNSSF, + NetworkFunctionTypeOperationsPolicyManager, + NetworkFunctionTypeRemotePaaS, + NetworkFunctionTypeSMF, + NetworkFunctionTypeSaegw, + NetworkFunctionTypeSaegwControlPlane, + NetworkFunctionTypeSaegwUserPlane, + NetworkFunctionTypeUPF, + } +} + +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + +// ProvisioningState - Provisioning state of the resource +type ProvisioningState string + +const ( + // ProvisioningStateAccepted - Resource has been accepted + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled - Resource creation was canceled. + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting - Resource is getting deleted + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Resource creation failed. + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning - Resource is getting provisioned + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded - Resource has been created. + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating - Resource is updating + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateAccepted, + ProvisioningStateCanceled, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateProvisioning, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + +// SKUDefinitions - SKU Definitions +type SKUDefinitions string + +const ( + // SKUDefinitionsAzureLab - Azure Lab SKU + SKUDefinitionsAzureLab SKUDefinitions = "AzureLab" + // SKUDefinitionsAzureProduction - Azure Production SKU + SKUDefinitionsAzureProduction SKUDefinitions = "AzureProduction" + // SKUDefinitionsNexusLab - Nexus Lab SKU + SKUDefinitionsNexusLab SKUDefinitions = "NexusLab" + // SKUDefinitionsNexusProduction - Nexus Production SKU + SKUDefinitionsNexusProduction SKUDefinitions = "NexusProduction" +) + +// PossibleSKUDefinitionsValues returns the possible values for the SKUDefinitions const type. +func PossibleSKUDefinitionsValues() []SKUDefinitions { + return []SKUDefinitions{ + SKUDefinitionsAzureLab, + SKUDefinitionsAzureProduction, + SKUDefinitionsNexusLab, + SKUDefinitionsNexusProduction, + } +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/internal.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/internal.go new file mode 100644 index 000000000000..5f75802a569e --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/internal.go @@ -0,0 +1,64 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "net/http" + "sync" +) + +type nonRetriableError struct { + error +} + +func (nonRetriableError) NonRetriable() { + // marker method +} + +func contains[T comparable](s []T, v T) bool { + for _, vv := range s { + if vv == v { + return true + } + } + return false +} + +func newTracker[T any]() *tracker[T] { + return &tracker[T]{ + items: map[string]*T{}, + } +} + +type tracker[T any] struct { + items map[string]*T + mu sync.Mutex +} + +func (p *tracker[T]) get(req *http.Request) *T { + p.mu.Lock() + defer p.mu.Unlock() + if item, ok := p.items[server.SanitizePagerPollerPath(req.URL.Path)]; ok { + return item + } + return nil +} + +func (p *tracker[T]) add(req *http.Request, item *T) { + p.mu.Lock() + defer p.mu.Unlock() + p.items[server.SanitizePagerPollerPath(req.URL.Path)] = item +} + +func (p *tracker[T]) remove(req *http.Request) { + p.mu.Lock() + defer p.mu.Unlock() + delete(p.items, server.SanitizePagerPollerPath(req.URL.Path)) +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/networkfunctions_server.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/networkfunctions_server.go new file mode 100644 index 000000000000..1c66ff159136 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/networkfunctions_server.go @@ -0,0 +1,327 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction" + "net/http" + "net/url" + "regexp" +) + +// NetworkFunctionsServer is a fake server for instances of the armmpcnetworkfunction.NetworkFunctionsClient type. +type NetworkFunctionsServer struct { + // BeginCreateOrUpdate is the fake for method NetworkFunctionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, networkFunctionName string, resource armmpcnetworkfunction.NetworkFunctionResource, options *armmpcnetworkfunction.NetworkFunctionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmpcnetworkfunction.NetworkFunctionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method NetworkFunctionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, networkFunctionName string, options *armmpcnetworkfunction.NetworkFunctionsClientDeleteOptions) (resp azfake.Responder[armmpcnetworkfunction.NetworkFunctionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method NetworkFunctionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkFunctionName string, options *armmpcnetworkfunction.NetworkFunctionsClientGetOptions) (resp azfake.Responder[armmpcnetworkfunction.NetworkFunctionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method NetworkFunctionsClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armmpcnetworkfunction.NetworkFunctionsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armmpcnetworkfunction.NetworkFunctionsClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method NetworkFunctionsClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armmpcnetworkfunction.NetworkFunctionsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armmpcnetworkfunction.NetworkFunctionsClientListBySubscriptionResponse]) + + // UpdateTags is the fake for method NetworkFunctionsClient.UpdateTags + // HTTP status codes to indicate success: http.StatusOK + UpdateTags func(ctx context.Context, resourceGroupName string, networkFunctionName string, properties armmpcnetworkfunction.NetworkFunctionResourceTagsUpdate, options *armmpcnetworkfunction.NetworkFunctionsClientUpdateTagsOptions) (resp azfake.Responder[armmpcnetworkfunction.NetworkFunctionsClientUpdateTagsResponse], errResp azfake.ErrorResponder) +} + +// NewNetworkFunctionsServerTransport creates a new instance of NetworkFunctionsServerTransport with the provided implementation. +// The returned NetworkFunctionsServerTransport instance is connected to an instance of armmpcnetworkfunction.NetworkFunctionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNetworkFunctionsServerTransport(srv *NetworkFunctionsServer) *NetworkFunctionsServerTransport { + return &NetworkFunctionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmpcnetworkfunction.NetworkFunctionsClientCreateOrUpdateResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmpcnetworkfunction.NetworkFunctionsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmpcnetworkfunction.NetworkFunctionsClientListBySubscriptionResponse]](), + } +} + +// NetworkFunctionsServerTransport connects instances of armmpcnetworkfunction.NetworkFunctionsClient to instances of NetworkFunctionsServer. +// Don't use this type directly, use NewNetworkFunctionsServerTransport instead. +type NetworkFunctionsServerTransport struct { + srv *NetworkFunctionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmpcnetworkfunction.NetworkFunctionsClientCreateOrUpdateResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmpcnetworkfunction.NetworkFunctionsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmpcnetworkfunction.NetworkFunctionsClientListBySubscriptionResponse]] +} + +// Do implements the policy.Transporter interface for NetworkFunctionsServerTransport. +func (n *NetworkFunctionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "NetworkFunctionsClient.BeginCreateOrUpdate": + resp, err = n.dispatchBeginCreateOrUpdate(req) + case "NetworkFunctionsClient.Delete": + resp, err = n.dispatchDelete(req) + case "NetworkFunctionsClient.Get": + resp, err = n.dispatchGet(req) + case "NetworkFunctionsClient.NewListByResourceGroupPager": + resp, err = n.dispatchNewListByResourceGroupPager(req) + case "NetworkFunctionsClient.NewListBySubscriptionPager": + resp, err = n.dispatchNewListBySubscriptionPager(req) + case "NetworkFunctionsClient.UpdateTags": + resp, err = n.dispatchUpdateTags(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (n *NetworkFunctionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if n.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := n.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MobilePacketCore/networkFunctions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmpcnetworkfunction.NetworkFunctionResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkFunctionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkFunctionName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, networkFunctionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + n.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + n.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + n.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (n *NetworkFunctionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if n.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MobilePacketCore/networkFunctions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkFunctionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkFunctionName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Delete(req.Context(), resourceGroupNameParam, networkFunctionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NetworkFunctionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if n.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MobilePacketCore/networkFunctions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkFunctionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkFunctionName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Get(req.Context(), resourceGroupNameParam, networkFunctionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkFunctionResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NetworkFunctionsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if n.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := n.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MobilePacketCore/networkFunctions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := n.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + n.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmpcnetworkfunction.NetworkFunctionsClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + n.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (n *NetworkFunctionsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if n.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := n.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MobilePacketCore/networkFunctions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := n.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + n.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmpcnetworkfunction.NetworkFunctionsClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + n.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (n *NetworkFunctionsServerTransport) dispatchUpdateTags(req *http.Request) (*http.Response, error) { + if n.srv.UpdateTags == nil { + return nil, &nonRetriableError{errors.New("fake for method UpdateTags not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MobilePacketCore/networkFunctions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmpcnetworkfunction.NetworkFunctionResourceTagsUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkFunctionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkFunctionName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.UpdateTags(req.Context(), resourceGroupNameParam, networkFunctionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkFunctionResource, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/operations_server.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/operations_server.go new file mode 100644 index 000000000000..9a0fa79b986a --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/operations_server.go @@ -0,0 +1,96 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction" + "net/http" +) + +// OperationsServer is a fake server for instances of the armmpcnetworkfunction.OperationsClient type. +type OperationsServer struct { + // NewListPager is the fake for method OperationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(options *armmpcnetworkfunction.OperationsClientListOptions) (resp azfake.PagerResponder[armmpcnetworkfunction.OperationsClientListResponse]) +} + +// NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. +// The returned OperationsServerTransport instance is connected to an instance of armmpcnetworkfunction.OperationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { + return &OperationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmpcnetworkfunction.OperationsClientListResponse]](), + } +} + +// OperationsServerTransport connects instances of armmpcnetworkfunction.OperationsClient to instances of OperationsServer. +// Don't use this type directly, use NewOperationsServerTransport instead. +type OperationsServerTransport struct { + srv *OperationsServer + newListPager *tracker[azfake.PagerResponder[armmpcnetworkfunction.OperationsClientListResponse]] +} + +// Do implements the policy.Transporter interface for OperationsServerTransport. +func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "OperationsClient.NewListPager": + resp, err = o.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := o.newListPager.get(req) + if newListPager == nil { + resp := o.srv.NewListPager(nil) + newListPager = &resp + o.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmpcnetworkfunction.OperationsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/server_factory.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/server_factory.go new file mode 100644 index 000000000000..3ae8f7f76c6f --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/server_factory.go @@ -0,0 +1,82 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "strings" + "sync" +) + +// ServerFactory is a fake server for instances of the armmpcnetworkfunction.ClientFactory type. +type ServerFactory struct { + NetworkFunctionsServer NetworkFunctionsServer + OperationsServer OperationsServer +} + +// NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. +// The returned ServerFactoryTransport instance is connected to an instance of armmpcnetworkfunction.ClientFactory via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { + return &ServerFactoryTransport{ + srv: srv, + } +} + +// ServerFactoryTransport connects instances of armmpcnetworkfunction.ClientFactory to instances of ServerFactory. +// Don't use this type directly, use NewServerFactoryTransport instead. +type ServerFactoryTransport struct { + srv *ServerFactory + trMu sync.Mutex + trNetworkFunctionsServer *NetworkFunctionsServerTransport + trOperationsServer *OperationsServerTransport +} + +// Do implements the policy.Transporter interface for ServerFactoryTransport. +func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + client := method[:strings.Index(method, ".")] + var resp *http.Response + var err error + + switch client { + case "NetworkFunctionsClient": + initServer(s, &s.trNetworkFunctionsServer, func() *NetworkFunctionsServerTransport { + return NewNetworkFunctionsServerTransport(&s.srv.NetworkFunctionsServer) + }) + resp, err = s.trNetworkFunctionsServer.Do(req) + case "OperationsClient": + initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) + resp, err = s.trOperationsServer.Do(req) + default: + err = fmt.Errorf("unhandled client %s", client) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { + s.trMu.Lock() + if *dst == nil { + *dst = src() + } + s.trMu.Unlock() +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/time_rfc3339.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/time_rfc3339.go new file mode 100644 index 000000000000..81f308b0d343 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/fake/time_rfc3339.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.mod b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.mod new file mode 100644 index 000000000000..9c1b4b0f0791 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.mod @@ -0,0 +1,11 @@ +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction + +go 1.18 + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/text v0.14.0 // indirect +) diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.sum b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.sum new file mode 100644 index 000000000000..03ce617a1873 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/go.sum @@ -0,0 +1,12 @@ +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 h1:c4k2FIYIh4xtwqrQwV0Ct1v5+ehlNXj5NI/MWVsiTkQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2/go.mod h1:5FDJtLEO/GxwNgUxbwrY3LP0pEoThTQJtk2oysdXHxM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models.go new file mode 100644 index 000000000000..58a201cf6c1a --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models.go @@ -0,0 +1,151 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +import "time" + +// NetworkFunctionResource - AO5GC Network Function Resource +type NetworkFunctionResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // The resource-specific properties for this resource. + Properties *NetworkFunctionResourceProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkFunctionResourceListResult - The response of a NetworkFunctionResource list operation. +type NetworkFunctionResourceListResult struct { + // REQUIRED; The NetworkFunctionResource items on this page + Value []*NetworkFunctionResource + + // The link to the next page of items + NextLink *string +} + +// NetworkFunctionResourceProperties - Network Function Properties. +type NetworkFunctionResourceProperties struct { + // REQUIRED; Administrative state of the network function + NetworkFunctionAdministrativeState *NetworkFunctionAdministrativeState + + // REQUIRED; Type of network function + NetworkFunctionType *NetworkFunctionType + + // REQUIRED; Provisioned SKU Value. + SKU *SKUDefinitions + + // Capacity of the network function in units of 10000. This represents the session count or the Simultaneously Attached Users + // (SAU) count as applicable + Capacity *int32 + + // User provided deployment notes. This is used to optionally provide details about the NF deployment + DeploymentNotes *string + + // User provided description + UserDescription *string + + // READ-ONLY; Count of infrastructure elements used by this network function (vCPUs, in units of 8) + InfrastructureElementCount *int32 + + // READ-ONLY; Operational state of the network function + NetworkFunctionOperationalStatus *NetworkFunctionOperationalStatus + + // READ-ONLY; The status of the last operation. + ProvisioningState *ProvisioningState +} + +// NetworkFunctionResourceTagsUpdate - The type used for updating tags in NetworkFunctionResource resources. +type NetworkFunctionResourceTagsUpdate struct { + // Resource tags. + Tags map[string]*string +} + +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". + Operation *string + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation +} + +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models_serde.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models_serde.go new file mode 100644 index 000000000000..2a9aa78c6694 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/models_serde.go @@ -0,0 +1,364 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionResource. +func (n NetworkFunctionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionResource. +func (n *NetworkFunctionResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionResourceListResult. +func (n NetworkFunctionResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionResourceListResult. +func (n *NetworkFunctionResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionResourceProperties. +func (n NetworkFunctionResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", n.Capacity) + populate(objectMap, "deploymentNotes", n.DeploymentNotes) + populate(objectMap, "infrastructureElementCount", n.InfrastructureElementCount) + populate(objectMap, "networkFunctionAdministrativeState", n.NetworkFunctionAdministrativeState) + populate(objectMap, "networkFunctionOperationalStatus", n.NetworkFunctionOperationalStatus) + populate(objectMap, "networkFunctionType", n.NetworkFunctionType) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "sku", n.SKU) + populate(objectMap, "userDescription", n.UserDescription) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionResourceProperties. +func (n *NetworkFunctionResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &n.Capacity) + delete(rawMsg, key) + case "deploymentNotes": + err = unpopulate(val, "DeploymentNotes", &n.DeploymentNotes) + delete(rawMsg, key) + case "infrastructureElementCount": + err = unpopulate(val, "InfrastructureElementCount", &n.InfrastructureElementCount) + delete(rawMsg, key) + case "networkFunctionAdministrativeState": + err = unpopulate(val, "NetworkFunctionAdministrativeState", &n.NetworkFunctionAdministrativeState) + delete(rawMsg, key) + case "networkFunctionOperationalStatus": + err = unpopulate(val, "NetworkFunctionOperationalStatus", &n.NetworkFunctionOperationalStatus) + delete(rawMsg, key) + case "networkFunctionType": + err = unpopulate(val, "NetworkFunctionType", &n.NetworkFunctionType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &n.SKU) + delete(rawMsg, key) + case "userDescription": + err = unpopulate(val, "UserDescription", &n.UserDescription) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFunctionResourceTagsUpdate. +func (n NetworkFunctionResourceTagsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFunctionResourceTagsUpdate. +func (n *NetworkFunctionResourceTagsUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil || string(data) == "null" { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/networkfunctions_client.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/networkfunctions_client.go new file mode 100644 index 000000000000..6873648d3f89 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/networkfunctions_client.go @@ -0,0 +1,427 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkFunctionsClient contains the methods for the NetworkFunctions group. +// Don't use this type directly, use NewNetworkFunctionsClient() instead. +type NetworkFunctionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkFunctionsClient creates a new instance of NetworkFunctionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkFunctionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFunctionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkFunctionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a NetworkFunctionResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFunctionName - The name of the network function +// - resource - Resource create parameters. +// - options - NetworkFunctionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionsClient.BeginCreateOrUpdate +// method. +func (client *NetworkFunctionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkFunctionName string, resource NetworkFunctionResource, options *NetworkFunctionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkFunctionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkFunctionName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFunctionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NetworkFunctionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a NetworkFunctionResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-15-preview +func (client *NetworkFunctionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkFunctionName string, resource NetworkFunctionResource, options *NetworkFunctionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "NetworkFunctionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkFunctionName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NetworkFunctionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, resource NetworkFunctionResource, options *NetworkFunctionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobilePacketCore/networkFunctions/{networkFunctionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// Delete - Delete a NetworkFunctionResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFunctionName - The name of the network function +// - options - NetworkFunctionsClientDeleteOptions contains the optional parameters for the NetworkFunctionsClient.Delete method. +func (client *NetworkFunctionsClient) Delete(ctx context.Context, resourceGroupName string, networkFunctionName string, options *NetworkFunctionsClientDeleteOptions) (NetworkFunctionsClientDeleteResponse, error) { + var err error + const operationName = "NetworkFunctionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFunctionName, options) + if err != nil { + return NetworkFunctionsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionsClientDeleteResponse{}, err + } + return NetworkFunctionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkFunctionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, options *NetworkFunctionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobilePacketCore/networkFunctions/{networkFunctionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a NetworkFunctionResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFunctionName - The name of the network function +// - options - NetworkFunctionsClientGetOptions contains the optional parameters for the NetworkFunctionsClient.Get method. +func (client *NetworkFunctionsClient) Get(ctx context.Context, resourceGroupName string, networkFunctionName string, options *NetworkFunctionsClientGetOptions) (NetworkFunctionsClientGetResponse, error) { + var err error + const operationName = "NetworkFunctionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, networkFunctionName, options) + if err != nil { + return NetworkFunctionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkFunctionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, options *NetworkFunctionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobilePacketCore/networkFunctions/{networkFunctionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkFunctionsClient) getHandleResponse(resp *http.Response) (NetworkFunctionsClientGetResponse, error) { + result := NetworkFunctionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionResource); err != nil { + return NetworkFunctionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List NetworkFunctionResource resources by resource group +// +// Generated from API version 2023-05-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - NetworkFunctionsClientListByResourceGroupOptions contains the optional parameters for the NetworkFunctionsClient.NewListByResourceGroupPager +// method. +func (client *NetworkFunctionsClient) NewListByResourceGroupPager(resourceGroupName string, options *NetworkFunctionsClientListByResourceGroupOptions) *runtime.Pager[NetworkFunctionsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkFunctionsClientListByResourceGroupResponse]{ + More: func(page NetworkFunctionsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkFunctionsClientListByResourceGroupResponse) (NetworkFunctionsClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkFunctionsClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return NetworkFunctionsClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *NetworkFunctionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkFunctionsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobilePacketCore/networkFunctions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *NetworkFunctionsClient) listByResourceGroupHandleResponse(resp *http.Response) (NetworkFunctionsClientListByResourceGroupResponse, error) { + result := NetworkFunctionsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionResourceListResult); err != nil { + return NetworkFunctionsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List NetworkFunctionResource resources by subscription ID +// +// Generated from API version 2023-05-15-preview +// - options - NetworkFunctionsClientListBySubscriptionOptions contains the optional parameters for the NetworkFunctionsClient.NewListBySubscriptionPager +// method. +func (client *NetworkFunctionsClient) NewListBySubscriptionPager(options *NetworkFunctionsClientListBySubscriptionOptions) *runtime.Pager[NetworkFunctionsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkFunctionsClientListBySubscriptionResponse]{ + More: func(page NetworkFunctionsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkFunctionsClientListBySubscriptionResponse) (NetworkFunctionsClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkFunctionsClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return NetworkFunctionsClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *NetworkFunctionsClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkFunctionsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MobilePacketCore/networkFunctions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *NetworkFunctionsClient) listBySubscriptionHandleResponse(resp *http.Response) (NetworkFunctionsClientListBySubscriptionResponse, error) { + result := NetworkFunctionsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionResourceListResult); err != nil { + return NetworkFunctionsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// UpdateTags - Update a NetworkFunctionResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFunctionName - The name of the network function +// - properties - The resource properties to be updated. +// - options - NetworkFunctionsClientUpdateTagsOptions contains the optional parameters for the NetworkFunctionsClient.UpdateTags +// method. +func (client *NetworkFunctionsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkFunctionName string, properties NetworkFunctionResourceTagsUpdate, options *NetworkFunctionsClientUpdateTagsOptions) (NetworkFunctionsClientUpdateTagsResponse, error) { + var err error + const operationName = "NetworkFunctionsClient.UpdateTags" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkFunctionName, properties, options) + if err != nil { + return NetworkFunctionsClientUpdateTagsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkFunctionsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFunctionsClientUpdateTagsResponse{}, err + } + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *NetworkFunctionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, properties NetworkFunctionResourceTagsUpdate, options *NetworkFunctionsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobilePacketCore/networkFunctions/{networkFunctionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *NetworkFunctionsClient) updateTagsHandleResponse(resp *http.Response) (NetworkFunctionsClientUpdateTagsResponse, error) { + result := NetworkFunctionsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFunctionResource); err != nil { + return NetworkFunctionsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/operations_client.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/operations_client.go new file mode 100644 index 000000000000..6f190c680ea3 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/operations_client.go @@ -0,0 +1,88 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// OperationsClient contains the methods for the Operations group. +// Don't use this type directly, use NewOperationsClient() instead. +type OperationsClient struct { + internal *arm.Client +} + +// NewOperationsClient creates a new instance of OperationsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + internal: cl, + } + return client, nil +} + +// NewListPager - List the operations for the provider +// +// Generated from API version 2023-05-15-preview +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return OperationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.MobilePacketCore/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { + result := OperationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { + return OperationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/options.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/options.go new file mode 100644 index 000000000000..456a966c1342 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/options.go @@ -0,0 +1,48 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +// NetworkFunctionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkFunctionsClient.BeginCreateOrUpdate +// method. +type NetworkFunctionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFunctionsClientDeleteOptions contains the optional parameters for the NetworkFunctionsClient.Delete method. +type NetworkFunctionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientGetOptions contains the optional parameters for the NetworkFunctionsClient.Get method. +type NetworkFunctionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientListByResourceGroupOptions contains the optional parameters for the NetworkFunctionsClient.NewListByResourceGroupPager +// method. +type NetworkFunctionsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientListBySubscriptionOptions contains the optional parameters for the NetworkFunctionsClient.NewListBySubscriptionPager +// method. +type NetworkFunctionsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkFunctionsClientUpdateTagsOptions contains the optional parameters for the NetworkFunctionsClient.UpdateTags method. +type NetworkFunctionsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/responses.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/responses.go new file mode 100644 index 000000000000..32b7409f126f --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/responses.go @@ -0,0 +1,50 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +// NetworkFunctionsClientCreateOrUpdateResponse contains the response from method NetworkFunctionsClient.BeginCreateOrUpdate. +type NetworkFunctionsClientCreateOrUpdateResponse struct { + // AO5GC Network Function Resource + NetworkFunctionResource +} + +// NetworkFunctionsClientDeleteResponse contains the response from method NetworkFunctionsClient.Delete. +type NetworkFunctionsClientDeleteResponse struct { + // placeholder for future response values +} + +// NetworkFunctionsClientGetResponse contains the response from method NetworkFunctionsClient.Get. +type NetworkFunctionsClientGetResponse struct { + // AO5GC Network Function Resource + NetworkFunctionResource +} + +// NetworkFunctionsClientListByResourceGroupResponse contains the response from method NetworkFunctionsClient.NewListByResourceGroupPager. +type NetworkFunctionsClientListByResourceGroupResponse struct { + // The response of a NetworkFunctionResource list operation. + NetworkFunctionResourceListResult +} + +// NetworkFunctionsClientListBySubscriptionResponse contains the response from method NetworkFunctionsClient.NewListBySubscriptionPager. +type NetworkFunctionsClientListBySubscriptionResponse struct { + // The response of a NetworkFunctionResource list operation. + NetworkFunctionResourceListResult +} + +// NetworkFunctionsClientUpdateTagsResponse contains the response from method NetworkFunctionsClient.UpdateTags. +type NetworkFunctionsClientUpdateTagsResponse struct { + // AO5GC Network Function Resource + NetworkFunctionResource +} + +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. +type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult +} diff --git a/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/time_rfc3339.go b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/time_rfc3339.go new file mode 100644 index 000000000000..cf2a0a1408b9 --- /dev/null +++ b/sdk/resourcemanager/mpcnetworkfunction/armmpcnetworkfunction/time_rfc3339.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmpcnetworkfunction + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md index e3a046bf2067..242ebc65e03f 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2024-08-27) +### Other Changes + + ## 1.0.0 (2024-01-26) ### Other Changes diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md index ba8feb90c3a7..e451707572ca 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/networkanalytics/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/networkanalytics/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-11-15 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/client_factory.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/client_factory.go index 39968accc35e..feda298d8602 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/client_factory.go +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,36 +26,43 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewDataProductsCatalogsClient creates a new instance of DataProductsCatalogsClient. func (c *ClientFactory) NewDataProductsCatalogsClient() *DataProductsCatalogsClient { - subClient, _ := NewDataProductsCatalogsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DataProductsCatalogsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDataProductsClient creates a new instance of DataProductsClient. func (c *ClientFactory) NewDataProductsClient() *DataProductsClient { - subClient, _ := NewDataProductsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DataProductsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDataTypesClient creates a new instance of DataTypesClient. func (c *ClientFactory) NewDataTypesClient() *DataTypesClient { - subClient, _ := NewDataTypesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DataTypesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go index 23529a788159..6f4934680137 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go @@ -10,7 +10,7 @@ package armnetworkanalytics const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go deleted file mode 100644 index cf286589086f..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go +++ /dev/null @@ -1,1115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkanalytics_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListBySubscription_MaximumSet_Gen.json -func ExampleDataProductsClient_NewListBySubscriptionPager_dataProductsListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListBySubscription_MinimumSet_Gen.json -func ExampleDataProductsClient_NewListBySubscriptionPager_dataProductsListBySubscriptionMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListByResourceGroup_MaximumSet_Gen.json -func ExampleDataProductsClient_NewListByResourceGroupPager_dataProductsListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListByResourceGroupPager("aoiresourceGroupName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListByResourceGroup_MinimumSet_Gen.json -func ExampleDataProductsClient_NewListByResourceGroupPager_dataProductsListByResourceGroupMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListByResourceGroupPager("aoiresourceGroupName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Get_MaximumSet_Gen.json -func ExampleDataProductsClient_Get_dataProductsGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProduct = armnetworkanalytics.DataProduct{ - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Get_MinimumSet_Gen.json -func ExampleDataProductsClient_Get_dataProductsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProduct = armnetworkanalytics.DataProduct{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Create_MaximumSet_Gen.json -func ExampleDataProductsClient_BeginCreate_dataProductsCreateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProduct{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - }, - Identity: &armnetworkanalytics.ManagedServiceIdentity{ - Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Properties: &armnetworkanalytics.DataProductProperties{ - ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{}, - CurrentMinorVersion: to.Ptr("1.0.1"), - CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - KeyName: to.Ptr("keyName"), - KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - KeyVersion: to.Ptr("keyVersion"), - }, - CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - MajorVersion: to.Ptr("1.0.0"), - ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - Name: to.Ptr("managedResourceGroupName"), - Location: to.Ptr("eastus"), - }, - Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - AllowedQueryIPRangeList: []*string{ - to.Ptr("1.1.1.1")}, - DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - IPRules: []*armnetworkanalytics.IPRules{ - { - Action: to.Ptr("Allow"), - Value: to.Ptr("1.1.1.1"), - }}, - VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - { - Action: to.Ptr("Allow"), - ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - State: to.Ptr(""), - }}, - }, - Owners: []*string{ - to.Ptr("abc@micros.com")}, - PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - Product: to.Ptr("MCC"), - ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - Publisher: to.Ptr("Microsoft"), - PurviewAccount: to.Ptr("testpurview"), - PurviewCollection: to.Ptr("134567890"), - Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProduct = armnetworkanalytics.DataProduct{ - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Create_MinimumSet_Gen.json -func ExampleDataProductsClient_BeginCreate_dataProductsCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProduct{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - }, - Properties: &armnetworkanalytics.DataProductProperties{ - MajorVersion: to.Ptr("1.0.0"), - Product: to.Ptr("MCC"), - Publisher: to.Ptr("Microsoft"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProduct = armnetworkanalytics.DataProduct{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Update_MaximumSet_Gen.json -func ExampleDataProductsClient_BeginUpdate_dataProductsUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProductUpdate{ - Identity: &armnetworkanalytics.ManagedServiceIdentity{ - Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Properties: &armnetworkanalytics.DataProductUpdateProperties{ - CurrentMinorVersion: to.Ptr("1.0.1"), - Owners: []*string{ - to.Ptr("abc@micros.com"), - to.Ptr("def@micros.com")}, - PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - PurviewAccount: to.Ptr("testpurview"), - PurviewCollection: to.Ptr("134567890"), - }, - Tags: map[string]*string{ - "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProduct = armnetworkanalytics.DataProduct{ - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com"), - // to.Ptr("def@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Update_MinimumSet_Gen.json -func ExampleDataProductsClient_BeginUpdate_dataProductsUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProductUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProduct = armnetworkanalytics.DataProduct{ - // Location: to.Ptr("jwlerdaudgxff"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Delete_MaximumSet_Gen.json -func ExampleDataProductsClient_BeginDelete_dataProductsDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Delete_MinimumSet_Gen.json -func ExampleDataProductsClient_BeginDelete_dataProductsDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_AddUserRole_MaximumSet_Gen.json -func ExampleDataProductsClient_AddUserRole_dataProductsAddUserRoleMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().AddUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentCommonProperties{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("UserName"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RoleAssignmentDetail = armnetworkanalytics.RoleAssignmentDetail{ - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("UserName"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_AddUserRole_MinimumSet_Gen.json -func ExampleDataProductsClient_AddUserRole_dataProductsAddUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().AddUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentCommonProperties{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("userName"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RoleAssignmentDetail = armnetworkanalytics.RoleAssignmentDetail{ - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("userName"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen.json -func ExampleDataProductsClient_GenerateStorageAccountSasToken_dataProductsGenerateStorageAccountSasTokenMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().GenerateStorageAccountSasToken(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.AccountSas{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.151Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.151Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccountSasToken = armnetworkanalytics.AccountSasToken{ - // StorageAccountSasToken: to.Ptr("storageAccountSasToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_GenerateStorageAccountSasToken_MinimumSet_Gen.json -func ExampleDataProductsClient_GenerateStorageAccountSasToken_dataProductsGenerateStorageAccountSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().GenerateStorageAccountSasToken(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.AccountSas{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:17.051Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:17.051Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccountSasToken = armnetworkanalytics.AccountSasToken{ - // StorageAccountSasToken: to.Ptr("storageAccountSasToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListRolesAssignments_MaximumSet_Gen.json -func ExampleDataProductsClient_ListRolesAssignments_dataProductsListRolesAssignmentsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().ListRolesAssignments(ctx, "aoiresourceGroupName", "dataproduct01", map[string]any{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListRoleAssignments = armnetworkanalytics.ListRoleAssignments{ - // Count: to.Ptr[int32](1), - // RoleAssignmentResponse: []*armnetworkanalytics.RoleAssignmentDetail{ - // { - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("UserName"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListRolesAssignments_MinimumSet_Gen.json -func ExampleDataProductsClient_ListRolesAssignments_dataProductsListRolesAssignmentsMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().ListRolesAssignments(ctx, "aoiresourceGroupName", "dataproduct01", map[string]any{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListRoleAssignments = armnetworkanalytics.ListRoleAssignments{ - // Count: to.Ptr[int32](1), - // RoleAssignmentResponse: []*armnetworkanalytics.RoleAssignmentDetail{ - // { - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("UserName"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RemoveUserRole_MaximumSet_Gen.json -func ExampleDataProductsClient_RemoveUserRole_dataProductsRemoveUserRoleMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RemoveUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentDetail{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("UserName"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RemoveUserRole_MinimumSet_Gen.json -func ExampleDataProductsClient_RemoveUserRole_dataProductsRemoveUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RemoveUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentDetail{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("UserName"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RotateKey_MaximumSet_Gen.json -func ExampleDataProductsClient_RotateKey_dataProductsRotateKeyMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RotateKey(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.KeyVaultInfo{ - KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RotateKey_MinimumSet_Gen.json -func ExampleDataProductsClient_RotateKey_dataProductsRotateKeyMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RotateKey(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.KeyVaultInfo{ - KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go deleted file mode 100644 index 011ad4b61e9b..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go +++ /dev/null @@ -1,266 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListBySubscription_MaximumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListBySubscriptionPager_dataProductsCatalogsListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/dataProductsCatalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataProductsCatalogProperties{ - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // Publishers: []*armnetworkanalytics.PublisherInformation{ - // { - // DataProducts: []*armnetworkanalytics.DataProductInformation{ - // { - // Description: to.Ptr("Official data product for Mobile Content Cloud."), - // DataProductName: to.Ptr("MCC"), - // DataProductVersions: []*armnetworkanalytics.DataProductVersion{ - // { - // Version: to.Ptr("1.0.0"), - // }}, - // }}, - // PublisherName: to.Ptr("Microsoft"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListBySubscription_MinimumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListBySubscriptionPager_dataProductsCatalogsListBySubscriptionMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListByResourceGroup_MaximumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListByResourceGroupPager_dataProductsCatalogsListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListByResourceGroupPager("aoiresourceGroupName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/dataProductsCatalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataProductsCatalogProperties{ - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // Publishers: []*armnetworkanalytics.PublisherInformation{ - // { - // DataProducts: []*armnetworkanalytics.DataProductInformation{ - // { - // Description: to.Ptr("Official data product for Mobile Content Cloud."), - // DataProductName: to.Ptr("MCC"), - // DataProductVersions: []*armnetworkanalytics.DataProductVersion{ - // { - // Version: to.Ptr("1.0.0"), - // }}, - // }}, - // PublisherName: to.Ptr("Microsoft"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListByResourceGroup_MinimumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListByResourceGroupPager_dataProductsCatalogsListByResourceGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListByResourceGroupPager("aoiresourceGroupName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_Get_MaximumSet_Gen.json -func ExampleDataProductsCatalogsClient_Get_dataProductsCatalogsGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsCatalogsClient().Get(ctx, "aoiresourceGroupName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProductsCatalog = armnetworkanalytics.DataProductsCatalog{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/dataProductsCatalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataProductsCatalogProperties{ - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // Publishers: []*armnetworkanalytics.PublisherInformation{ - // { - // DataProducts: []*armnetworkanalytics.DataProductInformation{ - // { - // Description: to.Ptr("Official data product for Mobile Content Cloud."), - // DataProductName: to.Ptr("MCC"), - // DataProductVersions: []*armnetworkanalytics.DataProductVersion{ - // { - // Version: to.Ptr("1.0.0"), - // }}, - // }}, - // PublisherName: to.Ptr("Microsoft"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_Get_MinimumSet_Gen.json -func ExampleDataProductsCatalogsClient_Get_dataProductsCatalogsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsCatalogsClient().Get(ctx, "aoiresourceGroupName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataProductsCatalog = armnetworkanalytics.DataProductsCatalog{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // } -} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go deleted file mode 100644 index 2df503e3bff1..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go +++ /dev/null @@ -1,464 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkanalytics_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_ListByDataProduct_MaximumSet_Gen.json -func ExampleDataTypesClient_NewListByDataProductPager_dataTypesListByDataProductMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataTypesClient().NewListByDataProductPager("aoiresourceGroupName", "dataproduct01", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataTypeListResult = armnetworkanalytics.DataTypeListResult{ - // Value: []*armnetworkanalytics.DataType{ - // { - // Name: to.Ptr("datatypename"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](23), - // DatabaseRetention: to.Ptr[int32](6), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("state Reason"), - // StorageOutputRetention: to.Ptr[int32](27), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_ListByDataProduct_MinimumSet_Gen.json -func ExampleDataTypesClient_NewListByDataProductPager_dataTypesListByDataProductMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataTypesClient().NewListByDataProductPager("aoiresourceGroupName", "dataproduct01", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataTypeListResult = armnetworkanalytics.DataTypeListResult{ - // Value: []*armnetworkanalytics.DataType{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Get_MaximumSet_Gen.json -func ExampleDataTypesClient_Get_dataTypesGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataType = armnetworkanalytics.DataType{ - // Name: to.Ptr("datatypename"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](23), - // DatabaseRetention: to.Ptr[int32](6), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("state Reason"), - // StorageOutputRetention: to.Ptr[int32](27), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Get_MinimumSet_Gen.json -func ExampleDataTypesClient_Get_dataTypesGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataType = armnetworkanalytics.DataType{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Create_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginCreate_dataTypesCreateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataType{ - Properties: &armnetworkanalytics.DataTypeProperties{ - DatabaseCacheRetention: to.Ptr[int32](23), - DatabaseRetention: to.Ptr[int32](6), - ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - StorageOutputRetention: to.Ptr[int32](27), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataType = armnetworkanalytics.DataType{ - // Name: to.Ptr("datatypeName"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](23), - // DatabaseRetention: to.Ptr[int32](6), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("State Reason"), - // StorageOutputRetention: to.Ptr[int32](27), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Create_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginCreate_dataTypesCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataType{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataType = armnetworkanalytics.DataType{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Update_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginUpdate_dataTypesUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataTypeUpdate{ - Properties: &armnetworkanalytics.DataTypeUpdateProperties{ - DatabaseCacheRetention: to.Ptr[int32](16), - DatabaseRetention: to.Ptr[int32](9), - State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - StorageOutputRetention: to.Ptr[int32](30), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataType = armnetworkanalytics.DataType{ - // Name: to.Ptr("datatypename"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](16), - // DatabaseRetention: to.Ptr[int32](9), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("State Reason"), - // StorageOutputRetention: to.Ptr[int32](30), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Update_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginUpdate_dataTypesUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataTypeUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataType = armnetworkanalytics.DataType{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Delete_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginDelete_dataTypesDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Delete_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginDelete_dataTypesDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_DeleteData_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginDeleteData_dataTypesDeleteDataMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDeleteData(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", map[string]any{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_DeleteData_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginDeleteData_dataTypesDeleteDataMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDeleteData(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", map[string]any{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen.json -func ExampleDataTypesClient_GenerateStorageContainerSasToken_dataTypesGenerateStorageContainerSasTokenMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().GenerateStorageContainerSasToken(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.ContainerSaS{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.039Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.039Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ContainerSasToken = armnetworkanalytics.ContainerSasToken{ - // StorageContainerSasToken: to.Ptr("storageContainerSasToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_GenerateStorageContainerSasToken_MinimumSet_Gen.json -func ExampleDataTypesClient_GenerateStorageContainerSasToken_dataTypesGenerateStorageContainerSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().GenerateStorageContainerSasToken(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.ContainerSaS{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:16.887Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:16.887Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ContainerSasToken = armnetworkanalytics.ContainerSasToken{ - // StorageContainerSasToken: to.Ptr("storageContainerSasToken"), - // } -} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/fake/time_rfc3339.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/fake/time_rfc3339.go +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod index 28e0873dbe18..8ca851d04c63 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/ar go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models.go index 48a4869d8ec2..b3783801d6ad 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models.go +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models.go @@ -198,7 +198,7 @@ type DataProductUpdate struct { // The managed service identities assigned to this resource. Identity *ManagedServiceIdentity - // The updatable properties of the DataProduct. + // The resource-specific properties for this resource. Properties *DataProductUpdateProperties // Resource tags. @@ -318,7 +318,7 @@ type DataTypeProperties struct { // DataTypeUpdate - The type used for update operations of the DataType. type DataTypeUpdate struct { - // The updatable properties of the DataType. + // The resource-specific properties for this resource. Properties *DataTypeUpdateProperties } diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models_serde.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models_serde.go index c9f2b7da320b..a2ec95104eec 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models_serde.go +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/models_serde.go @@ -1410,7 +1410,7 @@ func populate(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go deleted file mode 100644 index 7d3a45828080..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armnetworkanalytics.OperationListResult{ - // Value: []*armnetworkanalytics.Operation{ - // { - // Name: to.Ptr("Microsoft.NetworkAnalytics/resourceName/operationName"), - // ActionType: to.Ptr(armnetworkanalytics.ActionTypeInternal), - // Display: &armnetworkanalytics.OperationDisplay{ - // Description: to.Ptr("Description of the operation"), - // Operation: to.Ptr("OperationName"), - // Provider: to.Ptr("Microsoft.NetworkAnalytics"), - // Resource: to.Ptr("ResourceName"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr(armnetworkanalytics.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/21a8d55d74e4425e96d76e5835f52cfc9eb95a22/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armnetworkanalytics.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/response_types.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/responses.go similarity index 100% rename from sdk/resourcemanager/networkanalytics/armnetworkanalytics/response_types.go rename to sdk/resourcemanager/networkanalytics/armnetworkanalytics/responses.go diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/time_rfc3339.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/time_rfc3339.go index 1a4afc9adfe0..044b7085d9af 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/time_rfc3339.go +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md b/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md index 075358ad45d9..34a7eeed3267 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +## 1.1.0 (2024-08-27) +### Features Added + +- New enum type `AddSubscriptionOperationState` with values `AddSubscriptionOperationStateFailed`, `AddSubscriptionOperationStateSucceeded`, `AddSubscriptionOperationStateUpdating` +- New function `*OracleSubscriptionsClient.BeginAddAzureSubscriptions(context.Context, AzureSubscriptions, *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*runtime.Poller[OracleSubscriptionsClientAddAzureSubscriptionsResponse], error)` +- New struct `AzureSubscriptions` +- New field `AddSubscriptionOperationState`, `AzureSubscriptionIDs`, `LastOperationStatusDetail` in struct `OracleSubscriptionProperties` + + ## 1.0.0 (2024-06-28) ### Other Changes diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go index d58cf43d6ebc..722005b99e0e 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go @@ -46,7 +46,7 @@ func NewAutonomousDatabaseBackupsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Create a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -74,7 +74,7 @@ func (client *AutonomousDatabaseBackupsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Create a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabaseBackupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, resource AutonomousDatabaseBackup, options *AutonomousDatabaseBackupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabaseBackupsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *AutonomousDatabaseBackupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -132,7 +132,7 @@ func (client *AutonomousDatabaseBackupsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Delete a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -159,7 +159,7 @@ func (client *AutonomousDatabaseBackupsClient) BeginDelete(ctx context.Context, // Delete - Delete a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabaseBackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, options *AutonomousDatabaseBackupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabaseBackupsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *AutonomousDatabaseBackupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *AutonomousDatabaseBackupsClient) deleteCreateRequest(ctx context.C // Get - Get a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -266,7 +266,7 @@ func (client *AutonomousDatabaseBackupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *AutonomousDatabaseBackupsClient) getHandleResponse(resp *http.Resp // NewListByAutonomousDatabasePager - List AutonomousDatabaseBackup resources by AutonomousDatabase // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - options - AutonomousDatabaseBackupsClientListByAutonomousDatabaseOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager @@ -331,7 +331,7 @@ func (client *AutonomousDatabaseBackupsClient) listByAutonomousDatabaseCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,7 @@ func (client *AutonomousDatabaseBackupsClient) listByAutonomousDatabaseHandleRes // BeginUpdate - Update a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -377,7 +377,7 @@ func (client *AutonomousDatabaseBackupsClient) BeginUpdate(ctx context.Context, // Update - Update a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabaseBackupsClient) update(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, properties AutonomousDatabaseBackupUpdate, options *AutonomousDatabaseBackupsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabaseBackupsClient.BeginUpdate" @@ -423,7 +423,7 @@ func (client *AutonomousDatabaseBackupsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client_example_test.go deleted file mode 100644 index 75398af87322..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client_example_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_listByParent.json -func ExampleAutonomousDatabaseBackupsClient_NewListByAutonomousDatabasePager_autonomousDatabaseBackupsListByAutonomousDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseBackupsClient().NewListByAutonomousDatabasePager("rg000", "databasedb1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseBackupListResult = armoracledatabase.AutonomousDatabaseBackupListResult{ - // Value: []*armoracledatabase.AutonomousDatabaseBackup{ - // { - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup completed successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](365), - // SizeInTbs: to.Ptr[float64](2), - // TimeAvailableTil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T20:44:09.466Z"); return t}()), - // TimeEnded: to.Ptr("2024-01-09T20:44:09.466Z"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json -func ExampleAutonomousDatabaseBackupsClient_Get_autonomousDatabaseBackupsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseBackupsClient().Get(ctx, "rg000", "databasedb1", "1711644130", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseBackup = armoracledatabase.AutonomousDatabaseBackup{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup completed successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](365), - // SizeInTbs: to.Ptr[float64](2), - // TimeAvailableTil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T20:44:09.466Z"); return t}()), - // TimeEnded: to.Ptr("2024-01-09T20:44:09.466Z"), - // TimeStarted: to.Ptr("2024-01-09T19:44:09.466Z"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_create.json -func ExampleAutonomousDatabaseBackupsClient_BeginCreateOrUpdate_autonomousDatabaseBackupsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabaseBackupsClient().BeginCreateOrUpdate(ctx, "rg000", "databasedb1", "1711644130", armoracledatabase.AutonomousDatabaseBackup{ - Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - DisplayName: to.Ptr("Nightly Backup"), - RetentionPeriodInDays: to.Ptr[int32](365), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseBackup = armoracledatabase.AutonomousDatabaseBackup{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup completed successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](365), - // SizeInTbs: to.Ptr[float64](2), - // TimeAvailableTil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T20:44:09.466Z"); return t}()), - // TimeEnded: to.Ptr("2024-01-09T20:44:09.466Z"), - // TimeStarted: to.Ptr("2024-01-09T19:44:09.466Z"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_patch.json -func ExampleAutonomousDatabaseBackupsClient_BeginUpdate_autonomousDatabaseBackupsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabaseBackupsClient().BeginUpdate(ctx, "rg000", "databasedb1", "1711644130", armoracledatabase.AutonomousDatabaseBackupUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseBackup = armoracledatabase.AutonomousDatabaseBackup{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup updated successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](400), - // SizeInTbs: to.Ptr[float64](2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_delete.json -func ExampleAutonomousDatabaseBackupsClient_BeginDelete_autonomousDatabaseBackupsDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabaseBackupsClient().BeginDelete(ctx, "rg000", "databasedb1", "1711644130", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go index 702e11648ed2..42c7871b2ce4 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go @@ -46,7 +46,7 @@ func NewAutonomousDatabaseCharacterSetsClient(subscriptionID string, credential // Get - Get a AutonomousDatabaseCharacterSet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - adbscharsetname - AutonomousDatabaseCharacterSet name // - options - AutonomousDatabaseCharacterSetsClientGetOptions contains the optional parameters for the AutonomousDatabaseCharacterSetsClient.Get @@ -93,7 +93,7 @@ func (client *AutonomousDatabaseCharacterSetsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *AutonomousDatabaseCharacterSetsClient) getHandleResponse(resp *htt // NewListByLocationPager - List AutonomousDatabaseCharacterSet resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - AutonomousDatabaseCharacterSetsClientListByLocationOptions contains the optional parameters for the AutonomousDatabaseCharacterSetsClient.NewListByLocationPager // method. @@ -153,7 +153,7 @@ func (client *AutonomousDatabaseCharacterSetsClient) listByLocationCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client_example_test.go deleted file mode 100644 index 585ac7c2378b..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client_example_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_listByLocation.json -func ExampleAutonomousDatabaseCharacterSetsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseCharacterSetsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseCharacterSetListResult = armoracledatabase.AutonomousDatabaseCharacterSetListResult{ - // Value: []*armoracledatabase.AutonomousDatabaseCharacterSet{ - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseCharacterSets/DATABASE"), - // Properties: &armoracledatabase.AutonomousDatabaseCharacterSetProperties{ - // CharacterSet: to.Ptr("AL32UTF8"), - // }, - // }, - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseCharacterSets/DATABASE"), - // Properties: &armoracledatabase.AutonomousDatabaseCharacterSetProperties{ - // CharacterSet: to.Ptr("UTF8"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json -func ExampleAutonomousDatabaseCharacterSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseCharacterSetsClient().Get(ctx, "eastus", "DATABASE", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseCharacterSet = armoracledatabase.AutonomousDatabaseCharacterSet{ - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseCharacterSets/DATABASE"), - // Properties: &armoracledatabase.AutonomousDatabaseCharacterSetProperties{ - // CharacterSet: to.Ptr("AL32UTF8"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go index 9b5a8455510d..b57590e8292a 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go @@ -46,7 +46,7 @@ func NewAutonomousDatabaseNationalCharacterSetsClient(subscriptionID string, cre // Get - Get a AutonomousDatabaseNationalCharacterSet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - adbsncharsetname - AutonomousDatabaseNationalCharacterSets name // - options - AutonomousDatabaseNationalCharacterSetsClientGetOptions contains the optional parameters for the AutonomousDatabaseNationalCharacterSetsClient.Get @@ -93,7 +93,7 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) getHandleResponse(r // NewListByLocationPager - List AutonomousDatabaseNationalCharacterSet resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - AutonomousDatabaseNationalCharacterSetsClientListByLocationOptions contains the optional parameters for the AutonomousDatabaseNationalCharacterSetsClient.NewListByLocationPager // method. @@ -153,7 +153,7 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) listByLocationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client_example_test.go deleted file mode 100644 index 19a978249b59..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_listByLocation.json -func ExampleAutonomousDatabaseNationalCharacterSetsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseNationalCharacterSetsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseNationalCharacterSetListResult = armoracledatabase.AutonomousDatabaseNationalCharacterSetListResult{ - // Value: []*armoracledatabase.AutonomousDatabaseNationalCharacterSet{ - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseNationalCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseNationalCharacterSets/NATIONAL"), - // Properties: &armoracledatabase.AutonomousDatabaseNationalCharacterSetProperties{ - // CharacterSet: to.Ptr("AL16UTF16"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json -func ExampleAutonomousDatabaseNationalCharacterSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseNationalCharacterSetsClient().Get(ctx, "eastus", "NATIONAL", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseNationalCharacterSet = armoracledatabase.AutonomousDatabaseNationalCharacterSet{ - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseNationalCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseNationalCharacterSets/NATIONAL"), - // Properties: &armoracledatabase.AutonomousDatabaseNationalCharacterSetProperties{ - // CharacterSet: to.Ptr("AL16UTF16"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go index 63903cb2797c..4bde04183f3e 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go @@ -46,7 +46,7 @@ func NewAutonomousDatabasesClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Create a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *AutonomousDatabasesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, autonomousdatabasename string, resource AutonomousDatabase, options *AutonomousDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *AutonomousDatabasesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *AutonomousDatabasesClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - options - AutonomousDatabasesClientBeginDeleteOptions contains the optional parameters for the AutonomousDatabasesClient.BeginDelete @@ -153,7 +153,7 @@ func (client *AutonomousDatabasesClient) BeginDelete(ctx context.Context, resour // Delete - Delete a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *AutonomousDatabasesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,7 @@ func (client *AutonomousDatabasesClient) deleteCreateRequest(ctx context.Context // BeginFailover - Perform failover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -231,7 +231,7 @@ func (client *AutonomousDatabasesClient) BeginFailover(ctx context.Context, reso // Failover - Perform failover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabasesClient) failover(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, options *AutonomousDatabasesClientBeginFailoverOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginFailover" @@ -273,7 +273,7 @@ func (client *AutonomousDatabasesClient) failoverCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -285,7 +285,7 @@ func (client *AutonomousDatabasesClient) failoverCreateRequest(ctx context.Conte // GenerateWallet - Generate wallet action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -333,7 +333,7 @@ func (client *AutonomousDatabasesClient) generateWalletCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -354,7 +354,7 @@ func (client *AutonomousDatabasesClient) generateWalletHandleResponse(resp *http // Get - Get a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - options - AutonomousDatabasesClientGetOptions contains the optional parameters for the AutonomousDatabasesClient.Get method. @@ -400,7 +400,7 @@ func (client *AutonomousDatabasesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -417,7 +417,7 @@ func (client *AutonomousDatabasesClient) getHandleResponse(resp *http.Response) // NewListByResourceGroupPager - List AutonomousDatabase resources by resource group // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AutonomousDatabasesClientListByResourceGroupOptions contains the optional parameters for the AutonomousDatabasesClient.NewListByResourceGroupPager // method. @@ -460,7 +460,7 @@ func (client *AutonomousDatabasesClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -477,7 +477,7 @@ func (client *AutonomousDatabasesClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - List AutonomousDatabase resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - AutonomousDatabasesClientListBySubscriptionOptions contains the optional parameters for the AutonomousDatabasesClient.NewListBySubscriptionPager // method. func (client *AutonomousDatabasesClient) NewListBySubscriptionPager(options *AutonomousDatabasesClientListBySubscriptionOptions) *runtime.Pager[AutonomousDatabasesClientListBySubscriptionResponse] { @@ -515,7 +515,7 @@ func (client *AutonomousDatabasesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -533,7 +533,7 @@ func (client *AutonomousDatabasesClient) listBySubscriptionHandleResponse(resp * // BeginRestore - Restores an Autonomous Database based on the provided request parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -560,7 +560,7 @@ func (client *AutonomousDatabasesClient) BeginRestore(ctx context.Context, resou // Restore - Restores an Autonomous Database based on the provided request parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabasesClient) restore(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body RestoreAutonomousDatabaseDetails, options *AutonomousDatabasesClientBeginRestoreOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginRestore" @@ -602,7 +602,7 @@ func (client *AutonomousDatabasesClient) restoreCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -614,7 +614,7 @@ func (client *AutonomousDatabasesClient) restoreCreateRequest(ctx context.Contex // BeginShrink - This operation shrinks the current allocated storage down to the current actual used data storage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - options - AutonomousDatabasesClientBeginShrinkOptions contains the optional parameters for the AutonomousDatabasesClient.BeginShrink @@ -640,7 +640,7 @@ func (client *AutonomousDatabasesClient) BeginShrink(ctx context.Context, resour // Shrink - This operation shrinks the current allocated storage down to the current actual used data storage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabasesClient) shrink(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabasesClientBeginShrinkOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginShrink" @@ -682,7 +682,7 @@ func (client *AutonomousDatabasesClient) shrinkCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -691,7 +691,7 @@ func (client *AutonomousDatabasesClient) shrinkCreateRequest(ctx context.Context // BeginSwitchover - Perform switchover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -718,7 +718,7 @@ func (client *AutonomousDatabasesClient) BeginSwitchover(ctx context.Context, re // Switchover - Perform switchover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabasesClient) switchover(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, options *AutonomousDatabasesClientBeginSwitchoverOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginSwitchover" @@ -760,7 +760,7 @@ func (client *AutonomousDatabasesClient) switchoverCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -772,7 +772,7 @@ func (client *AutonomousDatabasesClient) switchoverCreateRequest(ctx context.Con // BeginUpdate - Update a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - properties - The resource properties to be updated. @@ -799,7 +799,7 @@ func (client *AutonomousDatabasesClient) BeginUpdate(ctx context.Context, resour // Update - Update a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *AutonomousDatabasesClient) update(ctx context.Context, resourceGroupName string, autonomousdatabasename string, properties AutonomousDatabaseUpdate, options *AutonomousDatabasesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginUpdate" @@ -841,7 +841,7 @@ func (client *AutonomousDatabasesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client_example_test.go deleted file mode 100644 index 46bb0e233563..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client_example_test.go +++ /dev/null @@ -1,783 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listBySubscription.json -func ExampleAutonomousDatabasesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabasesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseListResult = armoracledatabase.AutonomousDatabaseListResult{ - // Value: []*armoracledatabase.AutonomousDatabase{ - // { - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listByResourceGroup.json -func ExampleAutonomousDatabasesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabasesClient().NewListByResourceGroupPager("rg000", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseListResult = armoracledatabase.AutonomousDatabaseListResult{ - // Value: []*armoracledatabase.AutonomousDatabase{ - // { - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json -func ExampleAutonomousDatabasesClient_Get_autonomousDatabasesGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabasesClient().Get(ctx, "rg000", "databasedb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_create.json -func ExampleAutonomousDatabasesClient_BeginCreateOrUpdate_autonomousDatabasesCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginCreateOrUpdate(ctx, "rg000", "databasedb1", armoracledatabase.AutonomousDatabase{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.AutonomousDatabaseProperties{ - AdminPassword: to.Ptr("********"), - CharacterSet: to.Ptr("AL32UTF8"), - ComputeCount: to.Ptr[float32](2), - ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - DataStorageSizeInTbs: to.Ptr[int32](1), - DbVersion: to.Ptr("18.4.0.0"), - DisplayName: to.Ptr("example_autonomous_databasedb1"), - NcharacterSet: to.Ptr("AL16UTF16"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseClone_create.json -func ExampleAutonomousDatabasesClient_BeginCreateOrUpdate_autonomousDatabasesCreateOrUpdateClone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginCreateOrUpdate(ctx, "rg000", "databasedb1", armoracledatabase.AutonomousDatabase{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.AutonomousDatabaseCloneProperties{ - AdminPassword: to.Ptr("********"), - CharacterSet: to.Ptr("AL32UTF8"), - ComputeCount: to.Ptr[float32](2), - ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeClone), - DataStorageSizeInTbs: to.Ptr[int32](1), - DisplayName: to.Ptr("example_autonomous_databasedb1_clone"), - NcharacterSet: to.Ptr("AL16UTF16"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - CloneType: to.Ptr(armoracledatabase.CloneTypeFull), - SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseCloneProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1Clone"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeClone), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // CloneType: to.Ptr(armoracledatabase.CloneTypeFull), - // SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_patch.json -func ExampleAutonomousDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginUpdate(ctx, "rg000", "databasedb1", armoracledatabase.AutonomousDatabaseUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_delete.json -func ExampleAutonomousDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginDelete(ctx, "rg000", "databasedb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_failover.json -func ExampleAutonomousDatabasesClient_BeginFailover_autonomousDatabasesFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginFailover(ctx, "rg000", "databasedb1", armoracledatabase.PeerDbDetails{ - PeerDbID: to.Ptr("peerDbId"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(true), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateUpdating), - // LocalAdgAutoFailoverMaxDataLossLimit: to.Ptr[int32](300), - // LocalDisasterRecoveryType: to.Ptr(armoracledatabase.DisasterRecoveryTypeAdg), - // LocalStandbyDb: &armoracledatabase.AutonomousDatabaseStandbySummary{ - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateRoleChangeInProgress), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Role: to.Ptr(armoracledatabase.RoleTypePrimary), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // TimeLocalDataGuardEnabled: to.Ptr("2024-02-28T19:03:43.714Z"), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_generateWallet.json -func ExampleAutonomousDatabasesClient_GenerateWallet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabasesClient().GenerateWallet(ctx, "rg000", "databasedb1", armoracledatabase.GenerateAutonomousDatabaseWalletDetails{ - GenerateType: to.Ptr(armoracledatabase.GenerateTypeSingle), - IsRegional: to.Ptr(false), - Password: to.Ptr("********"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseWalletFile = armoracledatabase.AutonomousDatabaseWalletFile{ - // WalletFiles: to.Ptr("testEncodedFiles"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_restore.json -func ExampleAutonomousDatabasesClient_BeginRestore_autonomousDatabasesRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginRestore(ctx, "rg000", "databasedb1", armoracledatabase.RestoreAutonomousDatabaseDetails{ - Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-23T00:00:00.000Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // BackupRetentionPeriodInDays: to.Ptr[int32](60), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr(""), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateRestoreInProgress), - // LongTermBackupSchedule: &armoracledatabase.LongTermBackUpScheduleDetails{ - // RepeatCadence: to.Ptr(armoracledatabase.RepeatCadenceTypeWeekly), - // RetentionPeriodInDays: to.Ptr[int32](365), - // TimeOfBackup: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-21T21:03:41.309Z"); return t}()), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // NextLongTermBackupTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-24T21:03:41.000Z"); return t}()), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_shrink.json -func ExampleAutonomousDatabasesClient_BeginShrink() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginShrink(ctx, "rg000", "databasedb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // BackupRetentionPeriodInDays: to.Ptr[int32](90), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr(""), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateScaleInProgress), - // LongTermBackupSchedule: &armoracledatabase.LongTermBackUpScheduleDetails{ - // RepeatCadence: to.Ptr(armoracledatabase.RepeatCadenceTypeWeekly), - // RetentionPeriodInDays: to.Ptr[int32](365), - // TimeOfBackup: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-21T21:03:41.309Z"); return t}()), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // NextLongTermBackupTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-24T21:03:41.000Z"); return t}()), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_switchover.json -func ExampleAutonomousDatabasesClient_BeginSwitchover_autonomousDatabasesSwitchover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginSwitchover(ctx, "rg000", "databasedb1", armoracledatabase.PeerDbDetails{ - PeerDbID: to.Ptr("peerDbId"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateUpdating), - // LocalDisasterRecoveryType: to.Ptr(armoracledatabase.DisasterRecoveryTypeBackupBased), - // LocalStandbyDb: &armoracledatabase.AutonomousDatabaseStandbySummary{ - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateRoleChangeInProgress), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Role: to.Ptr(armoracledatabase.RoleTypePrimary), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // TimeOfLastSwitchover: to.Ptr("2024-02-27T18:37:08.069Z"), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go index f0a5ec4d4ac7..6add6c424b99 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go @@ -46,7 +46,7 @@ func NewAutonomousDatabaseVersionsClient(subscriptionID string, credential azcor // Get - Get a AutonomousDbVersion // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - autonomousdbversionsname - AutonomousDbVersion name // - options - AutonomousDatabaseVersionsClientGetOptions contains the optional parameters for the AutonomousDatabaseVersionsClient.Get @@ -93,7 +93,7 @@ func (client *AutonomousDatabaseVersionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *AutonomousDatabaseVersionsClient) getHandleResponse(resp *http.Res // NewListByLocationPager - List AutonomousDbVersion resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - AutonomousDatabaseVersionsClientListByLocationOptions contains the optional parameters for the AutonomousDatabaseVersionsClient.NewListByLocationPager // method. @@ -153,7 +153,7 @@ func (client *AutonomousDatabaseVersionsClient) listByLocationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client_example_test.go deleted file mode 100644 index b1fecf02bc8f..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_listByLocation.json -func ExampleAutonomousDatabaseVersionsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseVersionsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDbVersionListResult = armoracledatabase.AutonomousDbVersionListResult{ - // Value: []*armoracledatabase.AutonomousDbVersion{ - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDbVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDbVersions/18.4.0.0"), - // Properties: &armoracledatabase.AutonomousDbVersionProperties{ - // Version: to.Ptr("18.4.0.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json -func ExampleAutonomousDatabaseVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseVersionsClient().Get(ctx, "eastus", "18.4.0.0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDbVersion = armoracledatabase.AutonomousDbVersion{ - // Type: to.Ptr("Oracle.Database/locations/autonomousDbVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDbVersions/18.4.0.0"), - // Properties: &armoracledatabase.AutonomousDbVersionProperties{ - // Version: to.Ptr("18.4.0.0"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md b/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md index ed61e73ab132..ef495c1d628f 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/oracle/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/oracle/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-09-01 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go index 0360d1e588a8..dd88c0bbe15b 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go @@ -46,7 +46,7 @@ func NewCloudExadataInfrastructuresClient(subscriptionID string, credential azco // BeginAddStorageCapacity - Perform add storage capacity on exadata infra // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - options - CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginAddStorageCapacity @@ -72,7 +72,7 @@ func (client *CloudExadataInfrastructuresClient) BeginAddStorageCapacity(ctx con // AddStorageCapacity - Perform add storage capacity on exadata infra // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudExadataInfrastructuresClient) addStorageCapacity(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginAddStorageCapacity" @@ -114,7 +114,7 @@ func (client *CloudExadataInfrastructuresClient) addStorageCapacityCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *CloudExadataInfrastructuresClient) addStorageCapacityCreateRequest // BeginCreateOrUpdate - Create a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - resource - Resource create parameters. @@ -150,7 +150,7 @@ func (client *CloudExadataInfrastructuresClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Create a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudExadataInfrastructuresClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, resource CloudExadataInfrastructure, options *CloudExadataInfrastructuresClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginCreateOrUpdate" @@ -192,7 +192,7 @@ func (client *CloudExadataInfrastructuresClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -204,7 +204,7 @@ func (client *CloudExadataInfrastructuresClient) createOrUpdateCreateRequest(ctx // BeginDelete - Delete a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - options - CloudExadataInfrastructuresClientBeginDeleteOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginDelete @@ -230,7 +230,7 @@ func (client *CloudExadataInfrastructuresClient) BeginDelete(ctx context.Context // Delete - Delete a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudExadataInfrastructuresClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *CloudExadataInfrastructuresClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginDelete" @@ -272,7 +272,7 @@ func (client *CloudExadataInfrastructuresClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *CloudExadataInfrastructuresClient) deleteCreateRequest(ctx context // Get - Get a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - options - CloudExadataInfrastructuresClientGetOptions contains the optional parameters for the CloudExadataInfrastructuresClient.Get @@ -328,7 +328,7 @@ func (client *CloudExadataInfrastructuresClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *CloudExadataInfrastructuresClient) getHandleResponse(resp *http.Re // NewListByResourceGroupPager - List CloudExadataInfrastructure resources by resource group // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudExadataInfrastructuresClientListByResourceGroupOptions contains the optional parameters for the CloudExadataInfrastructuresClient.NewListByResourceGroupPager // method. @@ -388,7 +388,7 @@ func (client *CloudExadataInfrastructuresClient) listByResourceGroupCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,7 +405,7 @@ func (client *CloudExadataInfrastructuresClient) listByResourceGroupHandleRespon // NewListBySubscriptionPager - List CloudExadataInfrastructure resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - CloudExadataInfrastructuresClientListBySubscriptionOptions contains the optional parameters for the CloudExadataInfrastructuresClient.NewListBySubscriptionPager // method. func (client *CloudExadataInfrastructuresClient) NewListBySubscriptionPager(options *CloudExadataInfrastructuresClientListBySubscriptionOptions) *runtime.Pager[CloudExadataInfrastructuresClientListBySubscriptionResponse] { @@ -443,7 +443,7 @@ func (client *CloudExadataInfrastructuresClient) listBySubscriptionCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -461,7 +461,7 @@ func (client *CloudExadataInfrastructuresClient) listBySubscriptionHandleRespons // BeginUpdate - Update a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - properties - The resource properties to be updated. @@ -488,7 +488,7 @@ func (client *CloudExadataInfrastructuresClient) BeginUpdate(ctx context.Context // Update - Update a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudExadataInfrastructuresClient) update(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, properties CloudExadataInfrastructureUpdate, options *CloudExadataInfrastructuresClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginUpdate" @@ -530,7 +530,7 @@ func (client *CloudExadataInfrastructuresClient) updateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client_example_test.go deleted file mode 100644 index 1e2370003e56..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client_example_test.go +++ /dev/null @@ -1,615 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listBySubscription.json -func ExampleCloudExadataInfrastructuresClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudExadataInfrastructuresClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudExadataInfrastructureListResult = armoracledatabase.CloudExadataInfrastructureListResult{ - // Value: []*armoracledatabase.CloudExadataInfrastructure{ - // { - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listByResourceGroup.json -func ExampleCloudExadataInfrastructuresClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudExadataInfrastructuresClient().NewListByResourceGroupPager("rg000", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudExadataInfrastructureListResult = armoracledatabase.CloudExadataInfrastructureListResult{ - // Value: []*armoracledatabase.CloudExadataInfrastructure{ - // { - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json -func ExampleCloudExadataInfrastructuresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudExadataInfrastructuresClient().Get(ctx, "rg000", "infra1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_create.json -func ExampleCloudExadataInfrastructuresClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginCreateOrUpdate(ctx, "rg000", "infra1", armoracledatabase.CloudExadataInfrastructure{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - ComputeCount: to.Ptr[int32](100), - DisplayName: to.Ptr("infra 1"), - Shape: to.Ptr("EXADATA.X9M"), - StorageCount: to.Ptr[int32](10), - }, - Zones: []*string{ - to.Ptr("1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_patch.json -func ExampleCloudExadataInfrastructuresClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginUpdate(ctx, "rg000", "infra1", armoracledatabase.CloudExadataInfrastructureUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_delete.json -func ExampleCloudExadataInfrastructuresClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginDelete(ctx, "rg000", "infra1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_addStorageCapacity.json -func ExampleCloudExadataInfrastructuresClient_BeginAddStorageCapacity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginAddStorageCapacity(ctx, "rg000", "infra1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go index cfa066618eca..326731d873f8 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go @@ -46,7 +46,7 @@ func NewCloudVMClustersClient(subscriptionID string, credential azcore.TokenCred // BeginAddVMs - Add VMs to the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - body - The content of the action request @@ -73,7 +73,7 @@ func (client *CloudVMClustersClient) BeginAddVMs(ctx context.Context, resourceGr // AddVMs - Add VMs to the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudVMClustersClient) addVMs(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, options *CloudVMClustersClientBeginAddVMsOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginAddVMs" @@ -115,7 +115,7 @@ func (client *CloudVMClustersClient) addVMsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -127,7 +127,7 @@ func (client *CloudVMClustersClient) addVMsCreateRequest(ctx context.Context, re // BeginCreateOrUpdate - Create a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - resource - Resource create parameters. @@ -154,7 +154,7 @@ func (client *CloudVMClustersClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudVMClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudvmclustername string, resource CloudVMCluster, options *CloudVMClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginCreateOrUpdate" @@ -196,7 +196,7 @@ func (client *CloudVMClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -208,7 +208,7 @@ func (client *CloudVMClustersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - options - CloudVMClustersClientBeginDeleteOptions contains the optional parameters for the CloudVMClustersClient.BeginDelete @@ -234,7 +234,7 @@ func (client *CloudVMClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudVMClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudvmclustername string, options *CloudVMClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginDelete" @@ -276,7 +276,7 @@ func (client *CloudVMClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *CloudVMClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Get a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - options - CloudVMClustersClientGetOptions contains the optional parameters for the CloudVMClustersClient.Get method. @@ -331,7 +331,7 @@ func (client *CloudVMClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +348,7 @@ func (client *CloudVMClustersClient) getHandleResponse(resp *http.Response) (Clo // NewListByResourceGroupPager - List CloudVmCluster resources by resource group // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudVMClustersClientListByResourceGroupOptions contains the optional parameters for the CloudVMClustersClient.NewListByResourceGroupPager // method. @@ -391,7 +391,7 @@ func (client *CloudVMClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -408,7 +408,7 @@ func (client *CloudVMClustersClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - List CloudVmCluster resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - CloudVMClustersClientListBySubscriptionOptions contains the optional parameters for the CloudVMClustersClient.NewListBySubscriptionPager // method. func (client *CloudVMClustersClient) NewListBySubscriptionPager(options *CloudVMClustersClientListBySubscriptionOptions) *runtime.Pager[CloudVMClustersClientListBySubscriptionResponse] { @@ -446,7 +446,7 @@ func (client *CloudVMClustersClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +464,7 @@ func (client *CloudVMClustersClient) listBySubscriptionHandleResponse(resp *http // ListPrivateIPAddresses - List Private IP Addresses by the provided filter // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - body - The content of the action request @@ -512,7 +512,7 @@ func (client *CloudVMClustersClient) listPrivateIPAddressesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -533,7 +533,7 @@ func (client *CloudVMClustersClient) listPrivateIPAddressesHandleResponse(resp * // BeginRemoveVMs - Remove VMs from the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - body - The content of the action request @@ -560,7 +560,7 @@ func (client *CloudVMClustersClient) BeginRemoveVMs(ctx context.Context, resourc // RemoveVMs - Remove VMs from the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudVMClustersClient) removeVMs(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, options *CloudVMClustersClientBeginRemoveVMsOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginRemoveVMs" @@ -602,7 +602,7 @@ func (client *CloudVMClustersClient) removeVMsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -614,7 +614,7 @@ func (client *CloudVMClustersClient) removeVMsCreateRequest(ctx context.Context, // BeginUpdate - Update a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - properties - The resource properties to be updated. @@ -641,7 +641,7 @@ func (client *CloudVMClustersClient) BeginUpdate(ctx context.Context, resourceGr // Update - Update a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *CloudVMClustersClient) update(ctx context.Context, resourceGroupName string, cloudvmclustername string, properties CloudVMClusterUpdate, options *CloudVMClustersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginUpdate" @@ -683,7 +683,7 @@ func (client *CloudVMClustersClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client_example_test.go deleted file mode 100644 index 14feee604fc9..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client_example_test.go +++ /dev/null @@ -1,813 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listBySubscription.json -func ExampleCloudVMClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudVMClustersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudVMClusterListResult = armoracledatabase.CloudVMClusterListResult{ - // Value: []*armoracledatabase.CloudVMCluster{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listByResourceGroup.json -func ExampleCloudVMClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudVMClustersClient().NewListByResourceGroupPager("rg000", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudVMClusterListResult = armoracledatabase.CloudVMClusterListResult{ - // Value: []*armoracledatabase.CloudVMCluster{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json -func ExampleCloudVMClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudVMClustersClient().Get(ctx, "rg000", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // NsgCidrs: []*armoracledatabase.NsgCidr{ - // { - // DestinationPortRange: &armoracledatabase.PortRange{ - // Max: to.Ptr[int32](1522), - // Min: to.Ptr[int32](1520), - // }, - // Source: to.Ptr("10.0.0.0/16"), - // }, - // { - // Source: to.Ptr("10.10.0.0/24"), - // }}, - // NsgURL: to.Ptr("https://fake"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_create.json -func ExampleCloudVMClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginCreateOrUpdate(ctx, "rg000", "cluster1", armoracledatabase.CloudVMCluster{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.CloudVMClusterProperties{ - BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - ClusterName: to.Ptr("cluster1"), - CPUCoreCount: to.Ptr[int32](2), - DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - IsDiagnosticsEventsEnabled: to.Ptr(false), - IsHealthMonitoringEnabled: to.Ptr(false), - IsIncidentLogsEnabled: to.Ptr(false), - }, - DataStoragePercentage: to.Ptr[int32](100), - DataStorageSizeInTbs: to.Ptr[float64](1000), - DbNodeStorageSizeInGbs: to.Ptr[int32](1000), - DbServers: []*string{ - to.Ptr("ocid1..aaaa")}, - DisplayName: to.Ptr("cluster 1"), - Domain: to.Ptr("domain1"), - GiVersion: to.Ptr("19.0.0.0"), - Hostname: to.Ptr("hostname1"), - IsLocalBackupEnabled: to.Ptr(false), - IsSparseDiskgroupEnabled: to.Ptr(false), - LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - MemorySizeInGbs: to.Ptr[int32](1000), - NsgCidrs: []*armoracledatabase.NsgCidr{ - { - DestinationPortRange: &armoracledatabase.PortRange{ - Max: to.Ptr[int32](1522), - Min: to.Ptr[int32](1520), - }, - Source: to.Ptr("10.0.0.0/16"), - }, - { - Source: to.Ptr("10.10.0.0/24"), - }}, - OcpuCount: to.Ptr[float32](3), - ScanListenerPortTCP: to.Ptr[int32](1050), - ScanListenerPortTCPSSL: to.Ptr[int32](1025), - SSHPublicKeys: []*string{ - to.Ptr("ssh-key 1")}, - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - TimeZone: to.Ptr("UTC"), - VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_patch.json -func ExampleCloudVMClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginUpdate(ctx, "rg000", "cluster1", armoracledatabase.CloudVMClusterUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_delete.json -func ExampleCloudVMClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginDelete(ctx, "rg000", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_addVms.json -func ExampleCloudVMClustersClient_BeginAddVMs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginAddVMs(ctx, "rg000", "cluster1", armoracledatabase.AddRemoveDbNode{ - DbServers: []*string{ - to.Ptr("ocid1..aaaa"), - to.Ptr("ocid1..aaaaaa")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listPrivateIpAddresses.json -func ExampleCloudVMClustersClient_ListPrivateIPAddresses() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudVMClustersClient().ListPrivateIPAddresses(ctx, "rg000", "cluster1", armoracledatabase.PrivateIPAddressesFilter{ - SubnetID: to.Ptr("ocid1..aaaaaa"), - VnicID: to.Ptr("ocid1..aaaaa"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateIPAddressPropertiesArray = []*armoracledatabase.PrivateIPAddressProperties{ - // { - // DisplayName: to.Ptr("ip1"), - // HostnameLabel: to.Ptr("hostname1"), - // IPAddress: to.Ptr("192.168.0.1"), - // Ocid: to.Ptr("ocid1..aaaa"), - // SubnetID: to.Ptr("ocid1..aaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_removeVms.json -func ExampleCloudVMClustersClient_BeginRemoveVMs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginRemoveVMs(ctx, "rg000", "cluster1", armoracledatabase.AddRemoveDbNode{ - DbServers: []*string{ - to.Ptr("ocid1..aaaa")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go index 8e9e5855b1b4..c9e9b15729a6 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go @@ -10,7 +10,7 @@ package armoracledatabase const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -27,6 +27,27 @@ func PossibleActionTypeValues() []ActionType { } } +// AddSubscriptionOperationState - Add Subscription Operation state enum +type AddSubscriptionOperationState string + +const ( + // AddSubscriptionOperationStateFailed - Failed - State when Add Subscription operation failed + AddSubscriptionOperationStateFailed AddSubscriptionOperationState = "Failed" + // AddSubscriptionOperationStateSucceeded - Succeeded - State when Add Subscription operation succeeded + AddSubscriptionOperationStateSucceeded AddSubscriptionOperationState = "Succeeded" + // AddSubscriptionOperationStateUpdating - Updating - State when Add Subscription operation is being Updated + AddSubscriptionOperationStateUpdating AddSubscriptionOperationState = "Updating" +) + +// PossibleAddSubscriptionOperationStateValues returns the possible values for the AddSubscriptionOperationState const type. +func PossibleAddSubscriptionOperationStateValues() []AddSubscriptionOperationState { + return []AddSubscriptionOperationState{ + AddSubscriptionOperationStateFailed, + AddSubscriptionOperationStateSucceeded, + AddSubscriptionOperationStateUpdating, + } +} + // AutonomousDatabaseBackupLifecycleState - Autonomous database backup lifecycle state enum type AutonomousDatabaseBackupLifecycleState string diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go index 02bca6f50b8b..301b4dbeed32 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go @@ -46,7 +46,7 @@ func NewDbNodesClient(subscriptionID string, credential azcore.TokenCredential, // BeginAction - VM actions on DbNode of VM Cluster by the provided filter // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - dbnodeocid - DbNode OCID. @@ -73,7 +73,7 @@ func (client *DbNodesClient) BeginAction(ctx context.Context, resourceGroupName // Action - VM actions on DbNode of VM Cluster by the provided filter // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *DbNodesClient) action(ctx context.Context, resourceGroupName string, cloudvmclustername string, dbnodeocid string, body DbNodeAction, options *DbNodesClientBeginActionOptions) (*http.Response, error) { var err error const operationName = "DbNodesClient.BeginAction" @@ -119,7 +119,7 @@ func (client *DbNodesClient) actionCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -131,7 +131,7 @@ func (client *DbNodesClient) actionCreateRequest(ctx context.Context, resourceGr // Get - Get a DbNode // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - dbnodeocid - DbNode OCID. @@ -182,7 +182,7 @@ func (client *DbNodesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +199,7 @@ func (client *DbNodesClient) getHandleResponse(resp *http.Response) (DbNodesClie // NewListByCloudVMClusterPager - List DbNode resources by CloudVmCluster // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - options - DbNodesClientListByCloudVMClusterOptions contains the optional parameters for the DbNodesClient.NewListByCloudVMClusterPager @@ -247,7 +247,7 @@ func (client *DbNodesClient) listByCloudVMClusterCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client_example_test.go deleted file mode 100644 index 13651e994932..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_listByParent.json -func ExampleDbNodesClient_NewListByCloudVMClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDbNodesClient().NewListByCloudVMClusterPager("rg000", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DbNodeListResult = armoracledatabase.DbNodeListResult{ - // Value: []*armoracledatabase.DbNode{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbNodes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/dbNodes/ocid1"), - // Properties: &armoracledatabase.DbNodeProperties{ - // BackupIPID: to.Ptr("id1"), - // BackupVnic2ID: to.Ptr("id1"), - // BackupVnicID: to.Ptr("id1"), - // CPUCoreCount: to.Ptr[int32](1000), - // DbNodeStorageSizeInGbs: to.Ptr[int32](500), - // DbServerID: to.Ptr("dbserver1"), - // DbSystemID: to.Ptr("db1"), - // FaultDomain: to.Ptr("domain1"), - // HostIPID: to.Ptr("10.0.0.0"), - // Hostname: to.Ptr("host1"), - // LifecycleState: to.Ptr(armoracledatabase.DbNodeProvisioningStateAvailable), - // MaintenanceType: to.Ptr(armoracledatabase.DbNodeMaintenanceTypeVmdbRebootMigration), - // MemorySizeInGbs: to.Ptr[int32](100), - // Ocid: to.Ptr("ocid.dbNodes.1"), - // SoftwareStorageSizeInGb: to.Ptr[int32](1000), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // Vnic2ID: to.Ptr("ocid.vnic.id2"), - // VnicID: to.Ptr("ocid.vnic.id1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json -func ExampleDbNodesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDbNodesClient().Get(ctx, "rg000", "cluster1", "ocid1....aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbNode = armoracledatabase.DbNode{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbNodes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/dbNodes/ocid1"), - // Properties: &armoracledatabase.DbNodeProperties{ - // BackupIPID: to.Ptr("id1"), - // BackupVnic2ID: to.Ptr("id1"), - // BackupVnicID: to.Ptr("id1"), - // CPUCoreCount: to.Ptr[int32](1000), - // DbNodeStorageSizeInGbs: to.Ptr[int32](500), - // DbServerID: to.Ptr("dbserver1"), - // DbSystemID: to.Ptr("db1"), - // FaultDomain: to.Ptr("domain1"), - // HostIPID: to.Ptr("10.0.0.0"), - // Hostname: to.Ptr("host1"), - // LifecycleState: to.Ptr(armoracledatabase.DbNodeProvisioningStateAvailable), - // MaintenanceType: to.Ptr(armoracledatabase.DbNodeMaintenanceTypeVmdbRebootMigration), - // MemorySizeInGbs: to.Ptr[int32](100), - // Ocid: to.Ptr("ocid.dbNodes.1"), - // SoftwareStorageSizeInGb: to.Ptr[int32](1000), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // Vnic2ID: to.Ptr("ocid.vnic.id2"), - // VnicID: to.Ptr("ocid.vnic.id1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_action.json -func ExampleDbNodesClient_BeginAction_dbNodesAction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDbNodesClient().BeginAction(ctx, "rg000", "cluster1", "ocid1....aaaaaa", armoracledatabase.DbNodeAction{ - Action: to.Ptr(armoracledatabase.DbNodeActionEnumStart), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbNode = armoracledatabase.DbNode{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbNodes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/dbNodes/ocid1"), - // Properties: &armoracledatabase.DbNodeProperties{ - // BackupIPID: to.Ptr("id1"), - // BackupVnic2ID: to.Ptr("id1"), - // BackupVnicID: to.Ptr("id1"), - // CPUCoreCount: to.Ptr[int32](1000), - // DbNodeStorageSizeInGbs: to.Ptr[int32](500), - // DbServerID: to.Ptr("dbserver1"), - // DbSystemID: to.Ptr("db1"), - // FaultDomain: to.Ptr("domain1"), - // HostIPID: to.Ptr("10.0.0.0"), - // Hostname: to.Ptr("host1"), - // MaintenanceType: to.Ptr(armoracledatabase.DbNodeMaintenanceTypeVmdbRebootMigration), - // MemorySizeInGbs: to.Ptr[int32](100), - // Ocid: to.Ptr("ocid.dbNodes.1"), - // ProvisioningState: to.Ptr(armoracledatabase.ResourceProvisioningStateSucceeded), - // SoftwareStorageSizeInGb: to.Ptr[int32](1000), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // Vnic2ID: to.Ptr("ocid.vnic.id2"), - // VnicID: to.Ptr("ocid.vnic.id1"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go index 34bc828e0228..1b16fbf2629c 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go @@ -46,7 +46,7 @@ func NewDbServersClient(subscriptionID string, credential azcore.TokenCredential // Get - Get a DbServer // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - dbserverocid - DbServer OCID. @@ -97,7 +97,7 @@ func (client *DbServersClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *DbServersClient) getHandleResponse(resp *http.Response) (DbServers // NewListByCloudExadataInfrastructurePager - List DbServer resources by CloudExadataInfrastructure // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - options - DbServersClientListByCloudExadataInfrastructureOptions contains the optional parameters for the DbServersClient.NewListByCloudExadataInfrastructurePager @@ -162,7 +162,7 @@ func (client *DbServersClient) listByCloudExadataInfrastructureCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client_example_test.go deleted file mode 100644 index 12f1139bea15..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_listByParent.json -func ExampleDbServersClient_NewListByCloudExadataInfrastructurePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDbServersClient().NewListByCloudExadataInfrastructurePager("rg000", "infra1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DbServerListResult = armoracledatabase.DbServerListResult{ - // Value: []*armoracledatabase.DbServer{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbServers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1/dbServers/ocid1"), - // Properties: &armoracledatabase.DbServerProperties{ - // AutonomousVirtualMachineIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // AutonomousVMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // CompartmentID: to.Ptr("ocid1....aaaa"), - // CPUCoreCount: to.Ptr[int32](100), - // DbNodeIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // DbNodeStorageSizeInGbs: to.Ptr[int32](150), - // DisplayName: to.Ptr("dbserver1"), - // ExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // LifecycleState: to.Ptr(armoracledatabase.DbServerProvisioningStateAvailable), - // MaxCPUCount: to.Ptr[int32](1000), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // Ocid: to.Ptr("ocid1"), - // VMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json -func ExampleDbServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDbServersClient().Get(ctx, "rg000", "infra1", "ocid1....aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbServer = armoracledatabase.DbServer{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbServers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1/dbServers/ocid1"), - // Properties: &armoracledatabase.DbServerProperties{ - // AutonomousVirtualMachineIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // AutonomousVMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // CompartmentID: to.Ptr("ocid1....aaaa"), - // CPUCoreCount: to.Ptr[int32](100), - // DbNodeIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // DbNodeStorageSizeInGbs: to.Ptr[int32](150), - // DisplayName: to.Ptr("dbserver1"), - // ExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // LifecycleState: to.Ptr(armoracledatabase.DbServerProvisioningStateAvailable), - // MaxCPUCount: to.Ptr[int32](1000), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // Ocid: to.Ptr("ocid1"), - // VMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go index 64a1709916e8..9a4ff7e9955a 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go @@ -46,7 +46,7 @@ func NewDbSystemShapesClient(subscriptionID string, credential azcore.TokenCrede // Get - Get a DbSystemShape // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - dbsystemshapename - DbSystemShape name // - options - DbSystemShapesClientGetOptions contains the optional parameters for the DbSystemShapesClient.Get method. @@ -92,7 +92,7 @@ func (client *DbSystemShapesClient) getCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *DbSystemShapesClient) getHandleResponse(resp *http.Response) (DbSy // NewListByLocationPager - List DbSystemShape resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - DbSystemShapesClientListByLocationOptions contains the optional parameters for the DbSystemShapesClient.NewListByLocationPager // method. @@ -152,7 +152,7 @@ func (client *DbSystemShapesClient) listByLocationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client_example_test.go deleted file mode 100644 index 63e720f7e41f..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_listByLocation.json -func ExampleDbSystemShapesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDbSystemShapesClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DbSystemShapeListResult = armoracledatabase.DbSystemShapeListResult{ - // Value: []*armoracledatabase.DbSystemShape{ - // { - // Type: to.Ptr("Oracle.Database/locations/dbSystemShapes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dbSystemShapes/EXADATA.X9M"), - // Properties: &armoracledatabase.DbSystemShapeProperties{ - // AvailableCoreCount: to.Ptr[int32](100), - // AvailableCoreCountPerNode: to.Ptr[int32](1000), - // AvailableDataStorageInTbs: to.Ptr[int32](10), - // AvailableDataStoragePerServerInTbs: to.Ptr[float64](100), - // AvailableDbNodePerNodeInGbs: to.Ptr[int32](10), - // AvailableDbNodeStorageInGbs: to.Ptr[int32](10), - // AvailableMemoryInGbs: to.Ptr[int32](10), - // AvailableMemoryPerNodeInGbs: to.Ptr[int32](10), - // CoreCountIncrement: to.Ptr[int32](1), - // MaxStorageCount: to.Ptr[int32](100), - // MaximumNodeCount: to.Ptr[int32](1000), - // MinCoreCountPerNode: to.Ptr[int32](0), - // MinDataStorageInTbs: to.Ptr[int32](0), - // MinDbNodeStoragePerNodeInGbs: to.Ptr[int32](0), - // MinMemoryPerNodeInGbs: to.Ptr[int32](0), - // MinStorageCount: to.Ptr[int32](0), - // MinimumCoreCount: to.Ptr[int32](1), - // MinimumNodeCount: to.Ptr[int32](0), - // RuntimeMinimumCoreCount: to.Ptr[int32](1), - // ShapeFamily: to.Ptr("EXADATA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json -func ExampleDbSystemShapesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDbSystemShapesClient().Get(ctx, "eastus", "EXADATA.X9M", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbSystemShape = armoracledatabase.DbSystemShape{ - // Type: to.Ptr("Oracle.Database/locations/dbSystemShapes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dbSystemShapes/EXADATA.X9M"), - // Properties: &armoracledatabase.DbSystemShapeProperties{ - // AvailableCoreCount: to.Ptr[int32](100), - // AvailableCoreCountPerNode: to.Ptr[int32](1000), - // AvailableDataStorageInTbs: to.Ptr[int32](10), - // AvailableDataStoragePerServerInTbs: to.Ptr[float64](100), - // AvailableDbNodePerNodeInGbs: to.Ptr[int32](10), - // AvailableDbNodeStorageInGbs: to.Ptr[int32](10), - // AvailableMemoryInGbs: to.Ptr[int32](10), - // AvailableMemoryPerNodeInGbs: to.Ptr[int32](10), - // CoreCountIncrement: to.Ptr[int32](1), - // MaxStorageCount: to.Ptr[int32](100), - // MaximumNodeCount: to.Ptr[int32](1000), - // MinCoreCountPerNode: to.Ptr[int32](0), - // MinDataStorageInTbs: to.Ptr[int32](0), - // MinDbNodeStoragePerNodeInGbs: to.Ptr[int32](0), - // MinMemoryPerNodeInGbs: to.Ptr[int32](0), - // MinStorageCount: to.Ptr[int32](0), - // MinimumCoreCount: to.Ptr[int32](1), - // MinimumNodeCount: to.Ptr[int32](0), - // RuntimeMinimumCoreCount: to.Ptr[int32](1), - // ShapeFamily: to.Ptr("EXADATA"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go index 0a36f1bbd684..1ac046466583 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go @@ -46,7 +46,7 @@ func NewDNSPrivateViewsClient(subscriptionID string, credential azcore.TokenCred // Get - Get a DnsPrivateView // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - dnsprivateviewocid - DnsPrivateView OCID // - options - DNSPrivateViewsClientGetOptions contains the optional parameters for the DNSPrivateViewsClient.Get method. @@ -92,7 +92,7 @@ func (client *DNSPrivateViewsClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *DNSPrivateViewsClient) getHandleResponse(resp *http.Response) (DNS // NewListByLocationPager - List DnsPrivateView resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - DNSPrivateViewsClientListByLocationOptions contains the optional parameters for the DNSPrivateViewsClient.NewListByLocationPager // method. @@ -152,7 +152,7 @@ func (client *DNSPrivateViewsClient) listByLocationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client_example_test.go deleted file mode 100644 index 4987b77cd99c..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client_example_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_listByLocation.json -func ExampleDNSPrivateViewsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDNSPrivateViewsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DNSPrivateViewListResult = armoracledatabase.DNSPrivateViewListResult{ - // Value: []*armoracledatabase.DNSPrivateView{ - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateViews/ocid1....aaaaaa"), - // Properties: &armoracledatabase.DNSPrivateViewProperties{ - // DisplayName: to.Ptr("example-dns-private-view1"), - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateViewsLifecycleStateActive), - // Ocid: to.Ptr("ocid1....aaaaaa"), - // Self: to.Ptr("https://api.example.com/view1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // TimeUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T14:00:00.000Z"); return t}()), - // }, - // }, - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateViews/ocid1....aaaaab"), - // Properties: &armoracledatabase.DNSPrivateViewProperties{ - // DisplayName: to.Ptr("example-dns-private-view2"), - // IsProtected: to.Ptr(true), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateViewsLifecycleState("Creating")), - // Ocid: to.Ptr("ocid1....aaaaab"), - // Self: to.Ptr("https://api.example.com/view2"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-27T09:45:00.000Z"); return t}()), - // TimeUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-27T10:30:00.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json -func ExampleDNSPrivateViewsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDNSPrivateViewsClient().Get(ctx, "eastus", "ocid1....aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DNSPrivateView = armoracledatabase.DNSPrivateView{ - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateViews/ocid1....aaaaaa"), - // Properties: &armoracledatabase.DNSPrivateViewProperties{ - // DisplayName: to.Ptr("example-dns-private-view"), - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateViewsLifecycleStateActive), - // Ocid: to.Ptr("ocid1....aaaaaa"), - // Self: to.Ptr("https://api.example.com/your-dns-private-view"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // TimeUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T14:00:00.000Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go index 15733949a0c4..ecf9197e63b8 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go @@ -46,7 +46,7 @@ func NewDNSPrivateZonesClient(subscriptionID string, credential azcore.TokenCred // Get - Get a DnsPrivateZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - dnsprivatezonename - DnsPrivateZone name // - options - DNSPrivateZonesClientGetOptions contains the optional parameters for the DNSPrivateZonesClient.Get method. @@ -92,7 +92,7 @@ func (client *DNSPrivateZonesClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *DNSPrivateZonesClient) getHandleResponse(resp *http.Response) (DNS // NewListByLocationPager - List DnsPrivateZone resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - DNSPrivateZonesClientListByLocationOptions contains the optional parameters for the DNSPrivateZonesClient.NewListByLocationPager // method. @@ -152,7 +152,7 @@ func (client *DNSPrivateZonesClient) listByLocationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client_example_test.go deleted file mode 100644 index b15f526f959e..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client_example_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_listByLocation.json -func ExampleDNSPrivateZonesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDNSPrivateZonesClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DNSPrivateZoneListResult = armoracledatabase.DNSPrivateZoneListResult{ - // Value: []*armoracledatabase.DNSPrivateZone{ - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateZones/zone1"), - // Properties: &armoracledatabase.DNSPrivateZoneProperties{ - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateZonesLifecycleStateActive), - // Ocid: to.Ptr("zone-id-1"), - // Self: to.Ptr("https://api.example.com/zone1"), - // Serial: to.Ptr[int32](12345), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // Version: to.Ptr("1.0.0.0"), - // ViewID: to.Ptr("view-id-1"), - // ZoneType: to.Ptr(armoracledatabase.ZoneTypePrimary), - // }, - // }, - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateZones/zone2"), - // Properties: &armoracledatabase.DNSPrivateZoneProperties{ - // IsProtected: to.Ptr(true), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateZonesLifecycleStateCreating), - // Ocid: to.Ptr("zone-id-2"), - // Self: to.Ptr("https://api.example.com/zone2"), - // Serial: to.Ptr[int32](54321), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-27T09:45:00.000Z"); return t}()), - // Version: to.Ptr("2.0.0.0"), - // ViewID: to.Ptr("view-id-2"), - // ZoneType: to.Ptr(armoracledatabase.ZoneTypeSecondary), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json -func ExampleDNSPrivateZonesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDNSPrivateZonesClient().Get(ctx, "eastus", "example-dns-private-zone", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DNSPrivateZone = armoracledatabase.DNSPrivateZone{ - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateZones/example-dns-private-zone"), - // Properties: &armoracledatabase.DNSPrivateZoneProperties{ - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateZonesLifecycleStateActive), - // Ocid: to.Ptr("your-zone-id"), - // Self: to.Ptr("https://api.example.com/your-dns-private-zone"), - // Serial: to.Ptr[int32](12345), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // Version: to.Ptr("1.0.0.0"), - // ViewID: to.Ptr("your-view-id"), - // ZoneType: to.Ptr(armoracledatabase.ZoneTypePrimary), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go index 712077d00f40..629028d52fff 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go @@ -23,6 +23,10 @@ import ( // OracleSubscriptionsServer is a fake server for instances of the armoracledatabase.OracleSubscriptionsClient type. type OracleSubscriptionsServer struct { + // BeginAddAzureSubscriptions is the fake for method OracleSubscriptionsClient.BeginAddAzureSubscriptions + // HTTP status codes to indicate success: http.StatusAccepted + BeginAddAzureSubscriptions func(ctx context.Context, body armoracledatabase.AzureSubscriptions, options *armoracledatabase.OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (resp azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientAddAzureSubscriptionsResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method OracleSubscriptionsClient.BeginCreateOrUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreateOrUpdate func(ctx context.Context, resource armoracledatabase.OracleSubscription, options *armoracledatabase.OracleSubscriptionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) @@ -62,6 +66,7 @@ type OracleSubscriptionsServer struct { func NewOracleSubscriptionsServerTransport(srv *OracleSubscriptionsServer) *OracleSubscriptionsServerTransport { return &OracleSubscriptionsServerTransport{ srv: srv, + beginAddAzureSubscriptions: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientAddAzureSubscriptionsResponse]](), beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientDeleteResponse]](), beginListActivationLinks: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientListActivationLinksResponse]](), @@ -76,6 +81,7 @@ func NewOracleSubscriptionsServerTransport(srv *OracleSubscriptionsServer) *Orac // Don't use this type directly, use NewOracleSubscriptionsServerTransport instead. type OracleSubscriptionsServerTransport struct { srv *OracleSubscriptionsServer + beginAddAzureSubscriptions *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientAddAzureSubscriptionsResponse]] beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientDeleteResponse]] beginListActivationLinks *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientListActivationLinksResponse]] @@ -97,6 +103,8 @@ func (o *OracleSubscriptionsServerTransport) Do(req *http.Request) (*http.Respon var err error switch method { + case "OracleSubscriptionsClient.BeginAddAzureSubscriptions": + resp, err = o.dispatchBeginAddAzureSubscriptions(req) case "OracleSubscriptionsClient.BeginCreateOrUpdate": resp, err = o.dispatchBeginCreateOrUpdate(req) case "OracleSubscriptionsClient.BeginDelete": @@ -124,6 +132,46 @@ func (o *OracleSubscriptionsServerTransport) Do(req *http.Request) (*http.Respon return resp, nil } +func (o *OracleSubscriptionsServerTransport) dispatchBeginAddAzureSubscriptions(req *http.Request) (*http.Response, error) { + if o.srv.BeginAddAzureSubscriptions == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginAddAzureSubscriptions not implemented")} + } + beginAddAzureSubscriptions := o.beginAddAzureSubscriptions.get(req) + if beginAddAzureSubscriptions == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/oracleSubscriptions/default/addAzureSubscriptions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.AzureSubscriptions](req) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginAddAzureSubscriptions(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginAddAzureSubscriptions = &respr + o.beginAddAzureSubscriptions.add(req, beginAddAzureSubscriptions) + } + + resp, err := server.PollerResponderNext(beginAddAzureSubscriptions, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + o.beginAddAzureSubscriptions.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginAddAzureSubscriptions) { + o.beginAddAzureSubscriptions.remove(req) + } + + return resp, nil +} + func (o *OracleSubscriptionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { if o.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go index 1a3b95f94727..22b7a4a9b142 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go @@ -46,7 +46,7 @@ func NewGiVersionsClient(subscriptionID string, credential azcore.TokenCredentia // Get - Get a GiVersion // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - giversionname - GiVersion name // - options - GiVersionsClientGetOptions contains the optional parameters for the GiVersionsClient.Get method. @@ -92,7 +92,7 @@ func (client *GiVersionsClient) getCreateRequest(ctx context.Context, location s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *GiVersionsClient) getHandleResponse(resp *http.Response) (GiVersio // NewListByLocationPager - List GiVersion resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - GiVersionsClientListByLocationOptions contains the optional parameters for the GiVersionsClient.NewListByLocationPager // method. @@ -152,7 +152,7 @@ func (client *GiVersionsClient) listByLocationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client_example_test.go deleted file mode 100644 index f9115c0f888b..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_listByLocation.json -func ExampleGiVersionsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGiVersionsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GiVersionListResult = armoracledatabase.GiVersionListResult{ - // Value: []*armoracledatabase.GiVersion{ - // { - // Type: to.Ptr("Oracle.Database/locations/giVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/giVersions/19.0.0.0"), - // Properties: &armoracledatabase.GiVersionProperties{ - // Version: to.Ptr("19.0.0.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json -func ExampleGiVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGiVersionsClient().Get(ctx, "eastus", "19.0.0.0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GiVersion = armoracledatabase.GiVersion{ - // Type: to.Ptr("Oracle.Database/locations/giVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/giVersions/19.0.0.0"), - // Properties: &armoracledatabase.GiVersionProperties{ - // Version: to.Ptr("19.0.0.0"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod index 8486742bd945..6bae9df30279 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armo go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go index 49ee984711d8..baeba56ec065 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go @@ -154,7 +154,7 @@ type AutonomousDatabaseBackupProperties struct { // AutonomousDatabaseBackupUpdate - The type used for update operations of the AutonomousDatabaseBackup. type AutonomousDatabaseBackupUpdate struct { - // The updatable properties of the AutonomousDatabaseBackup. + // The resource-specific properties for this resource. Properties *AutonomousDatabaseBackupUpdateProperties } @@ -1172,7 +1172,7 @@ type AutonomousDatabaseStandbySummary struct { // AutonomousDatabaseUpdate - The type used for update operations of the AutonomousDatabase. type AutonomousDatabaseUpdate struct { - // The updatable properties of the AutonomousDatabase. + // The resource-specific properties for this resource. Properties *AutonomousDatabaseUpdateProperties // Resource tags. @@ -1289,9 +1289,6 @@ type AutonomousDbVersionListResult struct { // AutonomousDbVersionProperties - AutonomousDbVersion resource model type AutonomousDbVersionProperties struct { - // READ-ONLY; Supported Autonomous Db versions. - Version *string - // READ-ONLY; The Autonomous Database workload type DbWorkload *WorkloadType @@ -1306,6 +1303,15 @@ type AutonomousDbVersionProperties struct { // READ-ONLY; True if this version of the Oracle Database software has payments enabled. IsPaidEnabled *bool + + // READ-ONLY; Supported Autonomous Db versions. + Version *string +} + +// AzureSubscriptions - Azure Subscriptions model +type AzureSubscriptions struct { + // REQUIRED; Azure Subscription Ids to be updated + AzureSubscriptionIDs []*string } // CloudAccountDetails - Cloud Account Details model @@ -1456,7 +1462,7 @@ type CloudExadataInfrastructureProperties struct { // CloudExadataInfrastructureUpdate - The type used for update operations of the CloudExadataInfrastructure. type CloudExadataInfrastructureUpdate struct { - // The updatable properties of the CloudExadataInfrastructure. + // The resource-specific properties for this resource. Properties *CloudExadataInfrastructureUpdateProperties // Resource tags. @@ -1683,7 +1689,7 @@ type CloudVMClusterProperties struct { // CloudVMClusterUpdate - The type used for update operations of the CloudVmCluster. type CloudVMClusterUpdate struct { - // The updatable properties of the CloudVmCluster. + // The resource-specific properties for this resource. Properties *CloudVMClusterUpdateProperties // Resource tags. @@ -1812,12 +1818,21 @@ type DNSPrivateViewListResult struct { // DNSPrivateViewProperties - Views resource model type DNSPrivateViewProperties struct { + // READ-ONLY; The display name of the view resource + DisplayName *string + // READ-ONLY; A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. IsProtected *bool + // READ-ONLY; Views lifecycleState + LifecycleState *DNSPrivateViewsLifecycleState + // READ-ONLY; The OCID of the view Ocid *string + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *ResourceProvisioningState + // READ-ONLY; The canonical absolute URL of the resource. Self *string @@ -1826,15 +1841,6 @@ type DNSPrivateViewProperties struct { // READ-ONLY; views timeCreated TimeUpdated *time.Time - - // READ-ONLY; The display name of the view resource - DisplayName *string - - // READ-ONLY; Views lifecycleState - LifecycleState *DNSPrivateViewsLifecycleState - - // READ-ONLY; Azure resource provisioning state. - ProvisioningState *ResourceProvisioningState } // DNSPrivateZone - DnsPrivateZone resource definition @@ -1869,9 +1875,15 @@ type DNSPrivateZoneProperties struct { // READ-ONLY; A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. IsProtected *bool + // READ-ONLY; Zones lifecycleState + LifecycleState *DNSPrivateZonesLifecycleState + // READ-ONLY; The OCID of the Zone Ocid *string + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *ResourceProvisioningState + // READ-ONLY; The canonical absolute URL of the resource. Self *string @@ -1885,18 +1897,12 @@ type DNSPrivateZoneProperties struct { // SOA record is derived. Version *string - // READ-ONLY; The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. - ZoneType *ZoneType - - // READ-ONLY; Zones lifecycleState - LifecycleState *DNSPrivateZonesLifecycleState - - // READ-ONLY; Azure resource provisioning state. - ProvisioningState *ResourceProvisioningState - // READ-ONLY; The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which // are publicly resolvable and not part of a private view. ViewID *string + + // READ-ONLY; The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. + ZoneType *ZoneType } // DataCollectionOptions resource properties @@ -1970,12 +1976,6 @@ type DbNodeListResult struct { // DbNodeProperties - The properties of DbNodeResource type DbNodeProperties struct { - // READ-ONLY; The OCID of the DB system. - DbSystemID *string - - // READ-ONLY; DbNode OCID - Ocid *string - // READ-ONLY; Additional information about the planned maintenance. AdditionalDetails *string @@ -1997,6 +1997,9 @@ type DbNodeProperties struct { // READ-ONLY; The OCID of the Exacc Db server associated with the database node. DbServerID *string + // READ-ONLY; The OCID of the DB system. + DbSystemID *string + // READ-ONLY; The name of the Fault Domain the instance is contained in. FaultDomain *string @@ -2018,6 +2021,9 @@ type DbNodeProperties struct { // READ-ONLY; The allocated memory in GBs on the Db node. MemorySizeInGbs *int32 + // READ-ONLY; DbNode OCID + Ocid *string + // READ-ONLY; Azure resource provisioning state. ProvisioningState *ResourceProvisioningState @@ -2478,12 +2484,21 @@ type OracleSubscriptionProperties struct { // Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601 TermUnit *string + // READ-ONLY; State of the add Azure subscription operation on Oracle subscription + AddSubscriptionOperationState *AddSubscriptionOperationState + + // READ-ONLY; Azure subscriptions associated with this OracleSubscription + AzureSubscriptionIDs []*string + // READ-ONLY; Cloud Account Id CloudAccountID *string // READ-ONLY; Cloud Account provisioning state. CloudAccountState *CloudAccountProvisioningState + // READ-ONLY; Status details of the last operation on Oracle subscription + LastOperationStatusDetail *string + // READ-ONLY; OracleSubscriptionProvisioningState provisioning state ProvisioningState *OracleSubscriptionProvisioningState @@ -2496,7 +2511,7 @@ type OracleSubscriptionUpdate struct { // Details of the resource plan. Plan *PlanUpdate - // The updatable properties of the OracleSubscription. + // The resource-specific properties for this resource. Properties *OracleSubscriptionUpdateProperties } diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go index 3c239e9ac5d9..2b9df813b87c 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go @@ -1976,6 +1976,33 @@ func (a *AutonomousDbVersionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureSubscriptions. +func (a AzureSubscriptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureSubscriptionIds", a.AzureSubscriptionIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSubscriptions. +func (a *AzureSubscriptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureSubscriptionIds": + err = unpopulate(val, "AzureSubscriptionIDs", &a.AzureSubscriptionIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CloudAccountDetails. func (c CloudAccountDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4405,9 +4432,12 @@ func (o *OracleSubscriptionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OracleSubscriptionProperties. func (o OracleSubscriptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "addSubscriptionOperationState", o.AddSubscriptionOperationState) + populate(objectMap, "azureSubscriptionIds", o.AzureSubscriptionIDs) populate(objectMap, "cloudAccountId", o.CloudAccountID) populate(objectMap, "cloudAccountState", o.CloudAccountState) populate(objectMap, "intent", o.Intent) + populate(objectMap, "lastOperationStatusDetail", o.LastOperationStatusDetail) populate(objectMap, "productCode", o.ProductCode) populate(objectMap, "provisioningState", o.ProvisioningState) populate(objectMap, "saasSubscriptionId", o.SaasSubscriptionID) @@ -4424,6 +4454,12 @@ func (o *OracleSubscriptionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "addSubscriptionOperationState": + err = unpopulate(val, "AddSubscriptionOperationState", &o.AddSubscriptionOperationState) + delete(rawMsg, key) + case "azureSubscriptionIds": + err = unpopulate(val, "AzureSubscriptionIDs", &o.AzureSubscriptionIDs) + delete(rawMsg, key) case "cloudAccountId": err = unpopulate(val, "CloudAccountID", &o.CloudAccountID) delete(rawMsg, key) @@ -4433,6 +4469,9 @@ func (o *OracleSubscriptionProperties) UnmarshalJSON(data []byte) error { case "intent": err = unpopulate(val, "Intent", &o.Intent) delete(rawMsg, key) + case "lastOperationStatusDetail": + err = unpopulate(val, "LastOperationStatusDetail", &o.LastOperationStatusDetail) + delete(rawMsg, key) case "productCode": err = unpopulate(val, "ProductCode", &o.ProductCode) delete(rawMsg, key) diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go index 3afa79d96e07..56d66fa3e6b4 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client_example_test.go deleted file mode 100644 index fc5cc5ef79a8..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client_example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/operations_list.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armoracledatabase.OperationListResult{ - // Value: []*armoracledatabase.Operation{ - // { - // Name: to.Ptr("Oracle.Database/cloudExadataInfrastructures/Read"), - // Display: &armoracledatabase.OperationDisplay{ - // Description: to.Ptr("Reads Exadata Infrastructure"), - // Operation: to.Ptr("Get/list Exadata Infrastructure resources"), - // Provider: to.Ptr("Oracle.Database"), - // Resource: to.Ptr("cloudExadataInfrastructures"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go index 3ff90a3ca86e..55f7c8ce0e30 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go @@ -327,6 +327,13 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } +// OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginAddAzureSubscriptions +// method. +type OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // OracleSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the OracleSubscriptionsClient.BeginCreateOrUpdate // method. type OracleSubscriptionsClientBeginCreateOrUpdateOptions struct { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go index 9b251202d11f..60b88d85241d 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go @@ -43,10 +43,81 @@ func NewOracleSubscriptionsClient(subscriptionID string, credential azcore.Token return client, nil } +// BeginAddAzureSubscriptions - Add Azure Subscriptions +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-06-01 +// - body - The content of the action request +// - options - OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginAddAzureSubscriptions +// method. +func (client *OracleSubscriptionsClient) BeginAddAzureSubscriptions(ctx context.Context, body AzureSubscriptions, options *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*runtime.Poller[OracleSubscriptionsClientAddAzureSubscriptionsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.addAzureSubscriptions(ctx, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OracleSubscriptionsClientAddAzureSubscriptionsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OracleSubscriptionsClientAddAzureSubscriptionsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// AddAzureSubscriptions - Add Azure Subscriptions +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-06-01 +func (client *OracleSubscriptionsClient) addAzureSubscriptions(ctx context.Context, body AzureSubscriptions, options *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*http.Response, error) { + var err error + const operationName = "OracleSubscriptionsClient.BeginAddAzureSubscriptions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.addAzureSubscriptionsCreateRequest(ctx, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// addAzureSubscriptionsCreateRequest creates the AddAzureSubscriptions request. +func (client *OracleSubscriptionsClient) addAzureSubscriptionsCreateRequest(ctx context.Context, body AzureSubscriptions, options *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + // BeginCreateOrUpdate - Create a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resource - Resource create parameters. // - options - OracleSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the OracleSubscriptionsClient.BeginCreateOrUpdate // method. @@ -71,7 +142,7 @@ func (client *OracleSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *OracleSubscriptionsClient) createOrUpdate(ctx context.Context, resource OracleSubscription, options *OracleSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginCreateOrUpdate" @@ -105,7 +176,7 @@ func (client *OracleSubscriptionsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -117,7 +188,7 @@ func (client *OracleSubscriptionsClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - OracleSubscriptionsClientBeginDeleteOptions contains the optional parameters for the OracleSubscriptionsClient.BeginDelete // method. func (client *OracleSubscriptionsClient) BeginDelete(ctx context.Context, options *OracleSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[OracleSubscriptionsClientDeleteResponse], error) { @@ -141,7 +212,7 @@ func (client *OracleSubscriptionsClient) BeginDelete(ctx context.Context, option // Delete - Delete a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *OracleSubscriptionsClient) deleteOperation(ctx context.Context, options *OracleSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginDelete" @@ -175,7 +246,7 @@ func (client *OracleSubscriptionsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +255,7 @@ func (client *OracleSubscriptionsClient) deleteCreateRequest(ctx context.Context // Get - Get a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - OracleSubscriptionsClientGetOptions contains the optional parameters for the OracleSubscriptionsClient.Get method. func (client *OracleSubscriptionsClient) Get(ctx context.Context, options *OracleSubscriptionsClientGetOptions) (OracleSubscriptionsClientGetResponse, error) { var err error @@ -220,7 +291,7 @@ func (client *OracleSubscriptionsClient) getCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +309,7 @@ func (client *OracleSubscriptionsClient) getHandleResponse(resp *http.Response) // BeginListActivationLinks - List Activation Links // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - OracleSubscriptionsClientBeginListActivationLinksOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListActivationLinks // method. func (client *OracleSubscriptionsClient) BeginListActivationLinks(ctx context.Context, options *OracleSubscriptionsClientBeginListActivationLinksOptions) (*runtime.Poller[OracleSubscriptionsClientListActivationLinksResponse], error) { @@ -262,7 +333,7 @@ func (client *OracleSubscriptionsClient) BeginListActivationLinks(ctx context.Co // ListActivationLinks - List Activation Links // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *OracleSubscriptionsClient) listActivationLinks(ctx context.Context, options *OracleSubscriptionsClientBeginListActivationLinksOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginListActivationLinks" @@ -296,7 +367,7 @@ func (client *OracleSubscriptionsClient) listActivationLinksCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +375,7 @@ func (client *OracleSubscriptionsClient) listActivationLinksCreateRequest(ctx co // NewListBySubscriptionPager - List OracleSubscription resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - OracleSubscriptionsClientListBySubscriptionOptions contains the optional parameters for the OracleSubscriptionsClient.NewListBySubscriptionPager // method. func (client *OracleSubscriptionsClient) NewListBySubscriptionPager(options *OracleSubscriptionsClientListBySubscriptionOptions) *runtime.Pager[OracleSubscriptionsClientListBySubscriptionResponse] { @@ -342,7 +413,7 @@ func (client *OracleSubscriptionsClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,7 +431,7 @@ func (client *OracleSubscriptionsClient) listBySubscriptionHandleResponse(resp * // BeginListCloudAccountDetails - List Cloud Account Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - OracleSubscriptionsClientBeginListCloudAccountDetailsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListCloudAccountDetails // method. func (client *OracleSubscriptionsClient) BeginListCloudAccountDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListCloudAccountDetailsOptions) (*runtime.Poller[OracleSubscriptionsClientListCloudAccountDetailsResponse], error) { @@ -384,7 +455,7 @@ func (client *OracleSubscriptionsClient) BeginListCloudAccountDetails(ctx contex // ListCloudAccountDetails - List Cloud Account Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *OracleSubscriptionsClient) listCloudAccountDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListCloudAccountDetailsOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginListCloudAccountDetails" @@ -418,7 +489,7 @@ func (client *OracleSubscriptionsClient) listCloudAccountDetailsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,7 +498,7 @@ func (client *OracleSubscriptionsClient) listCloudAccountDetailsCreateRequest(ct // BeginListSaasSubscriptionDetails - List Saas Subscription Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - options - OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListSaasSubscriptionDetails // method. func (client *OracleSubscriptionsClient) BeginListSaasSubscriptionDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions) (*runtime.Poller[OracleSubscriptionsClientListSaasSubscriptionDetailsResponse], error) { @@ -451,7 +522,7 @@ func (client *OracleSubscriptionsClient) BeginListSaasSubscriptionDetails(ctx co // ListSaasSubscriptionDetails - List Saas Subscription Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *OracleSubscriptionsClient) listSaasSubscriptionDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginListSaasSubscriptionDetails" @@ -485,7 +556,7 @@ func (client *OracleSubscriptionsClient) listSaasSubscriptionDetailsCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,7 +565,7 @@ func (client *OracleSubscriptionsClient) listSaasSubscriptionDetailsCreateReques // BeginUpdate - Update a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - properties - The resource properties to be updated. // - options - OracleSubscriptionsClientBeginUpdateOptions contains the optional parameters for the OracleSubscriptionsClient.BeginUpdate // method. @@ -519,7 +590,7 @@ func (client *OracleSubscriptionsClient) BeginUpdate(ctx context.Context, proper // Update - Update a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *OracleSubscriptionsClient) update(ctx context.Context, properties OracleSubscriptionUpdate, options *OracleSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginUpdate" @@ -553,7 +624,7 @@ func (client *OracleSubscriptionsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client_example_test.go deleted file mode 100644 index 4c37f167fdbc..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client_example_test.go +++ /dev/null @@ -1,307 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listBySubscription.json -func ExampleOracleSubscriptionsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOracleSubscriptionsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OracleSubscriptionListResult = armoracledatabase.OracleSubscriptionListResult{ - // Value: []*armoracledatabase.OracleSubscription{ - // { - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_get.json -func ExampleOracleSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOracleSubscriptionsClient().Get(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OracleSubscription = armoracledatabase.OracleSubscription{ - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_create.json -func ExampleOracleSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginCreateOrUpdate(ctx, armoracledatabase.OracleSubscription{ - Plan: &armoracledatabase.Plan{ - Name: to.Ptr("plan1"), - Product: to.Ptr("product1"), - PromotionCode: to.Ptr("none"), - Publisher: to.Ptr("publisher1"), - Version: to.Ptr("alpha"), - }, - Properties: &armoracledatabase.OracleSubscriptionProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OracleSubscription = armoracledatabase.OracleSubscription{ - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_patch.json -func ExampleOracleSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginUpdate(ctx, armoracledatabase.OracleSubscriptionUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OracleSubscription = armoracledatabase.OracleSubscription{ - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_delete.json -func ExampleOracleSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginDelete(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listActivationLinks.json -func ExampleOracleSubscriptionsClient_BeginListActivationLinks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginListActivationLinks(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ActivationLinks = armoracledatabase.ActivationLinks{ - // ExistingCloudAccountActivationLink: to.Ptr("https://existing-tenancy-activation-link"), - // NewCloudAccountActivationLink: to.Ptr("https://new-tenancy-activation-link"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listCloudAccountDetails.json -func ExampleOracleSubscriptionsClient_BeginListCloudAccountDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginListCloudAccountDetails(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudAccountDetails = armoracledatabase.CloudAccountDetails{ - // CloudAccountHomeRegion: to.Ptr("East US"), - // CloudAccountName: to.Ptr("Cloud Account"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listSaasSubscriptionDetails.json -func ExampleOracleSubscriptionsClient_BeginListSaasSubscriptionDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginListSaasSubscriptionDetails(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SaasSubscriptionDetails = armoracledatabase.SaasSubscriptionDetails{ - // ID: to.Ptr("1234567890"), - // IsAutoRenew: to.Ptr(true), - // IsFreeTrial: to.Ptr(false), - // OfferID: to.Ptr("offer1"), - // PlanID: to.Ptr("silver"), - // PublisherID: to.Ptr("Oracle"), - // PurchaserEmailID: to.Ptr("test@test.com"), - // PurchaserTenantID: to.Ptr("1234567890"), - // SaasSubscriptionStatus: to.Ptr("PendingFulfillmentStart"), - // SubscriptionName: to.Ptr("Oracle"), - // TermUnit: to.Ptr("P1M"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-07T00:00:00.000Z"); return t}()), - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go index f34e50a6e231..842021dfdf9a 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go @@ -316,6 +316,11 @@ type OperationsClientListResponse struct { OperationListResult } +// OracleSubscriptionsClientAddAzureSubscriptionsResponse contains the response from method OracleSubscriptionsClient.BeginAddAzureSubscriptions. +type OracleSubscriptionsClientAddAzureSubscriptionsResponse struct { + // placeholder for future response values +} + // OracleSubscriptionsClientCreateOrUpdateResponse contains the response from method OracleSubscriptionsClient.BeginCreateOrUpdate. type OracleSubscriptionsClientCreateOrUpdateResponse struct { // OracleSubscription resource definition diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go index 9cd4a0226b2e..fcd6593861fb 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go @@ -46,7 +46,7 @@ func NewSystemVersionsClient(subscriptionID string, credential azcore.TokenCrede // Get - Get a SystemVersion // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - systemversionname - SystemVersion name // - options - SystemVersionsClientGetOptions contains the optional parameters for the SystemVersionsClient.Get method. @@ -92,7 +92,7 @@ func (client *SystemVersionsClient) getCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *SystemVersionsClient) getHandleResponse(resp *http.Response) (Syst // NewListByLocationPager - List SystemVersion resources by Location // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - location - The name of the Azure region. // - options - SystemVersionsClientListByLocationOptions contains the optional parameters for the SystemVersionsClient.NewListByLocationPager // method. @@ -152,7 +152,7 @@ func (client *SystemVersionsClient) listByLocationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client_example_test.go deleted file mode 100644 index 5a6d1aa80dad..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client_example_test.go +++ /dev/null @@ -1,78 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_listByLocation.json -func ExampleSystemVersionsClient_NewListByLocationPager_listExadataSystemVersionsByTheProvidedFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSystemVersionsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SystemVersionListResult = armoracledatabase.SystemVersionListResult{ - // Value: []*armoracledatabase.SystemVersion{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/systemVersion/22.1.7.0.0.230113"), - // Properties: &armoracledatabase.SystemVersionProperties{ - // SystemVersion: to.Ptr("22.1.7.0.0.230113"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json -func ExampleSystemVersionsClient_Get_getExadataSystemVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSystemVersionsClient().Get(ctx, "eastus", "22.x", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SystemVersion = armoracledatabase.SystemVersion{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/systemVersion/22.1.7.0.0.230113"), - // Properties: &armoracledatabase.SystemVersionProperties{ - // SystemVersion: to.Ptr("22.1.7.0.0.230113"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go index a807d9ae6281..99c535fbcc80 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go @@ -46,7 +46,7 @@ func NewVirtualNetworkAddressesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Create a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - virtualnetworkaddressname - Virtual IP address hostname. @@ -74,7 +74,7 @@ func (client *VirtualNetworkAddressesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *VirtualNetworkAddressesClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, resource VirtualNetworkAddress, options *VirtualNetworkAddressesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkAddressesClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *VirtualNetworkAddressesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -132,7 +132,7 @@ func (client *VirtualNetworkAddressesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - virtualnetworkaddressname - Virtual IP address hostname. @@ -159,7 +159,7 @@ func (client *VirtualNetworkAddressesClient) BeginDelete(ctx context.Context, re // Delete - Delete a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 func (client *VirtualNetworkAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, options *VirtualNetworkAddressesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkAddressesClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *VirtualNetworkAddressesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *VirtualNetworkAddressesClient) deleteCreateRequest(ctx context.Con // Get - Get a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - virtualnetworkaddressname - Virtual IP address hostname. @@ -266,7 +266,7 @@ func (client *VirtualNetworkAddressesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *VirtualNetworkAddressesClient) getHandleResponse(resp *http.Respon // NewListByCloudVMClusterPager - List VirtualNetworkAddress resources by CloudVmCluster // -// Generated from API version 2023-09-01 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - options - VirtualNetworkAddressesClientListByCloudVMClusterOptions contains the optional parameters for the VirtualNetworkAddressesClient.NewListByCloudVMClusterPager @@ -331,7 +331,7 @@ func (client *VirtualNetworkAddressesClient) listByCloudVMClusterCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client_example_test.go deleted file mode 100644 index 890f38a5f662..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client_example_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_listByParent.json -func ExampleVirtualNetworkAddressesClient_NewListByCloudVMClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkAddressesClient().NewListByCloudVMClusterPager("rg000", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkAddressListResult = armoracledatabase.VirtualNetworkAddressListResult{ - // Value: []*armoracledatabase.VirtualNetworkAddress{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters/virtualNetworkAddresses"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/virtualNetworkAddresses/hostname1"), - // Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - // Domain: to.Ptr("domain1"), - // IPAddress: to.Ptr("192.168.0.1"), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.VirtualNetworkAddressLifecycleStateAvailable), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // TimeAssigned: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T00:27:02.119Z"); return t}()), - // VMOcid: to.Ptr("ocid1..aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json -func ExampleVirtualNetworkAddressesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkAddressesClient().Get(ctx, "rg000", "cluster1", "hostname1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkAddress = armoracledatabase.VirtualNetworkAddress{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/virtualNetworkAddresses"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/virtualNetworkAddresses/hostname1"), - // Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - // Domain: to.Ptr("domain1"), - // IPAddress: to.Ptr("192.168.0.1"), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.VirtualNetworkAddressLifecycleStateAvailable), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // TimeAssigned: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T00:27:02.119Z"); return t}()), - // VMOcid: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_create.json -func ExampleVirtualNetworkAddressesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkAddressesClient().BeginCreateOrUpdate(ctx, "rg000", "cluster1", "hostname1", armoracledatabase.VirtualNetworkAddress{ - Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - IPAddress: to.Ptr("192.168.0.1"), - VMOcid: to.Ptr("ocid1..aaaa"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkAddress = armoracledatabase.VirtualNetworkAddress{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/virtualNetworkAddresses"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/virtualNetworkAddresses/hostname1"), - // Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - // Domain: to.Ptr("domain1"), - // IPAddress: to.Ptr("192.168.0.1"), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.VirtualNetworkAddressLifecycleStateAvailable), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // TimeAssigned: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T00:27:02.119Z"); return t}()), - // VMOcid: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_delete.json -func ExampleVirtualNetworkAddressesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkAddressesClient().BeginDelete(ctx, "rg000", "cluster1", "hostname1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/CHANGELOG.md b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/CHANGELOG.md index f380709213f7..1bf9d2d233be 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/CHANGELOG.md +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/CHANGELOG.md @@ -1,5 +1,28 @@ # Release History +## 0.3.0 (2024-08-27) +### Breaking Changes + +- Field `AllocatedValue`, `CreatedAt`, `ExpiryAt`, `PercentageUsed`, `UsedValue` of struct `FreeTrialProperties` has been removed + +### Features Added + +- New value `FreeTrialStateNotEligible`, `FreeTrialStateNotRegistered` added to enum type `FreeTrialState` +- New value `ProvisioningStateCreating` added to enum type `ProvisioningState` +- New enum type `CheckNameAvailabilityReason` with values `CheckNameAvailabilityReasonAlreadyExists`, `CheckNameAvailabilityReasonInvalid` +- New function `NewAccountQuotasClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AccountQuotasClient, error)` +- New function `*AccountQuotasClient.Get(context.Context, string, string, QuotaNames, *AccountQuotasClientGetOptions) (AccountQuotasClientGetResponse, error)` +- New function `*AccountQuotasClient.NewListByAccountPager(string, string, *AccountQuotasClientListByAccountOptions) *runtime.Pager[AccountQuotasClientListByAccountResponse]` +- New function `*AccountsClient.CheckNameAvailability(context.Context, CheckNameAvailabilityRequest, *AccountsClientCheckNameAvailabilityOptions) (AccountsClientCheckNameAvailabilityResponse, error)` +- New function `*ClientFactory.NewAccountQuotasClient() *AccountQuotasClient` +- New struct `AccountFreeTrialProperties` +- New struct `AccountQuota` +- New struct `AccountQuotaListResult` +- New struct `AccountQuotaProperties` +- New struct `CheckNameAvailabilityRequest` +- New struct `CheckNameAvailabilityResponse` + + ## 0.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/README.md b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/README.md index 62671d53d9db..c55b54704976 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/README.md +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/README.md @@ -57,7 +57,7 @@ clientFactory, err := armplaywrighttesting.NewClientFactory(, c A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewQuotasClient() +client := clientFactory.NewAccountQuotasClient() ``` ## Fakes diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accountquotas_client.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accountquotas_client.go new file mode 100644 index 000000000000..19c37edfb994 --- /dev/null +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accountquotas_client.go @@ -0,0 +1,178 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armplaywrighttesting + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AccountQuotasClient contains the methods for the AccountQuotas group. +// Don't use this type directly, use NewAccountQuotasClient() instead. +type AccountQuotasClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAccountQuotasClient creates a new instance of AccountQuotasClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAccountQuotasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountQuotasClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AccountQuotasClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get quota by name for an account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - Name of account. +// - quotaName - The Playwright service account quota name. +// - options - AccountQuotasClientGetOptions contains the optional parameters for the AccountQuotasClient.Get method. +func (client *AccountQuotasClient) Get(ctx context.Context, resourceGroupName string, accountName string, quotaName QuotaNames, options *AccountQuotasClientGetOptions) (AccountQuotasClientGetResponse, error) { + var err error + const operationName = "AccountQuotasClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, quotaName, options) + if err != nil { + return AccountQuotasClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountQuotasClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountQuotasClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AccountQuotasClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, quotaName QuotaNames, options *AccountQuotasClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if quotaName == "" { + return nil, errors.New("parameter quotaName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{quotaName}", url.PathEscape(string(quotaName))) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AccountQuotasClient) getHandleResponse(resp *http.Response) (AccountQuotasClientGetResponse, error) { + result := AccountQuotasClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AccountQuota); err != nil { + return AccountQuotasClientGetResponse{}, err + } + return result, nil +} + +// NewListByAccountPager - List quotas for a given account. +// +// Generated from API version 2024-02-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - Name of account. +// - options - AccountQuotasClientListByAccountOptions contains the optional parameters for the AccountQuotasClient.NewListByAccountPager +// method. +func (client *AccountQuotasClient) NewListByAccountPager(resourceGroupName string, accountName string, options *AccountQuotasClientListByAccountOptions) *runtime.Pager[AccountQuotasClientListByAccountResponse] { + return runtime.NewPager(runtime.PagingHandler[AccountQuotasClientListByAccountResponse]{ + More: func(page AccountQuotasClientListByAccountResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AccountQuotasClientListByAccountResponse) (AccountQuotasClientListByAccountResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountQuotasClient.NewListByAccountPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) + }, nil) + if err != nil { + return AccountQuotasClientListByAccountResponse{}, err + } + return client.listByAccountHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByAccountCreateRequest creates the ListByAccount request. +func (client *AccountQuotasClient) listByAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountQuotasClientListByAccountOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAccountHandleResponse handles the ListByAccount response. +func (client *AccountQuotasClient) listByAccountHandleResponse(resp *http.Response) (AccountQuotasClientListByAccountResponse, error) { + result := AccountQuotasClientListByAccountResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AccountQuotaListResult); err != nil { + return AccountQuotasClientListByAccountResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client.go index 4cc48490df7d..c7fdba85e044 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client.go @@ -28,7 +28,7 @@ type AccountsClient struct { } // NewAccountsClient creates a new instance of AccountsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error) { @@ -43,18 +43,78 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } +// CheckNameAvailability - Adds check global name availability operation, normally used if a resource name must be globally +// unique. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-01-preview +// - body - The CheckAvailability request +// - options - AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability +// method. +func (client *AccountsClient) CheckNameAvailability(ctx context.Context, body CheckNameAvailabilityRequest, options *AccountsClientCheckNameAvailabilityOptions) (AccountsClientCheckNameAvailabilityResponse, error) { + var err error + const operationName = "AccountsClient.CheckNameAvailability" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkNameAvailabilityCreateRequest(ctx, body, options) + if err != nil { + return AccountsClientCheckNameAvailabilityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountsClientCheckNameAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountsClientCheckNameAvailabilityResponse{}, err + } + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err +} + +// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. +func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Context, body CheckNameAvailabilityRequest, options *AccountsClientCheckNameAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. +func (client *AccountsClient) checkNameAvailabilityHandleResponse(resp *http.Response) (AccountsClientCheckNameAvailabilityResponse, error) { + result := AccountsClientCheckNameAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResponse); err != nil { + return AccountsClientCheckNameAvailabilityResponse{}, err + } + return result, nil +} + // BeginCreateOrUpdate - Create a Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - name - Name of account +// - accountName - Name of account. // - resource - Resource create parameters. // - options - AccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the AccountsClient.BeginCreateOrUpdate // method. -func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, name string, resource Account, options *AccountsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AccountsClientCreateOrUpdateResponse], error) { +func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, resource Account, options *AccountsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AccountsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, name, resource, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, resource, options) if err != nil { return nil, err } @@ -73,14 +133,14 @@ func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview -func (client *AccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, name string, resource Account, options *AccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// Generated from API version 2024-02-01-preview +func (client *AccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, resource Account, options *AccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginCreateOrUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, resource, options) + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, resource, options) if err != nil { return nil, err } @@ -96,8 +156,8 @@ func (client *AccountsClient) createOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, name string, resource Account, options *AccountsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}" +func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, resource Account, options *AccountsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -106,16 +166,16 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,13 +187,13 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - name - Name of account +// - accountName - Name of account. // - options - AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. -func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, name string, options *AccountsClientBeginDeleteOptions) (*runtime.Poller[AccountsClientDeleteResponse], error) { +func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*runtime.Poller[AccountsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, name, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, options) if err != nil { return nil, err } @@ -152,14 +212,14 @@ func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview -func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, name string, options *AccountsClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2024-02-01-preview +func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { return nil, err } @@ -175,8 +235,8 @@ func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AccountsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}" +func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -185,16 +245,16 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,17 +263,17 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - name - Name of account +// - accountName - Name of account. // - options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. -func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, name string, options *AccountsClientGetOptions) (AccountsClientGetResponse, error) { +func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetOptions) (AccountsClientGetResponse, error) { var err error const operationName = "AccountsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, name, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { return AccountsClientGetResponse{}, err } @@ -230,8 +290,8 @@ func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AccountsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}" +func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -240,16 +300,16 @@ func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +326,7 @@ func (client *AccountsClient) getHandleResponse(resp *http.Response) (AccountsCl // NewListByResourceGroupPager - List Account resources by resource group // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager // method. @@ -309,7 +369,7 @@ func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +386,7 @@ func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - List Account resources by subscription ID // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager // method. func (client *AccountsClient) NewListBySubscriptionPager(options *AccountsClientListBySubscriptionOptions) *runtime.Pager[AccountsClientListBySubscriptionResponse] { @@ -364,7 +424,7 @@ func (client *AccountsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,18 +442,18 @@ func (client *AccountsClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - Update a Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - name - Name of account +// - accountName - Name of account. // - properties - The resource properties to be updated. // - options - AccountsClientUpdateOptions contains the optional parameters for the AccountsClient.Update method. -func (client *AccountsClient) Update(ctx context.Context, resourceGroupName string, name string, properties AccountUpdate, options *AccountsClientUpdateOptions) (AccountsClientUpdateResponse, error) { +func (client *AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, properties AccountUpdate, options *AccountsClientUpdateOptions) (AccountsClientUpdateResponse, error) { var err error const operationName = "AccountsClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, name, properties, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, properties, options) if err != nil { return AccountsClientUpdateResponse{}, err } @@ -410,8 +470,8 @@ func (client *AccountsClient) Update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, name string, properties AccountUpdate, options *AccountsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}" +func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, properties AccountUpdate, options *AccountsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -420,16 +480,16 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client_example_test.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client_example_test.go deleted file mode 100644 index 13ff1de1ab40..000000000000 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/accounts_client_example_test.go +++ /dev/null @@ -1,296 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armplaywrighttesting_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/playwrighttesting/armplaywrighttesting" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json -func ExampleAccountsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AccountListResult = armplaywrighttesting.AccountListResult{ - // Value: []*armplaywrighttesting.Account{ - // { - // Name: to.Ptr("myPlaywrightAccount"), - // Type: to.Ptr("Microsoft.AzurePlaywrightService/accounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount"), - // SystemData: &armplaywrighttesting.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // Properties: &armplaywrighttesting.AccountProperties{ - // DashboardURI: to.Ptr("https://dashboard.00000000-0000-0000-0000-000000000000.domain.com"), - // ProvisioningState: to.Ptr(armplaywrighttesting.ProvisioningStateSucceeded), - // RegionalAffinity: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // Reporting: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // ScalableExecution: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json -func ExampleAccountsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListByResourceGroupPager("dummyrg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AccountListResult = armplaywrighttesting.AccountListResult{ - // Value: []*armplaywrighttesting.Account{ - // { - // Name: to.Ptr("myPlaywrightAccount"), - // Type: to.Ptr("Microsoft.AzurePlaywrightService/accounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount"), - // SystemData: &armplaywrighttesting.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // Properties: &armplaywrighttesting.AccountProperties{ - // DashboardURI: to.Ptr("https://dashboard.00000000-0000-0000-0000-000000000000.domain.com"), - // ProvisioningState: to.Ptr(armplaywrighttesting.ProvisioningStateSucceeded), - // RegionalAffinity: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // Reporting: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // ScalableExecution: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json -func ExampleAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountsClient().Get(ctx, "dummyrg", "myPlaywrightAccount", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Account = armplaywrighttesting.Account{ - // Name: to.Ptr("myPlaywrightAccount"), - // Type: to.Ptr("Microsoft.AzurePlaywrightService/accounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount"), - // SystemData: &armplaywrighttesting.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // Properties: &armplaywrighttesting.AccountProperties{ - // DashboardURI: to.Ptr("https://dashboard.00000000-0000-0000-0000-000000000000.domain.com"), - // ProvisioningState: to.Ptr(armplaywrighttesting.ProvisioningStateSucceeded), - // RegionalAffinity: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // Reporting: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // ScalableExecution: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json -func ExampleAccountsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginCreateOrUpdate(ctx, "dummyrg", "myPlaywrightAccount", armplaywrighttesting.Account{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "Team": to.Ptr("Dev Exp"), - }, - Properties: &armplaywrighttesting.AccountProperties{ - RegionalAffinity: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Account = armplaywrighttesting.Account{ - // Name: to.Ptr("myPlaywrightAccount"), - // Type: to.Ptr("Microsoft.AzurePlaywrightService/accounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount"), - // SystemData: &armplaywrighttesting.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // Properties: &armplaywrighttesting.AccountProperties{ - // DashboardURI: to.Ptr("https://dashboard.00000000-0000-0000-0000-000000000000.domain.com"), - // ProvisioningState: to.Ptr(armplaywrighttesting.ProvisioningStateSucceeded), - // RegionalAffinity: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // Reporting: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // ScalableExecution: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json -func ExampleAccountsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountsClient().Update(ctx, "dummyrg", "myPlaywrightAccount", armplaywrighttesting.AccountUpdate{ - Properties: &armplaywrighttesting.AccountUpdateProperties{ - RegionalAffinity: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - }, - Tags: map[string]*string{ - "Division": to.Ptr("LT"), - "Team": to.Ptr("Dev Exp"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Account = armplaywrighttesting.Account{ - // Name: to.Ptr("myPlaywrightAccount"), - // Type: to.Ptr("Microsoft.AzurePlaywrightService/accounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount"), - // SystemData: &armplaywrighttesting.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // CreatedBy: to.Ptr("userId1001"), - // CreatedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()), - // LastModifiedBy: to.Ptr("userId1001"), - // LastModifiedByType: to.Ptr(armplaywrighttesting.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Team": to.Ptr("Dev Exp"), - // }, - // Properties: &armplaywrighttesting.AccountProperties{ - // DashboardURI: to.Ptr("https://dashboard.00000000-0000-0000-0000-000000000000.domain.com"), - // ProvisioningState: to.Ptr(armplaywrighttesting.ProvisioningStateSucceeded), - // RegionalAffinity: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // Reporting: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // ScalableExecution: to.Ptr(armplaywrighttesting.EnablementStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json -func ExampleAccountsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginDelete(ctx, "dummyrg", "myPlaywrightAccount", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/autorest.md b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/autorest.md index 9d7b7e3857ba..c432c01ad74c 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/autorest.md +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/playwrighttesting/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/playwrighttesting/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.0 -tag: package-2023-10-01-preview +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/client_factory.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/client_factory.go index 70b8c8f192bc..8f5324dba41a 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/client_factory.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/client_factory.go @@ -17,40 +17,52 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } +// NewAccountQuotasClient creates a new instance of AccountQuotasClient. +func (c *ClientFactory) NewAccountQuotasClient() *AccountQuotasClient { + return &AccountQuotasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewAccountsClient creates a new instance of AccountsClient. func (c *ClientFactory) NewAccountsClient() *AccountsClient { - subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AccountsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewQuotasClient creates a new instance of QuotasClient. func (c *ClientFactory) NewQuotasClient() *QuotasClient { - subClient, _ := NewQuotasClient(c.subscriptionID, c.credential, c.options) - return subClient + return &QuotasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/constants.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/constants.go index e22e04306660..5fe80869cdc3 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/constants.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/constants.go @@ -10,7 +10,7 @@ package armplaywrighttesting const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/playwrighttesting/armplaywrighttesting" - moduleVersion = "v0.2.0" + moduleVersion = "v0.3.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -27,6 +27,22 @@ func PossibleActionTypeValues() []ActionType { } } +// CheckNameAvailabilityReason - The reason why the given name is not available. +type CheckNameAvailabilityReason string + +const ( + CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists" + CheckNameAvailabilityReasonInvalid CheckNameAvailabilityReason = "Invalid" +) + +// PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type. +func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { + return []CheckNameAvailabilityReason{ + CheckNameAvailabilityReasonAlreadyExists, + CheckNameAvailabilityReasonInvalid, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -47,7 +63,9 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// EnablementStatus - The enablement status of a feature. +// EnablementStatus - This property sets the connection region for Playwright client workers to cloud-hosted browsers. If +// enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If +// disabled, workers connect to browsers in the Azure region in which the workspace was initially created. type EnablementStatus string const ( @@ -73,6 +91,10 @@ const ( FreeTrialStateActive FreeTrialState = "Active" // FreeTrialStateExpired - The free-trial is Expired. FreeTrialStateExpired FreeTrialState = "Expired" + // FreeTrialStateNotEligible - The free-trial is Not Eligible. + FreeTrialStateNotEligible FreeTrialState = "NotEligible" + // FreeTrialStateNotRegistered - The free-trial is Not Registered. + FreeTrialStateNotRegistered FreeTrialState = "NotRegistered" ) // PossibleFreeTrialStateValues returns the possible values for the FreeTrialState const type. @@ -80,6 +102,8 @@ func PossibleFreeTrialStateValues() []FreeTrialState { return []FreeTrialState{ FreeTrialStateActive, FreeTrialStateExpired, + FreeTrialStateNotEligible, + FreeTrialStateNotRegistered, } } @@ -106,11 +130,13 @@ func PossibleOriginValues() []Origin { type ProvisioningState string const ( - // ProvisioningStateAccepted - Change accepted for processing + // ProvisioningStateAccepted - Change accepted for processing.. ProvisioningStateAccepted ProvisioningState = "Accepted" // ProvisioningStateCanceled - Resource creation was canceled. ProvisioningStateCanceled ProvisioningState = "Canceled" - // ProvisioningStateDeleting - Deletion in progress + // ProvisioningStateCreating - Creation in progress.. + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting - Deletion in progress.. ProvisioningStateDeleting ProvisioningState = "Deleting" // ProvisioningStateFailed - Resource creation failed. ProvisioningStateFailed ProvisioningState = "Failed" @@ -123,6 +149,7 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ ProvisioningStateAccepted, ProvisioningStateCanceled, + ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accountquotas_server.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accountquotas_server.go new file mode 100644 index 000000000000..aaeeb23aa185 --- /dev/null +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accountquotas_server.go @@ -0,0 +1,162 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/playwrighttesting/armplaywrighttesting" + "net/http" + "net/url" + "regexp" +) + +// AccountQuotasServer is a fake server for instances of the armplaywrighttesting.AccountQuotasClient type. +type AccountQuotasServer struct { + // Get is the fake for method AccountQuotasClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, accountName string, quotaName armplaywrighttesting.QuotaNames, options *armplaywrighttesting.AccountQuotasClientGetOptions) (resp azfake.Responder[armplaywrighttesting.AccountQuotasClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByAccountPager is the fake for method AccountQuotasClient.NewListByAccountPager + // HTTP status codes to indicate success: http.StatusOK + NewListByAccountPager func(resourceGroupName string, accountName string, options *armplaywrighttesting.AccountQuotasClientListByAccountOptions) (resp azfake.PagerResponder[armplaywrighttesting.AccountQuotasClientListByAccountResponse]) +} + +// NewAccountQuotasServerTransport creates a new instance of AccountQuotasServerTransport with the provided implementation. +// The returned AccountQuotasServerTransport instance is connected to an instance of armplaywrighttesting.AccountQuotasClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAccountQuotasServerTransport(srv *AccountQuotasServer) *AccountQuotasServerTransport { + return &AccountQuotasServerTransport{ + srv: srv, + newListByAccountPager: newTracker[azfake.PagerResponder[armplaywrighttesting.AccountQuotasClientListByAccountResponse]](), + } +} + +// AccountQuotasServerTransport connects instances of armplaywrighttesting.AccountQuotasClient to instances of AccountQuotasServer. +// Don't use this type directly, use NewAccountQuotasServerTransport instead. +type AccountQuotasServerTransport struct { + srv *AccountQuotasServer + newListByAccountPager *tracker[azfake.PagerResponder[armplaywrighttesting.AccountQuotasClientListByAccountResponse]] +} + +// Do implements the policy.Transporter interface for AccountQuotasServerTransport. +func (a *AccountQuotasServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "AccountQuotasClient.Get": + resp, err = a.dispatchGet(req) + case "AccountQuotasClient.NewListByAccountPager": + resp, err = a.dispatchNewListByAccountPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *AccountQuotasServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if a.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/quotas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) + if err != nil { + return nil, err + } + quotaNameParam, err := parseWithCast(matches[regex.SubexpIndex("quotaName")], func(v string) (armplaywrighttesting.QuotaNames, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armplaywrighttesting.QuotaNames(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, accountNameParam, quotaNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AccountQuota, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AccountQuotasServerTransport) dispatchNewListByAccountPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListByAccountPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByAccountPager not implemented")} + } + newListByAccountPager := a.newListByAccountPager.get(req) + if newListByAccountPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/quotas` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) + if err != nil { + return nil, err + } + resp := a.srv.NewListByAccountPager(resourceGroupNameParam, accountNameParam, nil) + newListByAccountPager = &resp + a.newListByAccountPager.add(req, newListByAccountPager) + server.PagerResponderInjectNextLinks(newListByAccountPager, req, func(page *armplaywrighttesting.AccountQuotasClientListByAccountResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByAccountPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByAccountPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByAccountPager) { + a.newListByAccountPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accounts_server.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accounts_server.go index 5bea17a7df82..6e29aa50bb41 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accounts_server.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/accounts_server.go @@ -24,17 +24,21 @@ import ( // AccountsServer is a fake server for instances of the armplaywrighttesting.AccountsClient type. type AccountsServer struct { + // CheckNameAvailability is the fake for method AccountsClient.CheckNameAvailability + // HTTP status codes to indicate success: http.StatusOK + CheckNameAvailability func(ctx context.Context, body armplaywrighttesting.CheckNameAvailabilityRequest, options *armplaywrighttesting.AccountsClientCheckNameAvailabilityOptions) (resp azfake.Responder[armplaywrighttesting.AccountsClientCheckNameAvailabilityResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method AccountsClient.BeginCreateOrUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, name string, resource armplaywrighttesting.Account, options *armplaywrighttesting.AccountsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armplaywrighttesting.AccountsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, accountName string, resource armplaywrighttesting.Account, options *armplaywrighttesting.AccountsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armplaywrighttesting.AccountsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method AccountsClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, name string, options *armplaywrighttesting.AccountsClientBeginDeleteOptions) (resp azfake.PollerResponder[armplaywrighttesting.AccountsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, accountName string, options *armplaywrighttesting.AccountsClientBeginDeleteOptions) (resp azfake.PollerResponder[armplaywrighttesting.AccountsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method AccountsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, name string, options *armplaywrighttesting.AccountsClientGetOptions) (resp azfake.Responder[armplaywrighttesting.AccountsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, accountName string, options *armplaywrighttesting.AccountsClientGetOptions) (resp azfake.Responder[armplaywrighttesting.AccountsClientGetResponse], errResp azfake.ErrorResponder) // NewListByResourceGroupPager is the fake for method AccountsClient.NewListByResourceGroupPager // HTTP status codes to indicate success: http.StatusOK @@ -46,7 +50,7 @@ type AccountsServer struct { // Update is the fake for method AccountsClient.Update // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, name string, properties armplaywrighttesting.AccountUpdate, options *armplaywrighttesting.AccountsClientUpdateOptions) (resp azfake.Responder[armplaywrighttesting.AccountsClientUpdateResponse], errResp azfake.ErrorResponder) + Update func(ctx context.Context, resourceGroupName string, accountName string, properties armplaywrighttesting.AccountUpdate, options *armplaywrighttesting.AccountsClientUpdateOptions) (resp azfake.Responder[armplaywrighttesting.AccountsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewAccountsServerTransport creates a new instance of AccountsServerTransport with the provided implementation. @@ -84,6 +88,8 @@ func (a *AccountsServerTransport) Do(req *http.Request) (*http.Response, error) var err error switch method { + case "AccountsClient.CheckNameAvailability": + resp, err = a.dispatchCheckNameAvailability(req) case "AccountsClient.BeginCreateOrUpdate": resp, err = a.dispatchBeginCreateOrUpdate(req) case "AccountsClient.BeginDelete": @@ -107,13 +113,42 @@ func (a *AccountsServerTransport) Do(req *http.Request) (*http.Response, error) return resp, nil } +func (a *AccountsServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { + if a.srv.CheckNameAvailability == nil { + return nil, &nonRetriableError{errors.New("fake for method CheckNameAvailability not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/checkNameAvailability` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armplaywrighttesting.CheckNameAvailabilityRequest](req) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.CheckNameAvailability(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CheckNameAvailabilityResponse, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (a *AccountsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { if a.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } beginCreateOrUpdate := a.beginCreateOrUpdate.get(req) if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 3 { @@ -127,11 +162,11 @@ func (a *AccountsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) if err != nil { return nil, err } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) if err != nil { return nil, err } - respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, nameParam, body, nil) + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, accountNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -161,7 +196,7 @@ func (a *AccountsServerTransport) dispatchBeginDelete(req *http.Request) (*http. } beginDelete := a.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 3 { @@ -171,11 +206,11 @@ func (a *AccountsServerTransport) dispatchBeginDelete(req *http.Request) (*http. if err != nil { return nil, err } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) if err != nil { return nil, err } - respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, nameParam, nil) + respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, accountNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -203,7 +238,7 @@ func (a *AccountsServerTransport) dispatchGet(req *http.Request) (*http.Response if a.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 3 { @@ -213,11 +248,11 @@ func (a *AccountsServerTransport) dispatchGet(req *http.Request) (*http.Response if err != nil { return nil, err } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) if err != nil { return nil, err } - respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, nameParam, nil) + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, accountNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -306,7 +341,7 @@ func (a *AccountsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo if a.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/accounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 3 { @@ -320,11 +355,11 @@ func (a *AccountsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo if err != nil { return nil, err } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) if err != nil { return nil, err } - respr, errRespr := a.srv.Update(req.Context(), resourceGroupNameParam, nameParam, body, nil) + respr, errRespr := a.srv.Update(req.Context(), resourceGroupNameParam, accountNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/quotas_server.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/quotas_server.go index d8ead07224bb..d21966504bf1 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/quotas_server.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/quotas_server.go @@ -26,7 +26,7 @@ import ( type QuotasServer struct { // Get is the fake for method QuotasClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, location string, name armplaywrighttesting.QuotaNames, options *armplaywrighttesting.QuotasClientGetOptions) (resp azfake.Responder[armplaywrighttesting.QuotasClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, location string, quotaName armplaywrighttesting.QuotaNames, options *armplaywrighttesting.QuotasClientGetOptions) (resp azfake.Responder[armplaywrighttesting.QuotasClientGetResponse], errResp azfake.ErrorResponder) // NewListBySubscriptionPager is the fake for method QuotasClient.NewListBySubscriptionPager // HTTP status codes to indicate success: http.StatusOK @@ -81,7 +81,7 @@ func (q *QuotasServerTransport) dispatchGet(req *http.Request) (*http.Response, if q.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/quotas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AzurePlaywrightService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/quotas/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 3 { @@ -91,7 +91,7 @@ func (q *QuotasServerTransport) dispatchGet(req *http.Request) (*http.Response, if err != nil { return nil, err } - nameParam, err := parseWithCast(matches[regex.SubexpIndex("name")], func(v string) (armplaywrighttesting.QuotaNames, error) { + quotaNameParam, err := parseWithCast(matches[regex.SubexpIndex("quotaName")], func(v string) (armplaywrighttesting.QuotaNames, error) { p, unescapeErr := url.PathUnescape(v) if unescapeErr != nil { return "", unescapeErr @@ -101,7 +101,7 @@ func (q *QuotasServerTransport) dispatchGet(req *http.Request) (*http.Response, if err != nil { return nil, err } - respr, errRespr := q.srv.Get(req.Context(), locationParam, nameParam, nil) + respr, errRespr := q.srv.Get(req.Context(), locationParam, quotaNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/server_factory.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/server_factory.go index 82fe881c4aee..cbfc3bbc6cd1 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/server_factory.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/server_factory.go @@ -19,9 +19,10 @@ import ( // ServerFactory is a fake server for instances of the armplaywrighttesting.ClientFactory type. type ServerFactory struct { - AccountsServer AccountsServer - OperationsServer OperationsServer - QuotasServer QuotasServer + AccountQuotasServer AccountQuotasServer + AccountsServer AccountsServer + OperationsServer OperationsServer + QuotasServer QuotasServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -36,11 +37,12 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armplaywrighttesting.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trAccountsServer *AccountsServerTransport - trOperationsServer *OperationsServerTransport - trQuotasServer *QuotasServerTransport + srv *ServerFactory + trMu sync.Mutex + trAccountQuotasServer *AccountQuotasServerTransport + trAccountsServer *AccountsServerTransport + trOperationsServer *OperationsServerTransport + trQuotasServer *QuotasServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -56,6 +58,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { + case "AccountQuotasClient": + initServer(s, &s.trAccountQuotasServer, func() *AccountQuotasServerTransport { + return NewAccountQuotasServerTransport(&s.srv.AccountQuotasServer) + }) + resp, err = s.trAccountQuotasServer.Do(req) case "AccountsClient": initServer(s, &s.trAccountsServer, func() *AccountsServerTransport { return NewAccountsServerTransport(&s.srv.AccountsServer) }) resp, err = s.trAccountsServer.Do(req) diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/time_rfc3339.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/time_rfc3339.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.mod b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.mod index 977d18be0a72..57023246b343 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.mod +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/playwrighttesting/a go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.sum b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.sum +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models.go index 1b0bfe8a05e6..eb0c53420b88 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models.go @@ -10,7 +10,7 @@ package armplaywrighttesting import "time" -// Account - An account resource +// Account - A Playwright service account resource. type Account struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -21,7 +21,7 @@ type Account struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -34,6 +34,24 @@ type Account struct { Type *string } +// AccountFreeTrialProperties - The Playwright service account quota resource free-trial properties. +type AccountFreeTrialProperties struct { + // READ-ONLY; The free-trial allocated limit value eg. allocated free minutes. + AllocatedValue *int32 + + // READ-ONLY; The free-trial createdAt utcDateTime. + CreatedAt *time.Time + + // READ-ONLY; The free-trial expiryAt utcDateTime. + ExpiryAt *time.Time + + // READ-ONLY; The free-trial percentage used. + PercentageUsed *float32 + + // READ-ONLY; The free-trial used value eg. used free minutes. + UsedValue *int32 +} + // AccountListResult - The response of a Account list operation. type AccountListResult struct { // REQUIRED; The Account items on this page @@ -43,7 +61,7 @@ type AccountListResult struct { NextLink *string } -// AccountProperties - Account properties +// AccountProperties - Account resource properties. type AccountProperties struct { // This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect // to browsers in the closest Azure region, ensuring lower latency. If @@ -66,9 +84,45 @@ type AccountProperties struct { ProvisioningState *ProvisioningState } +// AccountQuota - A quota resource for a Playwright service account. +type AccountQuota struct { + // The resource-specific properties for this resource. + Properties *AccountQuotaProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AccountQuotaListResult - The response of a AccountQuota list operation. +type AccountQuotaListResult struct { + // REQUIRED; The AccountQuota items on this page + Value []*AccountQuota + + // The link to the next page of items + NextLink *string +} + +// AccountQuotaProperties - The Playwright service account quota resource properties. +type AccountQuotaProperties struct { + // The Playwright service account quota resource free-trial properties. + FreeTrial *AccountFreeTrialProperties + + // READ-ONLY; The status of the last operation. + ProvisioningState *ProvisioningState +} + // AccountUpdate - The type used for update operations of the Account. type AccountUpdate struct { - // The updatable properties of the Account. + // The resource-specific properties for this resource. Properties *AccountUpdateProperties // Resource tags. @@ -92,28 +146,34 @@ type AccountUpdateProperties struct { ScalableExecution *EnablementStatus } -// FreeTrialProperties - The free-trial properties -type FreeTrialProperties struct { - // READ-ONLY; The playwright account id. - AccountID *string +// CheckNameAvailabilityRequest - The check availability request body. +type CheckNameAvailabilityRequest struct { + // The name of the resource for which availability needs to be checked. + Name *string - // READ-ONLY; The free-trial allocated limit value eg. allocated free minutes. - AllocatedValue *int32 + // The resource type. + Type *string +} - // READ-ONLY; The free-trial createdAt utcDateTime. - CreatedAt *time.Time +// CheckNameAvailabilityResponse - The check availability result. +type CheckNameAvailabilityResponse struct { + // Detailed reason why the given name is available. + Message *string - // READ-ONLY; The free-trial expiryAt utcDateTime. - ExpiryAt *time.Time + // Indicates if the resource name is available. + NameAvailable *bool - // READ-ONLY; The free-trial percentage used. - PercentageUsed *float64 + // The reason why the given name is not available. + Reason *CheckNameAvailabilityReason +} + +// FreeTrialProperties - The subscription quota resource free-trial properties. +type FreeTrialProperties struct { + // READ-ONLY; The Playwright service account id. + AccountID *string // READ-ONLY; The free-trial state. State *FreeTrialState - - // READ-ONLY; The free-trial used value eg. used free minutes. - UsedValue *int32 } // Operation - Details of a REST API operation, returned from the Resource Provider Operations API @@ -165,12 +225,12 @@ type OperationListResult struct { Value []*Operation } -// Quota - A quota resource +// Quota - A subscription quota resource. type Quota struct { // The resource-specific properties for this resource. Properties *QuotaProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -192,9 +252,9 @@ type QuotaListResult struct { NextLink *string } -// QuotaProperties - Quota properties +// QuotaProperties - The subscription quota resource properties. type QuotaProperties struct { - // The free-trial quota. + // The subscription quota resource free-trial properties. FreeTrial *FreeTrialProperties // READ-ONLY; The status of the last operation. diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models_serde.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models_serde.go index 9a4988b764c5..29cf053ed521 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models_serde.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/models_serde.go @@ -66,6 +66,49 @@ func (a *Account) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AccountFreeTrialProperties. +func (a AccountFreeTrialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocatedValue", a.AllocatedValue) + populateDateTimeRFC3339(objectMap, "createdAt", a.CreatedAt) + populateDateTimeRFC3339(objectMap, "expiryAt", a.ExpiryAt) + populate(objectMap, "percentageUsed", a.PercentageUsed) + populate(objectMap, "usedValue", a.UsedValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountFreeTrialProperties. +func (a *AccountFreeTrialProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allocatedValue": + err = unpopulate(val, "AllocatedValue", &a.AllocatedValue) + delete(rawMsg, key) + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &a.CreatedAt) + delete(rawMsg, key) + case "expiryAt": + err = unpopulateDateTimeRFC3339(val, "ExpiryAt", &a.ExpiryAt) + delete(rawMsg, key) + case "percentageUsed": + err = unpopulate(val, "PercentageUsed", &a.PercentageUsed) + delete(rawMsg, key) + case "usedValue": + err = unpopulate(val, "UsedValue", &a.UsedValue) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AccountListResult. func (a AccountListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -140,6 +183,111 @@ func (a *AccountProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AccountQuota. +func (a AccountQuota) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountQuota. +func (a *AccountQuota) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountQuotaListResult. +func (a AccountQuotaListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountQuotaListResult. +func (a *AccountQuotaListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountQuotaProperties. +func (a AccountQuotaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "freeTrial", a.FreeTrial) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountQuotaProperties. +func (a *AccountQuotaProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "freeTrial": + err = unpopulate(val, "FreeTrial", &a.FreeTrial) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AccountUpdate. func (a AccountUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -206,16 +354,77 @@ func (a *AccountUpdateProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. +func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. +func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse. +func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse. +func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FreeTrialProperties. func (f FreeTrialProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "accountId", f.AccountID) - populate(objectMap, "allocatedValue", f.AllocatedValue) - populateDateTimeRFC3339(objectMap, "createdAt", f.CreatedAt) - populateDateTimeRFC3339(objectMap, "expiryAt", f.ExpiryAt) - populate(objectMap, "percentageUsed", f.PercentageUsed) populate(objectMap, "state", f.State) - populate(objectMap, "usedValue", f.UsedValue) return json.Marshal(objectMap) } @@ -231,24 +440,9 @@ func (f *FreeTrialProperties) UnmarshalJSON(data []byte) error { case "accountId": err = unpopulate(val, "AccountID", &f.AccountID) delete(rawMsg, key) - case "allocatedValue": - err = unpopulate(val, "AllocatedValue", &f.AllocatedValue) - delete(rawMsg, key) - case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &f.CreatedAt) - delete(rawMsg, key) - case "expiryAt": - err = unpopulateDateTimeRFC3339(val, "ExpiryAt", &f.ExpiryAt) - delete(rawMsg, key) - case "percentageUsed": - err = unpopulate(val, "PercentageUsed", &f.PercentageUsed) - delete(rawMsg, key) case "state": err = unpopulate(val, "State", &f.State) delete(rawMsg, key) - case "usedValue": - err = unpopulate(val, "UsedValue", &f.UsedValue) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) @@ -533,7 +727,7 @@ func populate(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client.go index 9fd90a013fb9..ae896087f505 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client_example_test.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client_example_test.go deleted file mode 100644 index 67476c07edf5..000000000000 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/operations_client_example_test.go +++ /dev/null @@ -1,76 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armplaywrighttesting_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/playwrighttesting/armplaywrighttesting" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armplaywrighttesting.OperationListResult{ - // Value: []*armplaywrighttesting.Operation{ - // { - // Name: to.Ptr("Microsoft.AzurePlaywrightService/accounts/Write"), - // Display: &armplaywrighttesting.OperationDisplay{ - // Description: to.Ptr("Set PlaywrightAccounts"), - // Operation: to.Ptr("Creates or updates the PlaywrightAccounts"), - // Provider: to.Ptr("Microsoft.AzurePlaywrightService"), - // Resource: to.Ptr("accounts"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzurePlaywrightService/accounts/Delete"), - // Display: &armplaywrighttesting.OperationDisplay{ - // Description: to.Ptr("Delete PlaywrightAccounts"), - // Operation: to.Ptr("Deletes the PlaywrightAccounts"), - // Provider: to.Ptr("Microsoft.AzurePlaywrightService"), - // Resource: to.Ptr("accounts"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzurePlaywrightService/accounts/Read"), - // Display: &armplaywrighttesting.OperationDisplay{ - // Description: to.Ptr("Read PlaywrightAccounts"), - // Operation: to.Ptr("Reads the PlaywrightAccounts"), - // Provider: to.Ptr("Microsoft.AzurePlaywrightService"), - // Resource: to.Ptr("accounts"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/options.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/options.go index 7bbd42677d27..44020bef05cb 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/options.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/options.go @@ -8,6 +8,17 @@ package armplaywrighttesting +// AccountQuotasClientGetOptions contains the optional parameters for the AccountQuotasClient.Get method. +type AccountQuotasClientGetOptions struct { + // placeholder for future optional parameters +} + +// AccountQuotasClientListByAccountOptions contains the optional parameters for the AccountQuotasClient.NewListByAccountPager +// method. +type AccountQuotasClientListByAccountOptions struct { + // placeholder for future optional parameters +} + // AccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the AccountsClient.BeginCreateOrUpdate method. type AccountsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. @@ -20,6 +31,12 @@ type AccountsClientBeginDeleteOptions struct { ResumeToken string } +// AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability +// method. +type AccountsClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + // AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. type AccountsClientGetOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client.go index 0386179ca411..5c5a7b7b46a8 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client.go @@ -28,7 +28,7 @@ type QuotasClient struct { } // NewQuotasClient creates a new instance of QuotasClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewQuotasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotasClient, error) { @@ -43,20 +43,20 @@ func NewQuotasClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } -// Get - Get quota by name. +// Get - Get subscription quota by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - location - The location of quota in ARM Normalized format like eastus, southeastasia etc. -// - name - The quota name. +// - quotaName - The quota name. // - options - QuotasClientGetOptions contains the optional parameters for the QuotasClient.Get method. -func (client *QuotasClient) Get(ctx context.Context, location string, name QuotaNames, options *QuotasClientGetOptions) (QuotasClientGetResponse, error) { +func (client *QuotasClient) Get(ctx context.Context, location string, quotaName QuotaNames, options *QuotasClientGetOptions) (QuotasClientGetResponse, error) { var err error const operationName = "QuotasClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, name, options) + req, err := client.getCreateRequest(ctx, location, quotaName, options) if err != nil { return QuotasClientGetResponse{}, err } @@ -73,8 +73,8 @@ func (client *QuotasClient) Get(ctx context.Context, location string, name Quota } // getCreateRequest creates the Get request. -func (client *QuotasClient) getCreateRequest(ctx context.Context, location string, name QuotaNames, options *QuotasClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name}" +func (client *QuotasClient) getCreateRequest(ctx context.Context, location string, quotaName QuotaNames, options *QuotasClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -83,16 +83,16 @@ func (client *QuotasClient) getCreateRequest(ctx context.Context, location strin return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") + if quotaName == "" { + return nil, errors.New("parameter quotaName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(string(name))) + urlPath = strings.ReplaceAll(urlPath, "{quotaName}", url.PathEscape(string(quotaName))) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *QuotasClient) getHandleResponse(resp *http.Response) (QuotasClient // NewListBySubscriptionPager - List quotas for a given subscription Id. // -// Generated from API version 2023-10-01-preview +// Generated from API version 2024-02-01-preview // - location - The location of quota in ARM Normalized format like eastus, southeastasia etc. // - options - QuotasClientListBySubscriptionOptions contains the optional parameters for the QuotasClient.NewListBySubscriptionPager // method. @@ -152,7 +152,7 @@ func (client *QuotasClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-01-preview") + reqQP.Set("api-version", "2024-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client_example_test.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client_example_test.go deleted file mode 100644 index a4258393d89c..000000000000 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/quotas_client_example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armplaywrighttesting_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/playwrighttesting/armplaywrighttesting" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json -func ExampleQuotasClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQuotasClient().NewListBySubscriptionPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.QuotaListResult = armplaywrighttesting.QuotaListResult{ - // Value: []*armplaywrighttesting.Quota{ - // { - // Name: to.Ptr("ScalableExecution"), - // Type: to.Ptr("Microsoft.AzurePlaywrightService/Locations/Quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzurePlaywrightService/locations/eastus/quotas/ScalableExecution"), - // Properties: &armplaywrighttesting.QuotaProperties{ - // FreeTrial: &armplaywrighttesting.FreeTrialProperties{ - // AccountID: to.Ptr("3fa85f64-5717-4562-b3fc-2c963f66afa6"), - // AllocatedValue: to.Ptr[int32](0), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-31T10:19:36.081Z"); return t}()), - // ExpiryAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-31T10:19:36.081Z"); return t}()), - // PercentageUsed: to.Ptr[float64](100), - // State: to.Ptr(armplaywrighttesting.FreeTrialStateActive), - // UsedValue: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armplaywrighttesting.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3eb9ec8e9c8f717c6b461c4c0f49a4662fb948fd/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json -func ExampleQuotasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armplaywrighttesting.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQuotasClient().Get(ctx, "eastus", armplaywrighttesting.QuotaNamesScalableExecution, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Quota = armplaywrighttesting.Quota{ - // Name: to.Ptr("ScalableExecution"), - // Type: to.Ptr("Microsoft.AzurePlaywrightService/Locations/Quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzurePlaywrightService/locations/eastus/quotas/ScalableExecution"), - // Properties: &armplaywrighttesting.QuotaProperties{ - // FreeTrial: &armplaywrighttesting.FreeTrialProperties{ - // AccountID: to.Ptr("3fa85f64-5717-4562-b3fc-2c963f66afa6"), - // AllocatedValue: to.Ptr[int32](0), - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-31T10:19:36.081Z"); return t}()), - // ExpiryAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-31T10:19:36.081Z"); return t}()), - // PercentageUsed: to.Ptr[float64](100), - // State: to.Ptr(armplaywrighttesting.FreeTrialStateActive), - // UsedValue: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armplaywrighttesting.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/response_types.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/responses.go similarity index 71% rename from sdk/resourcemanager/playwrighttesting/armplaywrighttesting/response_types.go rename to sdk/resourcemanager/playwrighttesting/armplaywrighttesting/responses.go index 648af84beb18..66f882cdd186 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/response_types.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/responses.go @@ -8,9 +8,27 @@ package armplaywrighttesting +// AccountQuotasClientGetResponse contains the response from method AccountQuotasClient.Get. +type AccountQuotasClientGetResponse struct { + // A quota resource for a Playwright service account. + AccountQuota +} + +// AccountQuotasClientListByAccountResponse contains the response from method AccountQuotasClient.NewListByAccountPager. +type AccountQuotasClientListByAccountResponse struct { + // The response of a AccountQuota list operation. + AccountQuotaListResult +} + +// AccountsClientCheckNameAvailabilityResponse contains the response from method AccountsClient.CheckNameAvailability. +type AccountsClientCheckNameAvailabilityResponse struct { + // The check availability result. + CheckNameAvailabilityResponse +} + // AccountsClientCreateOrUpdateResponse contains the response from method AccountsClient.BeginCreateOrUpdate. type AccountsClientCreateOrUpdateResponse struct { - // An account resource + // A Playwright service account resource. Account } @@ -21,7 +39,7 @@ type AccountsClientDeleteResponse struct { // AccountsClientGetResponse contains the response from method AccountsClient.Get. type AccountsClientGetResponse struct { - // An account resource + // A Playwright service account resource. Account } @@ -39,7 +57,7 @@ type AccountsClientListBySubscriptionResponse struct { // AccountsClientUpdateResponse contains the response from method AccountsClient.Update. type AccountsClientUpdateResponse struct { - // An account resource + // A Playwright service account resource. Account } @@ -51,7 +69,7 @@ type OperationsClientListResponse struct { // QuotasClientGetResponse contains the response from method QuotasClient.Get. type QuotasClientGetResponse struct { - // A quota resource + // A subscription quota resource. Quota } diff --git a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/time_rfc3339.go b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/time_rfc3339.go index 5d2bdbbbc83c..8b01a8334f23 100644 --- a/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/time_rfc3339.go +++ b/sdk/resourcemanager/playwrighttesting/armplaywrighttesting/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/portal/armportal/CHANGELOG.md b/sdk/resourcemanager/portal/armportal/CHANGELOG.md index fd3d8aefbb26..85be5ba5d30a 100644 --- a/sdk/resourcemanager/portal/armportal/CHANGELOG.md +++ b/sdk/resourcemanager/portal/armportal/CHANGELOG.md @@ -1,5 +1,54 @@ # Release History +## 0.8.0 (2024-08-27) +### Breaking Changes + +- Function `*TenantConfigurationsClient.Create` parameter(s) have been changed from `(context.Context, ConfigurationName, Configuration, *TenantConfigurationsClientCreateOptions)` to `(context.Context, string, Configuration, *TenantConfigurationsClientCreateOptions)` +- Function `*TenantConfigurationsClient.Delete` parameter(s) have been changed from `(context.Context, ConfigurationName, *TenantConfigurationsClientDeleteOptions)` to `(context.Context, string, *TenantConfigurationsClientDeleteOptions)` +- Function `*TenantConfigurationsClient.Get` parameter(s) have been changed from `(context.Context, ConfigurationName, *TenantConfigurationsClientGetOptions)` to `(context.Context, string, *TenantConfigurationsClientGetOptions)` +- Type of `Dashboard.Properties` has been changed from `*DashboardProperties` to `*DashboardPropertiesWithProvisioningState` +- Type of `DashboardPartMetadata.Type` has been changed from `*string` to `*DashboardPartMetadataType` +- Type of `ErrorResponse.Error` has been changed from `*ErrorDefinition` to `*ErrorDetail` +- Type of `MarkdownPartMetadata.Type` has been changed from `*string` to `*DashboardPartMetadataType` +- Enum `ConfigurationName` has been removed +- Struct `ConfigurationList` has been removed +- Struct `ErrorDefinition` has been removed +- Struct `ResourceProviderOperation` has been removed +- Struct `ResourceProviderOperationDisplay` has been removed +- Struct `ResourceProviderOperationList` has been removed +- Field `AdditionalProperties` of struct `DashboardPartMetadata` has been removed +- Field `AdditionalProperties` of struct `MarkdownPartMetadata` has been removed +- Field `ResourceProviderOperationList` of struct `OperationsClientListResponse` has been removed +- Field `ConfigurationList` of struct `TenantConfigurationsClientListResponse` has been removed + +### Features Added + +- Type of `DashboardLens.Metadata` has been changed from `map[string]any` to `any` +- Type of `DashboardPartsPosition.Metadata` has been changed from `map[string]any` to `any` +- Type of `DashboardProperties.Metadata` has been changed from `map[string]any` to `any` +- New enum type `ActionType` with values `ActionTypeInternal` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `DashboardPartMetadataType` with values `DashboardPartMetadataTypeMarkdown` +- New enum type `Origin` with values `OriginSystem`, `OriginUser`, `OriginUserSystem` +- New enum type `ResourceProvisioningState` with values `ResourceProvisioningStateCanceled`, `ResourceProvisioningStateFailed`, `ResourceProvisioningStateSucceeded` +- New struct `ConfigurationListResult` +- New struct `DashboardPropertiesWithProvisioningState` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `Operation` +- New struct `OperationDisplay` +- New struct `OperationListResult` +- New struct `SystemData` +- New struct `TrackedResource` +- New field `SystemData` in struct `Configuration` +- New field `ProvisioningState` in struct `ConfigurationProperties` +- New field `SystemData` in struct `Dashboard` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `SystemData` in struct `ProxyResource` +- New field `SystemData` in struct `Resource` +- New anonymous field `ConfigurationListResult` in struct `TenantConfigurationsClientListResponse` + + ## 0.7.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/portal/armportal/autorest.md b/sdk/resourcemanager/portal/armportal/autorest.md index 2b608d557b35..a0e6d26cfebd 100644 --- a/sdk/resourcemanager/portal/armportal/autorest.md +++ b/sdk/resourcemanager/portal/armportal/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/portal/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/portal/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.7.0 +module-version: 0.8.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/portal/armportal/client_factory.go b/sdk/resourcemanager/portal/armportal/client_factory.go index 535bca560988..24bcebeb848b 100644 --- a/sdk/resourcemanager/portal/armportal/client_factory.go +++ b/sdk/resourcemanager/portal/armportal/client_factory.go @@ -17,46 +17,50 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewDashboardsClient creates a new instance of DashboardsClient. func (c *ClientFactory) NewDashboardsClient() *DashboardsClient { - subClient, _ := NewDashboardsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DashboardsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewListTenantConfigurationViolationsClient creates a new instance of ListTenantConfigurationViolationsClient. func (c *ClientFactory) NewListTenantConfigurationViolationsClient() *ListTenantConfigurationViolationsClient { - subClient, _ := NewListTenantConfigurationViolationsClient(c.credential, c.options) - return subClient + return &ListTenantConfigurationViolationsClient{ + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewTenantConfigurationsClient creates a new instance of TenantConfigurationsClient. func (c *ClientFactory) NewTenantConfigurationsClient() *TenantConfigurationsClient { - subClient, _ := NewTenantConfigurationsClient(c.credential, c.options) - return subClient + return &TenantConfigurationsClient{ + internal: c.internal, + } } diff --git a/sdk/resourcemanager/portal/armportal/constants.go b/sdk/resourcemanager/portal/armportal/constants.go index 5db91be60e6d..d056e5e7aa70 100644 --- a/sdk/resourcemanager/portal/armportal/constants.go +++ b/sdk/resourcemanager/portal/armportal/constants.go @@ -10,18 +10,94 @@ package armportal const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal" - moduleVersion = "v0.7.0" + moduleVersion = "v0.8.0" ) -type ConfigurationName string +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string const ( - ConfigurationNameDefault ConfigurationName = "default" + ActionTypeInternal ActionType = "Internal" ) -// PossibleConfigurationNameValues returns the possible values for the ConfigurationName const type. -func PossibleConfigurationNameValues() []ConfigurationName { - return []ConfigurationName{ - ConfigurationNameDefault, +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// DashboardPartMetadataType - The dashboard part metadata type. +type DashboardPartMetadataType string + +const ( + // DashboardPartMetadataTypeMarkdown - The markdown part type. + DashboardPartMetadataTypeMarkdown DashboardPartMetadataType = "Extension/HubsExtension/PartType/MarkdownPart" +) + +// PossibleDashboardPartMetadataTypeValues returns the possible values for the DashboardPartMetadataType const type. +func PossibleDashboardPartMetadataTypeValues() []DashboardPartMetadataType { + return []DashboardPartMetadataType{ + DashboardPartMetadataTypeMarkdown, + } +} + +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + +// ResourceProvisioningState - The provisioning state of a resource type. +type ResourceProvisioningState string + +const ( + // ResourceProvisioningStateCanceled - Resource creation was canceled. + ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled" + // ResourceProvisioningStateFailed - Resource creation failed. + ResourceProvisioningStateFailed ResourceProvisioningState = "Failed" + // ResourceProvisioningStateSucceeded - Resource has been created. + ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded" +) + +// PossibleResourceProvisioningStateValues returns the possible values for the ResourceProvisioningState const type. +func PossibleResourceProvisioningStateValues() []ResourceProvisioningState { + return []ResourceProvisioningState{ + ResourceProvisioningStateCanceled, + ResourceProvisioningStateFailed, + ResourceProvisioningStateSucceeded, } } diff --git a/sdk/resourcemanager/portal/armportal/dashboards_client.go b/sdk/resourcemanager/portal/armportal/dashboards_client.go index 21ef6a2d0198..93583486c329 100644 --- a/sdk/resourcemanager/portal/armportal/dashboards_client.go +++ b/sdk/resourcemanager/portal/armportal/dashboards_client.go @@ -28,7 +28,7 @@ type DashboardsClient struct { } // NewDashboardsClient creates a new instance of DashboardsClient with the specified values. -// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDashboardsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DashboardsClient, error) { @@ -46,19 +46,19 @@ func NewDashboardsClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates a Dashboard. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-12-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - dashboardName - The name of the dashboard. -// - dashboard - The parameters required to create or update a dashboard. +// - resource - The parameters required to create or update a dashboard. // - options - DashboardsClientCreateOrUpdateOptions contains the optional parameters for the DashboardsClient.CreateOrUpdate // method. -func (client *DashboardsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dashboardName string, dashboard Dashboard, options *DashboardsClientCreateOrUpdateOptions) (DashboardsClientCreateOrUpdateResponse, error) { +func (client *DashboardsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dashboardName string, resource Dashboard, options *DashboardsClientCreateOrUpdateOptions) (DashboardsClientCreateOrUpdateResponse, error) { var err error const operationName = "DashboardsClient.CreateOrUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dashboardName, dashboard, options) + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dashboardName, resource, options) if err != nil { return DashboardsClientCreateOrUpdateResponse{}, err } @@ -75,7 +75,7 @@ func (client *DashboardsClient) CreateOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DashboardsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, dashboardName string, dashboard Dashboard, options *DashboardsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DashboardsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, dashboardName string, resource Dashboard, options *DashboardsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,10 +94,10 @@ func (client *DashboardsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, dashboard); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil @@ -115,8 +115,8 @@ func (client *DashboardsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the Dashboard. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-12-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - dashboardName - The name of the dashboard. // - options - DashboardsClientDeleteOptions contains the optional parameters for the DashboardsClient.Delete method. func (client *DashboardsClient) Delete(ctx context.Context, resourceGroupName string, dashboardName string, options *DashboardsClientDeleteOptions) (DashboardsClientDeleteResponse, error) { @@ -160,7 +160,7 @@ func (client *DashboardsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,8 +169,8 @@ func (client *DashboardsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the Dashboard. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-12-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - dashboardName - The name of the dashboard. // - options - DashboardsClientGetOptions contains the optional parameters for the DashboardsClient.Get method. func (client *DashboardsClient) Get(ctx context.Context, resourceGroupName string, dashboardName string, options *DashboardsClientGetOptions) (DashboardsClientGetResponse, error) { @@ -187,7 +187,7 @@ func (client *DashboardsClient) Get(ctx context.Context, resourceGroupName strin if err != nil { return DashboardsClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNotFound) { + if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) return DashboardsClientGetResponse{}, err } @@ -215,7 +215,7 @@ func (client *DashboardsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,8 +232,8 @@ func (client *DashboardsClient) getHandleResponse(resp *http.Response) (Dashboar // NewListByResourceGroupPager - Gets all the Dashboards within a resource group. // -// Generated from API version 2020-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-12-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - DashboardsClientListByResourceGroupOptions contains the optional parameters for the DashboardsClient.NewListByResourceGroupPager // method. func (client *DashboardsClient) NewListByResourceGroupPager(resourceGroupName string, options *DashboardsClientListByResourceGroupOptions) *runtime.Pager[DashboardsClientListByResourceGroupResponse] { @@ -275,7 +275,7 @@ func (client *DashboardsClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +292,7 @@ func (client *DashboardsClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Gets all the dashboards within a subscription. // -// Generated from API version 2020-09-01-preview +// Generated from API version 2022-12-01-preview // - options - DashboardsClientListBySubscriptionOptions contains the optional parameters for the DashboardsClient.NewListBySubscriptionPager // method. func (client *DashboardsClient) NewListBySubscriptionPager(options *DashboardsClientListBySubscriptionOptions) *runtime.Pager[DashboardsClientListBySubscriptionResponse] { @@ -330,7 +330,7 @@ func (client *DashboardsClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,18 +348,18 @@ func (client *DashboardsClient) listBySubscriptionHandleResponse(resp *http.Resp // Update - Updates an existing Dashboard. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-12-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - dashboardName - The name of the dashboard. -// - dashboard - The updatable fields of a Dashboard. +// - properties - The updatable fields of a Dashboard. // - options - DashboardsClientUpdateOptions contains the optional parameters for the DashboardsClient.Update method. -func (client *DashboardsClient) Update(ctx context.Context, resourceGroupName string, dashboardName string, dashboard PatchableDashboard, options *DashboardsClientUpdateOptions) (DashboardsClientUpdateResponse, error) { +func (client *DashboardsClient) Update(ctx context.Context, resourceGroupName string, dashboardName string, properties PatchableDashboard, options *DashboardsClientUpdateOptions) (DashboardsClientUpdateResponse, error) { var err error const operationName = "DashboardsClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, dashboardName, dashboard, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, dashboardName, properties, options) if err != nil { return DashboardsClientUpdateResponse{}, err } @@ -367,7 +367,7 @@ func (client *DashboardsClient) Update(ctx context.Context, resourceGroupName st if err != nil { return DashboardsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNotFound) { + if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) return DashboardsClientUpdateResponse{}, err } @@ -376,7 +376,7 @@ func (client *DashboardsClient) Update(ctx context.Context, resourceGroupName st } // updateCreateRequest creates the Update request. -func (client *DashboardsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, dashboardName string, dashboard PatchableDashboard, options *DashboardsClientUpdateOptions) (*policy.Request, error) { +func (client *DashboardsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, dashboardName string, properties PatchableDashboard, options *DashboardsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -395,10 +395,10 @@ func (client *DashboardsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, dashboard); err != nil { + if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } return req, nil diff --git a/sdk/resourcemanager/portal/armportal/dashboards_client_example_test.go b/sdk/resourcemanager/portal/armportal/dashboards_client_example_test.go deleted file mode 100644 index bd23748ecf7f..000000000000 --- a/sdk/resourcemanager/portal/armportal/dashboards_client_example_test.go +++ /dev/null @@ -1,520 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armportal_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/createOrUpdateDashboard.json -func ExampleDashboardsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDashboardsClient().CreateOrUpdate(ctx, "testRG", "testDashboard", armportal.Dashboard{ - Location: to.Ptr("eastus"), - Properties: &armportal.DashboardProperties{ - Lenses: []*armportal.DashboardLens{ - { - Order: to.Ptr[int32](1), - Parts: []*armportal.DashboardParts{ - { - Position: &armportal.DashboardPartsPosition{ - ColSpan: to.Ptr[int32](3), - RowSpan: to.Ptr[int32](4), - X: to.Ptr[int32](1), - Y: to.Ptr[int32](2), - }, - }, - { - Position: &armportal.DashboardPartsPosition{ - ColSpan: to.Ptr[int32](6), - RowSpan: to.Ptr[int32](6), - X: to.Ptr[int32](5), - Y: to.Ptr[int32](5), - }, - }}, - }, - { - Order: to.Ptr[int32](2), - Parts: []*armportal.DashboardParts{}, - }}, - Metadata: map[string]any{ - "metadata": map[string]any{ - "ColSpan": float64(2), - "RowSpan": float64(1), - "X": float64(4), - "Y": float64(3), - }, - }, - }, - Tags: map[string]*string{ - "aKey": to.Ptr("aValue"), - "anotherKey": to.Ptr("anotherValue"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Dashboard = armportal.Dashboard{ - // Name: to.Ptr("testDashboard"), - // Type: to.Ptr("Microsoft.Portal/dashboards"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"), - // Location: to.Ptr("eastus"), - // Properties: &armportal.DashboardProperties{ - // Lenses: []*armportal.DashboardLens{ - // { - // Order: to.Ptr[int32](1), - // Parts: []*armportal.DashboardParts{ - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](3), - // RowSpan: to.Ptr[int32](4), - // X: to.Ptr[int32](1), - // Y: to.Ptr[int32](2), - // }, - // }, - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](6), - // RowSpan: to.Ptr[int32](6), - // X: to.Ptr[int32](5), - // Y: to.Ptr[int32](5), - // }, - // }}, - // }, - // { - // Order: to.Ptr[int32](2), - // Parts: []*armportal.DashboardParts{ - // }, - // }}, - // Metadata: map[string]any{ - // "metadata": map[string]any{ - // "ColSpan": float64(2), - // "RowSpan": float64(1), - // "X": float64(4), - // "Y": float64(3), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "aKey": to.Ptr("aValue"), - // "anotherKey": to.Ptr("anotherValue"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/deleteDashboard.json -func ExampleDashboardsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDashboardsClient().Delete(ctx, "testRG", "testDashboard", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/getDashboard.json -func ExampleDashboardsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDashboardsClient().Get(ctx, "testRG", "testDashboard", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Dashboard = armportal.Dashboard{ - // Name: to.Ptr("testDashboard"), - // Type: to.Ptr("Microsoft.Portal/dashboards"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"), - // Location: to.Ptr("eastus"), - // Properties: &armportal.DashboardProperties{ - // Lenses: []*armportal.DashboardLens{ - // { - // Order: to.Ptr[int32](1), - // Parts: []*armportal.DashboardParts{ - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](3), - // RowSpan: to.Ptr[int32](4), - // X: to.Ptr[int32](1), - // Y: to.Ptr[int32](2), - // }, - // }, - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](6), - // RowSpan: to.Ptr[int32](6), - // X: to.Ptr[int32](5), - // Y: to.Ptr[int32](5), - // }, - // }}, - // }, - // { - // Order: to.Ptr[int32](2), - // Parts: []*armportal.DashboardParts{ - // }, - // }}, - // Metadata: map[string]any{ - // "metadata": map[string]any{ - // "ColSpan": float64(2), - // "RowSpan": float64(1), - // "X": float64(4), - // "Y": float64(3), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "aKey": to.Ptr("aValue"), - // "anotherKey": to.Ptr("anotherValue"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/updateDashboard.json -func ExampleDashboardsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDashboardsClient().Update(ctx, "testRG", "testDashboard", armportal.PatchableDashboard{ - Tags: map[string]*string{ - "aKey": to.Ptr("bValue"), - "anotherKey": to.Ptr("anotherValue2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Dashboard = armportal.Dashboard{ - // Name: to.Ptr("testDashboard"), - // Type: to.Ptr("Microsoft.Portal/dashboards"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"), - // Location: to.Ptr("eastus"), - // Properties: &armportal.DashboardProperties{ - // Lenses: []*armportal.DashboardLens{ - // { - // Order: to.Ptr[int32](1), - // Parts: []*armportal.DashboardParts{ - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](3), - // RowSpan: to.Ptr[int32](4), - // X: to.Ptr[int32](1), - // Y: to.Ptr[int32](2), - // }, - // }, - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](6), - // RowSpan: to.Ptr[int32](6), - // X: to.Ptr[int32](5), - // Y: to.Ptr[int32](5), - // }, - // }}, - // }, - // { - // Order: to.Ptr[int32](2), - // Parts: []*armportal.DashboardParts{ - // }, - // }}, - // Metadata: map[string]any{ - // "metadata": map[string]any{ - // "ColSpan": float64(2), - // "RowSpan": float64(1), - // "X": float64(4), - // "Y": float64(3), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "aKey": to.Ptr("bValue"), - // "anotherKey": to.Ptr("anotherValue2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/listDashboardsByResourceGroup.json -func ExampleDashboardsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDashboardsClient().NewListByResourceGroupPager("testRG", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DashboardListResult = armportal.DashboardListResult{ - // Value: []*armportal.Dashboard{ - // { - // Name: to.Ptr("testDashboard"), - // Type: to.Ptr("Microsoft.Portal/dashboards"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"), - // Location: to.Ptr("eastus"), - // Properties: &armportal.DashboardProperties{ - // Lenses: []*armportal.DashboardLens{ - // { - // Order: to.Ptr[int32](1), - // Parts: []*armportal.DashboardParts{ - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](3), - // RowSpan: to.Ptr[int32](4), - // X: to.Ptr[int32](1), - // Y: to.Ptr[int32](2), - // }, - // }, - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](6), - // RowSpan: to.Ptr[int32](6), - // X: to.Ptr[int32](5), - // Y: to.Ptr[int32](5), - // }, - // }}, - // }, - // { - // Order: to.Ptr[int32](2), - // Parts: []*armportal.DashboardParts{ - // }, - // }}, - // Metadata: map[string]any{ - // "metadata": map[string]any{ - // "ColSpan": float64(2), - // "RowSpan": float64(1), - // "X": float64(4), - // "Y": float64(3), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "aKey": to.Ptr("aValue"), - // "anotherKey": to.Ptr("anotherValue"), - // }, - // }, - // { - // Name: to.Ptr("testDashboard2"), - // Type: to.Ptr("Microsoft.Portal/dashboards"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard2"), - // Location: to.Ptr("eastus"), - // Properties: &armportal.DashboardProperties{ - // Lenses: []*armportal.DashboardLens{ - // { - // Order: to.Ptr[int32](1), - // Parts: []*armportal.DashboardParts{ - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](3), - // RowSpan: to.Ptr[int32](4), - // X: to.Ptr[int32](1), - // Y: to.Ptr[int32](2), - // }, - // }, - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](6), - // RowSpan: to.Ptr[int32](6), - // X: to.Ptr[int32](5), - // Y: to.Ptr[int32](5), - // }, - // }}, - // }, - // { - // Order: to.Ptr[int32](2), - // Parts: []*armportal.DashboardParts{ - // }, - // }}, - // Metadata: map[string]any{ - // "metadata": map[string]any{ - // "ColSpan": float64(2), - // "RowSpan": float64(1), - // "X": float64(4), - // "Y": float64(3), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "aKey": to.Ptr("aValue"), - // "anotherKey": to.Ptr("anotherValue"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/listDashboardsBySubscription.json -func ExampleDashboardsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDashboardsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DashboardListResult = armportal.DashboardListResult{ - // Value: []*armportal.Dashboard{ - // { - // Name: to.Ptr("testDashboard"), - // Type: to.Ptr("Microsoft.Portal/dashboards"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard"), - // Location: to.Ptr("eastus"), - // Properties: &armportal.DashboardProperties{ - // Lenses: []*armportal.DashboardLens{ - // { - // Order: to.Ptr[int32](1), - // Parts: []*armportal.DashboardParts{ - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](3), - // RowSpan: to.Ptr[int32](4), - // X: to.Ptr[int32](1), - // Y: to.Ptr[int32](2), - // }, - // }, - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](6), - // RowSpan: to.Ptr[int32](6), - // X: to.Ptr[int32](5), - // Y: to.Ptr[int32](5), - // }, - // }}, - // }, - // { - // Order: to.Ptr[int32](2), - // Parts: []*armportal.DashboardParts{ - // }, - // }}, - // Metadata: map[string]any{ - // "metadata": map[string]any{ - // "ColSpan": float64(2), - // "RowSpan": float64(1), - // "X": float64(4), - // "Y": float64(3), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "aKey": to.Ptr("aValue"), - // "anotherKey": to.Ptr("anotherValue"), - // }, - // }, - // { - // Name: to.Ptr("testDashboard2"), - // Type: to.Ptr("Microsoft.Portal/dashboards"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard2"), - // Location: to.Ptr("eastus"), - // Properties: &armportal.DashboardProperties{ - // Lenses: []*armportal.DashboardLens{ - // { - // Order: to.Ptr[int32](1), - // Parts: []*armportal.DashboardParts{ - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](3), - // RowSpan: to.Ptr[int32](4), - // X: to.Ptr[int32](1), - // Y: to.Ptr[int32](2), - // }, - // }, - // { - // Position: &armportal.DashboardPartsPosition{ - // ColSpan: to.Ptr[int32](6), - // RowSpan: to.Ptr[int32](6), - // X: to.Ptr[int32](5), - // Y: to.Ptr[int32](5), - // }, - // }}, - // }, - // { - // Order: to.Ptr[int32](2), - // Parts: []*armportal.DashboardParts{ - // }, - // }}, - // Metadata: map[string]any{ - // "metadata": map[string]any{ - // "ColSpan": float64(2), - // "RowSpan": float64(1), - // "X": float64(4), - // "Y": float64(3), - // }, - // }, - // }, - // Tags: map[string]*string{ - // "aKey": to.Ptr("aValue"), - // "anotherKey": to.Ptr("anotherValue"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/portal/armportal/fake/dashboards_server.go b/sdk/resourcemanager/portal/armportal/fake/dashboards_server.go index f73c6fec65db..8f573753d5ff 100644 --- a/sdk/resourcemanager/portal/armportal/fake/dashboards_server.go +++ b/sdk/resourcemanager/portal/armportal/fake/dashboards_server.go @@ -26,14 +26,14 @@ import ( type DashboardsServer struct { // CreateOrUpdate is the fake for method DashboardsClient.CreateOrUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, dashboardName string, dashboard armportal.Dashboard, options *armportal.DashboardsClientCreateOrUpdateOptions) (resp azfake.Responder[armportal.DashboardsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + CreateOrUpdate func(ctx context.Context, resourceGroupName string, dashboardName string, resource armportal.Dashboard, options *armportal.DashboardsClientCreateOrUpdateOptions) (resp azfake.Responder[armportal.DashboardsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // Delete is the fake for method DashboardsClient.Delete // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent Delete func(ctx context.Context, resourceGroupName string, dashboardName string, options *armportal.DashboardsClientDeleteOptions) (resp azfake.Responder[armportal.DashboardsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method DashboardsClient.Get - // HTTP status codes to indicate success: http.StatusOK, http.StatusNotFound + // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, dashboardName string, options *armportal.DashboardsClientGetOptions) (resp azfake.Responder[armportal.DashboardsClientGetResponse], errResp azfake.ErrorResponder) // NewListByResourceGroupPager is the fake for method DashboardsClient.NewListByResourceGroupPager @@ -45,8 +45,8 @@ type DashboardsServer struct { NewListBySubscriptionPager func(options *armportal.DashboardsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armportal.DashboardsClientListBySubscriptionResponse]) // Update is the fake for method DashboardsClient.Update - // HTTP status codes to indicate success: http.StatusOK, http.StatusNotFound - Update func(ctx context.Context, resourceGroupName string, dashboardName string, dashboard armportal.PatchableDashboard, options *armportal.DashboardsClientUpdateOptions) (resp azfake.Responder[armportal.DashboardsClientUpdateResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, dashboardName string, properties armportal.PatchableDashboard, options *armportal.DashboardsClientUpdateOptions) (resp azfake.Responder[armportal.DashboardsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewDashboardsServerTransport creates a new instance of DashboardsServerTransport with the provided implementation. @@ -196,8 +196,8 @@ func (d *DashboardsServerTransport) dispatchGet(req *http.Request) (*http.Respon return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNotFound}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNotFound", respContent.HTTPStatus)} + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Dashboard, req) if err != nil { @@ -303,8 +303,8 @@ func (d *DashboardsServerTransport) dispatchUpdate(req *http.Request) (*http.Res return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNotFound}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNotFound", respContent.HTTPStatus)} + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Dashboard, req) if err != nil { diff --git a/sdk/resourcemanager/portal/armportal/fake/internal.go b/sdk/resourcemanager/portal/armportal/fake/internal.go index be04ff43d678..5f75802a569e 100644 --- a/sdk/resourcemanager/portal/armportal/fake/internal.go +++ b/sdk/resourcemanager/portal/armportal/fake/internal.go @@ -31,14 +31,6 @@ func contains[T comparable](s []T, v T) bool { return false } -func parseWithCast[T any](v string, parse func(v string) (T, error)) (T, error) { - t, err := parse(v) - if err != nil { - return *new(T), err - } - return t, err -} - func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/portal/armportal/fake/tenantconfigurations_server.go b/sdk/resourcemanager/portal/armportal/fake/tenantconfigurations_server.go index 9270327c8008..cec9947b9f87 100644 --- a/sdk/resourcemanager/portal/armportal/fake/tenantconfigurations_server.go +++ b/sdk/resourcemanager/portal/armportal/fake/tenantconfigurations_server.go @@ -26,15 +26,15 @@ import ( type TenantConfigurationsServer struct { // Create is the fake for method TenantConfigurationsClient.Create // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - Create func(ctx context.Context, configurationName armportal.ConfigurationName, tenantConfiguration armportal.Configuration, options *armportal.TenantConfigurationsClientCreateOptions) (resp azfake.Responder[armportal.TenantConfigurationsClientCreateResponse], errResp azfake.ErrorResponder) + Create func(ctx context.Context, configurationName string, resource armportal.Configuration, options *armportal.TenantConfigurationsClientCreateOptions) (resp azfake.Responder[armportal.TenantConfigurationsClientCreateResponse], errResp azfake.ErrorResponder) // Delete is the fake for method TenantConfigurationsClient.Delete // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, configurationName armportal.ConfigurationName, options *armportal.TenantConfigurationsClientDeleteOptions) (resp azfake.Responder[armportal.TenantConfigurationsClientDeleteResponse], errResp azfake.ErrorResponder) + Delete func(ctx context.Context, configurationName string, options *armportal.TenantConfigurationsClientDeleteOptions) (resp azfake.Responder[armportal.TenantConfigurationsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method TenantConfigurationsClient.Get - // HTTP status codes to indicate success: http.StatusOK, http.StatusNotFound - Get func(ctx context.Context, configurationName armportal.ConfigurationName, options *armportal.TenantConfigurationsClientGetOptions) (resp azfake.Responder[armportal.TenantConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, configurationName string, options *armportal.TenantConfigurationsClientGetOptions) (resp azfake.Responder[armportal.TenantConfigurationsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method TenantConfigurationsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK @@ -103,13 +103,7 @@ func (t *TenantConfigurationsServerTransport) dispatchCreate(req *http.Request) if err != nil { return nil, err } - configurationNameParam, err := parseWithCast(matches[regex.SubexpIndex("configurationName")], func(v string) (armportal.ConfigurationName, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armportal.ConfigurationName(p), nil - }) + configurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("configurationName")]) if err != nil { return nil, err } @@ -138,13 +132,7 @@ func (t *TenantConfigurationsServerTransport) dispatchDelete(req *http.Request) if matches == nil || len(matches) < 1 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - configurationNameParam, err := parseWithCast(matches[regex.SubexpIndex("configurationName")], func(v string) (armportal.ConfigurationName, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armportal.ConfigurationName(p), nil - }) + configurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("configurationName")]) if err != nil { return nil, err } @@ -173,13 +161,7 @@ func (t *TenantConfigurationsServerTransport) dispatchGet(req *http.Request) (*h if matches == nil || len(matches) < 1 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - configurationNameParam, err := parseWithCast(matches[regex.SubexpIndex("configurationName")], func(v string) (armportal.ConfigurationName, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armportal.ConfigurationName(p), nil - }) + configurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("configurationName")]) if err != nil { return nil, err } @@ -188,8 +170,8 @@ func (t *TenantConfigurationsServerTransport) dispatchGet(req *http.Request) (*h return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNotFound}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNotFound", respContent.HTTPStatus)} + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Configuration, req) if err != nil { diff --git a/sdk/resourcemanager/portal/armportal/fake/time_rfc3339.go b/sdk/resourcemanager/portal/armportal/fake/time_rfc3339.go new file mode 100644 index 000000000000..81f308b0d343 --- /dev/null +++ b/sdk/resourcemanager/portal/armportal/fake/time_rfc3339.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/portal/armportal/go.mod b/sdk/resourcemanager/portal/armportal/go.mod index d8667fd31b7b..9d147b2f9309 100644 --- a/sdk/resourcemanager/portal/armportal/go.mod +++ b/sdk/resourcemanager/portal/armportal/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/portal/armportal/go.sum b/sdk/resourcemanager/portal/armportal/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/portal/armportal/go.sum +++ b/sdk/resourcemanager/portal/armportal/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client.go b/sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client.go index 9c9ff845181d..fa92d59bbc9c 100644 --- a/sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client.go +++ b/sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client.go @@ -39,7 +39,7 @@ func NewListTenantConfigurationViolationsClient(credential azcore.TokenCredentia // NewListPager - Gets list of items that violate tenant's configuration. // -// Generated from API version 2020-09-01-preview +// Generated from API version 2022-12-01-preview // - options - ListTenantConfigurationViolationsClientListOptions contains the optional parameters for the ListTenantConfigurationViolationsClient.NewListPager // method. func (client *ListTenantConfigurationViolationsClient) NewListPager(options *ListTenantConfigurationViolationsClientListOptions) *runtime.Pager[ListTenantConfigurationViolationsClientListResponse] { @@ -73,7 +73,7 @@ func (client *ListTenantConfigurationViolationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client_example_test.go b/sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client_example_test.go deleted file mode 100644 index 4af884480ddb..000000000000 --- a/sdk/resourcemanager/portal/armportal/listtenantconfigurationviolations_client_example_test.go +++ /dev/null @@ -1,51 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armportal_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/GetListOfTenantConfigurationViolations.json -func ExampleListTenantConfigurationViolationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewListTenantConfigurationViolationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ViolationsList = armportal.ViolationsList{ - // Value: []*armportal.Violation{ - // { - // ErrorMessage: to.Ptr("Tenant is configured to allow only URI configuration for the Markdown tiles on dashboards."), - // ID: to.Ptr("private/5f4ff99a-efa9-40f9-9c04-6b5716828c0e"), - // UserID: to.Ptr(""), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/portal/armportal/models.go b/sdk/resourcemanager/portal/armportal/models.go index 924dd9550be1..013e6c22ab88 100644 --- a/sdk/resourcemanager/portal/armportal/models.go +++ b/sdk/resourcemanager/portal/armportal/models.go @@ -8,55 +8,66 @@ package armportal -// Configuration - Tenant configuration. +import "time" + +// Configuration - The tenant configuration resource definition. type Configuration struct { - // Tenant configuration properties. + // The resource-specific properties for this resource. Properties *ConfigurationProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ConfigurationList - List of tenant configurations. -type ConfigurationList struct { - // The URL to use for getting the next set of results. - NextLink *string - - // The array of tenant configurations. +// ConfigurationListResult - The response of a Configuration list operation. +type ConfigurationListResult struct { + // REQUIRED; The Configuration items on this page Value []*Configuration + + // The link to the next page of items + NextLink *string } -// ConfigurationProperties - Tenant configuration properties. +// ConfigurationProperties - Tenant Configuration Properties with Provisioning state type ConfigurationProperties struct { // When flag is set to true Markdown tile will require external storage configuration (URI). The inline content configuration // will be prohibited. EnforcePrivateMarkdownStorage *bool + + // READ-ONLY; The status of the last operation. + ProvisioningState *ResourceProvisioningState } // Dashboard - The shared dashboard resource definition. type Dashboard struct { - // REQUIRED; Resource location + // REQUIRED; The geo-location where the resource lives Location *string - // The shared dashboard properties. - Properties *DashboardProperties + // The resource-specific properties for this resource. + Properties *DashboardPropertiesWithProvisioningState - // Resource tags + // Resource tags. Tags map[string]*string - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -69,25 +80,22 @@ type DashboardLens struct { Parts []*DashboardParts // The dashboard len's metadata. - Metadata map[string]any + Metadata any } -// DashboardListResult - List of dashboards. +// DashboardListResult - The response of a Dashboard list operation. type DashboardListResult struct { - // The URL to use for getting the next set of results. - NextLink *string - - // The array of custom resource provider manifests. + // REQUIRED; The Dashboard items on this page Value []*Dashboard + + // The link to the next page of items + NextLink *string } // DashboardPartMetadata - A dashboard part metadata. type DashboardPartMetadata struct { - // REQUIRED; The type of dashboard part. - Type *string - - // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]any + // REQUIRED; The dashboard part metadata type. + Type *DashboardPartMetadataType } // GetDashboardPartMetadata implements the DashboardPartMetadataClassification interface for type DashboardPartMetadata. @@ -117,7 +125,7 @@ type DashboardPartsPosition struct { Y *int32 // The dashboard part's metadata. - Metadata map[string]any + Metadata any } // DashboardProperties - The shared dashboard properties. @@ -126,34 +134,59 @@ type DashboardProperties struct { Lenses []*DashboardLens // The dashboard metadata. - Metadata map[string]any + Metadata any } -// ErrorDefinition - Error definition. -type ErrorDefinition struct { - // READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. - Code *int32 +// DashboardPropertiesWithProvisioningState - Dashboard Properties with Provisioning state +type DashboardPropertiesWithProvisioningState struct { + // The dashboard lenses. + Lenses []*DashboardLens + + // The dashboard metadata. + Metadata any + + // READ-ONLY; The status of the last operation. + ProvisioningState *ResourceProvisioningState +} + +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo - // READ-ONLY; Internal error details. - Details []*ErrorDefinition + // READ-ONLY; The error code. + Code *string - // READ-ONLY; Description of the error. + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. Message *string + + // READ-ONLY; The error target. + Target *string } -// ErrorResponse - Error response. +// 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 { - // The error details. - Error *ErrorDefinition + // The error object. + Error *ErrorDetail } // MarkdownPartMetadata - Markdown part metadata. type MarkdownPartMetadata struct { - // REQUIRED; The type of dashboard part. - Type *string - - // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]any + // REQUIRED; The dashboard part metadata type. + Type *DashboardPartMetadataType // Input to dashboard part. Inputs []any @@ -165,8 +198,7 @@ type MarkdownPartMetadata struct { // GetDashboardPartMetadata implements the DashboardPartMetadataClassification interface for type MarkdownPartMetadata. func (m *MarkdownPartMetadata) GetDashboardPartMetadata() *DashboardPartMetadata { return &DashboardPartMetadata{ - AdditionalProperties: m.AdditionalProperties, - Type: m.Type, + Type: m.Type, } } @@ -200,6 +232,55 @@ type MarkdownPartMetadataSettingsContentSettings struct { Title *string } +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". + Operation *string + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation +} + // PatchableDashboard - The shared dashboard resource definition. type PatchableDashboard struct { // The shared dashboard properties. @@ -212,62 +293,75 @@ type PatchableDashboard struct { // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ResourceProviderOperation - Supported operations of this resource provider. -type ResourceProviderOperation struct { - // Display metadata associated with the operation. - Display *ResourceProviderOperationDisplay +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time - // Indicates whether the operation applies to data-plane. - IsDataAction *string + // The identity that created the resource. + CreatedBy *string - // Operation name, in format of {provider}/{resource}/{operation} - Name *string + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType } -// ResourceProviderOperationDisplay - Display metadata associated with the operation. -type ResourceProviderOperationDisplay struct { - // Description of this operation. - Description *string +// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' +// and a 'location' +type TrackedResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string - // Type of operation: get, read, delete, etc. - Operation *string + // Resource tags. + Tags map[string]*string - // Resource provider: Microsoft Custom Providers. - Provider *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string - // Resource on which the operation is performed. - Resource *string -} + // READ-ONLY; The name of the resource + Name *string -// ResourceProviderOperationList - Results of the request to list operations. -type ResourceProviderOperationList struct { - // The URL to use for getting the next set of results. - NextLink *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // List of operations supported by this resource provider. - Value []*ResourceProviderOperation + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } // Violation information. @@ -284,9 +378,9 @@ type Violation struct { // ViolationsList - List of list of items that violate tenant's configuration. type ViolationsList struct { - // The URL to use for getting the next set of results. - NextLink *string - - // The array of violations. + // REQUIRED; The Violation items on this page Value []*Violation + + // The link to the next page of items + NextLink *string } diff --git a/sdk/resourcemanager/portal/armportal/models_serde.go b/sdk/resourcemanager/portal/armportal/models_serde.go index c7a0db3e1931..dbd3eabff8bf 100644 --- a/sdk/resourcemanager/portal/armportal/models_serde.go +++ b/sdk/resourcemanager/portal/armportal/models_serde.go @@ -21,6 +21,7 @@ func (c Configuration) MarshalJSON() ([]byte, error) { populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } @@ -43,6 +44,9 @@ func (c *Configuration) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -54,16 +58,16 @@ func (c *Configuration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationList. -func (c ConfigurationList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConfigurationListResult. +func (c ConfigurationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationList. -func (c *ConfigurationList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationListResult. +func (c *ConfigurationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -89,6 +93,7 @@ func (c *ConfigurationList) UnmarshalJSON(data []byte) error { func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "enforcePrivateMarkdownStorage", c.EnforcePrivateMarkdownStorage) + populate(objectMap, "provisioningState", c.ProvisioningState) return json.Marshal(objectMap) } @@ -104,6 +109,9 @@ func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error { case "enforcePrivateMarkdownStorage": err = unpopulate(val, "EnforcePrivateMarkdownStorage", &c.EnforcePrivateMarkdownStorage) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -119,6 +127,7 @@ func (d Dashboard) MarshalJSON() ([]byte, error) { populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) @@ -145,6 +154,9 @@ func (d *Dashboard) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) @@ -162,7 +174,7 @@ func (d *Dashboard) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DashboardLens. func (d DashboardLens) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "metadata", d.Metadata) + populateAny(objectMap, "metadata", d.Metadata) populate(objectMap, "order", d.Order) populate(objectMap, "parts", d.Parts) return json.Marshal(objectMap) @@ -229,11 +241,6 @@ func (d *DashboardListResult) UnmarshalJSON(data []byte) error { func (d DashboardPartMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["type"] = d.Type - if d.AdditionalProperties != nil { - for key, val := range d.AdditionalProperties { - objectMap[key] = val - } - } return json.Marshal(objectMap) } @@ -249,16 +256,6 @@ func (d *DashboardPartMetadata) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) - default: - if d.AdditionalProperties == nil { - d.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - d.AdditionalProperties[key] = aux - } - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -302,7 +299,7 @@ func (d *DashboardParts) UnmarshalJSON(data []byte) error { func (d DashboardPartsPosition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "colSpan", d.ColSpan) - populate(objectMap, "metadata", d.Metadata) + populateAny(objectMap, "metadata", d.Metadata) populate(objectMap, "rowSpan", d.RowSpan) populate(objectMap, "x", d.X) populate(objectMap, "y", d.Y) @@ -345,7 +342,7 @@ func (d *DashboardPartsPosition) UnmarshalJSON(data []byte) error { func (d DashboardProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "lenses", d.Lenses) - populate(objectMap, "metadata", d.Metadata) + populateAny(objectMap, "metadata", d.Metadata) return json.Marshal(objectMap) } @@ -372,17 +369,85 @@ func (d *DashboardProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDefinition. -func (e ErrorDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DashboardPropertiesWithProvisioningState. +func (d DashboardPropertiesWithProvisioningState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "lenses", d.Lenses) + populateAny(objectMap, "metadata", d.Metadata) + populate(objectMap, "provisioningState", d.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DashboardPropertiesWithProvisioningState. +func (d *DashboardPropertiesWithProvisioningState) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lenses": + err = unpopulate(val, "Lenses", &d.Lenses) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &d.Metadata) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDefinition. -func (e *ErrorDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -390,6 +455,9 @@ func (e *ErrorDefinition) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) @@ -399,6 +467,9 @@ func (e *ErrorDefinition) UnmarshalJSON(data []byte) error { case "message": err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -439,12 +510,7 @@ func (m MarkdownPartMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "inputs", m.Inputs) populate(objectMap, "settings", m.Settings) - objectMap["type"] = "Extension/HubsExtension/PartType/MarkdownPart" - if m.AdditionalProperties != nil { - for key, val := range m.AdditionalProperties { - objectMap[key] = val - } - } + objectMap["type"] = DashboardPartMetadataTypeMarkdown return json.Marshal(objectMap) } @@ -466,16 +532,6 @@ func (m *MarkdownPartMetadata) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) - default: - if m.AdditionalProperties == nil { - m.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - m.AdditionalProperties[key] = aux - } - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -581,6 +637,119 @@ func (m *MarkdownPartMetadataSettingsContentSettings) UnmarshalJSON(data []byte) return nil } +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PatchableDashboard. func (p PatchableDashboard) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -617,6 +786,7 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -636,6 +806,9 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -652,6 +825,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -671,6 +845,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -682,106 +859,95 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation. -func (r ResourceProviderOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", r.Display) - populate(objectMap, "isDataAction", r.IsDataAction) - populate(objectMap, "name", r.Name) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperation. -func (r *ResourceProviderOperation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &r.Display) + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &r.IsDataAction) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay. -func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", r.Description) - populate(objectMap, "operation", r.Operation) - populate(objectMap, "provider", r.Provider) - populate(objectMap, "resource", r.Resource) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplay. -func (r *ResourceProviderOperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &r.Description) + case "id": + err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &r.Operation) + case "location": + err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &r.Provider) + case "name": + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. -func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList. -func (r *ResourceProviderOperationList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "type": + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil @@ -863,8 +1029,18 @@ func populate(m map[string]any, k string, v any) { } } +func populateAny(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else { + m[k] = v + } +} + func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/portal/armportal/operations_client.go b/sdk/resourcemanager/portal/armportal/operations_client.go index 4e737f126145..bc52cefc155b 100644 --- a/sdk/resourcemanager/portal/armportal/operations_client.go +++ b/sdk/resourcemanager/portal/armportal/operations_client.go @@ -37,9 +37,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - The Microsoft Portal operations API. +// NewListPager - List the operations for the provider // -// Generated from API version 2020-09-01-preview +// Generated from API version 2022-12-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -81,7 +81,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceProviderOperationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/portal/armportal/operations_client_example_test.go b/sdk/resourcemanager/portal/armportal/operations_client_example_test.go deleted file mode 100644 index 969de5ba2a62..000000000000 --- a/sdk/resourcemanager/portal/armportal/operations_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armportal_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/operationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceProviderOperationList = armportal.ResourceProviderOperationList{ - // Value: []*armportal.ResourceProviderOperation{ - // { - // Name: to.Ptr("Microsoft.Portal/dashboards/read"), - // Display: &armportal.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Reads the dashboards for the subscription."), - // Operation: to.Ptr("Get Dashboard"), - // Provider: to.Ptr("Microsoft Portal"), - // Resource: to.Ptr("Dashboards"), - // }, - // IsDataAction: to.Ptr("false"), - // }, - // { - // Name: to.Ptr("Microsoft.Portal/dashboards/write"), - // Display: &armportal.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Add or modify dashboard to a subscription."), - // Operation: to.Ptr("Set Dashboard"), - // Provider: to.Ptr("Microsoft Portal"), - // Resource: to.Ptr("Dashboards"), - // }, - // IsDataAction: to.Ptr("false"), - // }, - // { - // Name: to.Ptr("Microsoft.Portal/dashboards/delete"), - // Display: &armportal.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Removes the dashboard from the subscription."), - // Operation: to.Ptr("Delete Dashboard"), - // Provider: to.Ptr("Microsoft Portal"), - // Resource: to.Ptr("Dashboards"), - // }, - // IsDataAction: to.Ptr("false"), - // }, - // { - // Name: to.Ptr("Microsoft.Portal/register/action"), - // Display: &armportal.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Registers the subscription for the portal resource provider and enables shared dashboards."), - // Operation: to.Ptr("Registers the Portal Resource Provider"), - // Provider: to.Ptr("Microsoft Portal"), - // Resource: to.Ptr("Portal Resource Provider"), - // }, - // IsDataAction: to.Ptr("false"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/portal/armportal/polymorphic_helpers.go b/sdk/resourcemanager/portal/armportal/polymorphic_helpers.go index 7c86d38e07c8..81cdc5b1b385 100644 --- a/sdk/resourcemanager/portal/armportal/polymorphic_helpers.go +++ b/sdk/resourcemanager/portal/armportal/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armportal import "encoding/json" func unmarshalDashboardPartMetadataClassification(rawMsg json.RawMessage) (DashboardPartMetadataClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -20,7 +20,7 @@ func unmarshalDashboardPartMetadataClassification(rawMsg json.RawMessage) (Dashb } var b DashboardPartMetadataClassification switch m["type"] { - case "Extension/HubsExtension/PartType/MarkdownPart": + case string(DashboardPartMetadataTypeMarkdown): b = &MarkdownPartMetadata{} default: b = &DashboardPartMetadata{} diff --git a/sdk/resourcemanager/portal/armportal/response_types.go b/sdk/resourcemanager/portal/armportal/responses.go similarity index 86% rename from sdk/resourcemanager/portal/armportal/response_types.go rename to sdk/resourcemanager/portal/armportal/responses.go index b4ed5284a392..6bb45790b426 100644 --- a/sdk/resourcemanager/portal/armportal/response_types.go +++ b/sdk/resourcemanager/portal/armportal/responses.go @@ -27,13 +27,13 @@ type DashboardsClientGetResponse struct { // DashboardsClientListByResourceGroupResponse contains the response from method DashboardsClient.NewListByResourceGroupPager. type DashboardsClientListByResourceGroupResponse struct { - // List of dashboards. + // The response of a Dashboard list operation. DashboardListResult } // DashboardsClientListBySubscriptionResponse contains the response from method DashboardsClient.NewListBySubscriptionPager. type DashboardsClientListBySubscriptionResponse struct { - // List of dashboards. + // The response of a Dashboard list operation. DashboardListResult } @@ -51,13 +51,13 @@ type ListTenantConfigurationViolationsClientListResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // Results of the request to list operations. - ResourceProviderOperationList + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult } // TenantConfigurationsClientCreateResponse contains the response from method TenantConfigurationsClient.Create. type TenantConfigurationsClientCreateResponse struct { - // Tenant configuration. + // The tenant configuration resource definition. Configuration } @@ -68,12 +68,12 @@ type TenantConfigurationsClientDeleteResponse struct { // TenantConfigurationsClientGetResponse contains the response from method TenantConfigurationsClient.Get. type TenantConfigurationsClientGetResponse struct { - // Tenant configuration. + // The tenant configuration resource definition. Configuration } // TenantConfigurationsClientListResponse contains the response from method TenantConfigurationsClient.NewListPager. type TenantConfigurationsClientListResponse struct { - // List of tenant configurations. - ConfigurationList + // The response of a Configuration list operation. + ConfigurationListResult } diff --git a/sdk/resourcemanager/portal/armportal/tenantconfigurations_client.go b/sdk/resourcemanager/portal/armportal/tenantconfigurations_client.go index eb22e2264399..7e6f5ef5fcdf 100644 --- a/sdk/resourcemanager/portal/armportal/tenantconfigurations_client.go +++ b/sdk/resourcemanager/portal/armportal/tenantconfigurations_client.go @@ -44,18 +44,18 @@ func NewTenantConfigurationsClient(credential azcore.TokenCredential, options *a // this operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-09-01-preview -// - configurationName - The configuration name. Value must be 'default' -// - tenantConfiguration - The parameters required to create or update tenant configuration. +// Generated from API version 2022-12-01-preview +// - configurationName - The name of the Configuration +// - resource - The parameters required to create or update tenant configuration. // - options - TenantConfigurationsClientCreateOptions contains the optional parameters for the TenantConfigurationsClient.Create // method. -func (client *TenantConfigurationsClient) Create(ctx context.Context, configurationName ConfigurationName, tenantConfiguration Configuration, options *TenantConfigurationsClientCreateOptions) (TenantConfigurationsClientCreateResponse, error) { +func (client *TenantConfigurationsClient) Create(ctx context.Context, configurationName string, resource Configuration, options *TenantConfigurationsClientCreateOptions) (TenantConfigurationsClientCreateResponse, error) { var err error const operationName = "TenantConfigurationsClient.Create" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, configurationName, tenantConfiguration, options) + req, err := client.createCreateRequest(ctx, configurationName, resource, options) if err != nil { return TenantConfigurationsClientCreateResponse{}, err } @@ -72,21 +72,21 @@ func (client *TenantConfigurationsClient) Create(ctx context.Context, configurat } // createCreateRequest creates the Create request. -func (client *TenantConfigurationsClient) createCreateRequest(ctx context.Context, configurationName ConfigurationName, tenantConfiguration Configuration, options *TenantConfigurationsClientCreateOptions) (*policy.Request, error) { +func (client *TenantConfigurationsClient) createCreateRequest(ctx context.Context, configurationName string, resource Configuration, options *TenantConfigurationsClientCreateOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Portal/tenantConfigurations/{configurationName}" if configurationName == "" { return nil, errors.New("parameter configurationName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(string(configurationName))) + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, tenantConfiguration); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil @@ -104,11 +104,11 @@ func (client *TenantConfigurationsClient) createHandleResponse(resp *http.Respon // Delete - Delete the tenant configuration. User has to be a Tenant Admin for this operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-09-01-preview -// - configurationName - The configuration name. Value must be 'default' +// Generated from API version 2022-12-01-preview +// - configurationName - The name of the Configuration // - options - TenantConfigurationsClientDeleteOptions contains the optional parameters for the TenantConfigurationsClient.Delete // method. -func (client *TenantConfigurationsClient) Delete(ctx context.Context, configurationName ConfigurationName, options *TenantConfigurationsClientDeleteOptions) (TenantConfigurationsClientDeleteResponse, error) { +func (client *TenantConfigurationsClient) Delete(ctx context.Context, configurationName string, options *TenantConfigurationsClientDeleteOptions) (TenantConfigurationsClientDeleteResponse, error) { var err error const operationName = "TenantConfigurationsClient.Delete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -130,18 +130,18 @@ func (client *TenantConfigurationsClient) Delete(ctx context.Context, configurat } // deleteCreateRequest creates the Delete request. -func (client *TenantConfigurationsClient) deleteCreateRequest(ctx context.Context, configurationName ConfigurationName, options *TenantConfigurationsClientDeleteOptions) (*policy.Request, error) { +func (client *TenantConfigurationsClient) deleteCreateRequest(ctx context.Context, configurationName string, options *TenantConfigurationsClientDeleteOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Portal/tenantConfigurations/{configurationName}" if configurationName == "" { return nil, errors.New("parameter configurationName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(string(configurationName))) + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -150,11 +150,11 @@ func (client *TenantConfigurationsClient) deleteCreateRequest(ctx context.Contex // Get - Gets the tenant configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-09-01-preview -// - configurationName - The configuration name. Value must be 'default' +// Generated from API version 2022-12-01-preview +// - configurationName - The name of the Configuration // - options - TenantConfigurationsClientGetOptions contains the optional parameters for the TenantConfigurationsClient.Get // method. -func (client *TenantConfigurationsClient) Get(ctx context.Context, configurationName ConfigurationName, options *TenantConfigurationsClientGetOptions) (TenantConfigurationsClientGetResponse, error) { +func (client *TenantConfigurationsClient) Get(ctx context.Context, configurationName string, options *TenantConfigurationsClientGetOptions) (TenantConfigurationsClientGetResponse, error) { var err error const operationName = "TenantConfigurationsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -168,7 +168,7 @@ func (client *TenantConfigurationsClient) Get(ctx context.Context, configuration if err != nil { return TenantConfigurationsClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNotFound) { + if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) return TenantConfigurationsClientGetResponse{}, err } @@ -177,18 +177,18 @@ func (client *TenantConfigurationsClient) Get(ctx context.Context, configuration } // getCreateRequest creates the Get request. -func (client *TenantConfigurationsClient) getCreateRequest(ctx context.Context, configurationName ConfigurationName, options *TenantConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *TenantConfigurationsClient) getCreateRequest(ctx context.Context, configurationName string, options *TenantConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Portal/tenantConfigurations/{configurationName}" if configurationName == "" { return nil, errors.New("parameter configurationName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(string(configurationName))) + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +205,7 @@ func (client *TenantConfigurationsClient) getHandleResponse(resp *http.Response) // NewListPager - Gets list of the tenant configurations. // -// Generated from API version 2020-09-01-preview +// Generated from API version 2022-12-01-preview // - options - TenantConfigurationsClientListOptions contains the optional parameters for the TenantConfigurationsClient.NewListPager // method. func (client *TenantConfigurationsClient) NewListPager(options *TenantConfigurationsClientListOptions) *runtime.Pager[TenantConfigurationsClientListResponse] { @@ -239,7 +239,7 @@ func (client *TenantConfigurationsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01-preview") + reqQP.Set("api-version", "2022-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *TenantConfigurationsClient) listCreateRequest(ctx context.Context, // listHandleResponse handles the List response. func (client *TenantConfigurationsClient) listHandleResponse(resp *http.Response) (TenantConfigurationsClientListResponse, error) { result := TenantConfigurationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationListResult); err != nil { return TenantConfigurationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/portal/armportal/tenantconfigurations_client_example_test.go b/sdk/resourcemanager/portal/armportal/tenantconfigurations_client_example_test.go deleted file mode 100644 index 6084b546be5c..000000000000 --- a/sdk/resourcemanager/portal/armportal/tenantconfigurations_client_example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armportal_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/portal/armportal" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/GetListOfTenantConfigurations.json -func ExampleTenantConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTenantConfigurationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationList = armportal.ConfigurationList{ - // Value: []*armportal.Configuration{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Portal/tenantConfiguration"), - // ID: to.Ptr("/providers/Microsoft.Portal/tenantConfigurations"), - // Properties: &armportal.ConfigurationProperties{ - // EnforcePrivateMarkdownStorage: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/GetTenantConfiguration.json -func ExampleTenantConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTenantConfigurationsClient().Get(ctx, armportal.ConfigurationNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Configuration = armportal.Configuration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Portal/tenantConfiguration"), - // ID: to.Ptr("/providers/Microsoft.Portal/tenantConfigurations/default"), - // Properties: &armportal.ConfigurationProperties{ - // EnforcePrivateMarkdownStorage: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/CreateOrUpdateTenantConfiguration.json -func ExampleTenantConfigurationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTenantConfigurationsClient().Create(ctx, armportal.ConfigurationNameDefault, armportal.Configuration{ - Properties: &armportal.ConfigurationProperties{ - EnforcePrivateMarkdownStorage: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Configuration = armportal.Configuration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Portal/tenantConfiguration"), - // ID: to.Ptr("/providers/Microsoft.Portal/tenantConfigurations/default"), - // Properties: &armportal.ConfigurationProperties{ - // EnforcePrivateMarkdownStorage: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/examples/TenantConfiguration/DeleteTenantConfiguration.json -func ExampleTenantConfigurationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armportal.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTenantConfigurationsClient().Delete(ctx, armportal.ConfigurationNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/portal/armportal/time_rfc3339.go b/sdk/resourcemanager/portal/armportal/time_rfc3339.go new file mode 100644 index 000000000000..d11defe98f54 --- /dev/null +++ b/sdk/resourcemanager/portal/armportal/time_rfc3339.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armportal + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md b/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md index 4b4702a05b07..3d7c7b624f6f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md +++ b/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 1.1.0 (2024-08-27) +### Features Added + +- New field `PrivateLinkScopeResourceID` in struct `GuestAgentProperties` +- New field `DomainName`, `DomainPassword`, `DomainUsername`, `ProductKey`, `RunOnceCommands`, `Timezone`, `Workgroup` in struct `OsProfileForVMInstance` + + ## 1.0.0 (2024-06-28) ### Breaking Changes diff --git a/sdk/resourcemanager/scvmm/armscvmm/autorest.md b/sdk/resourcemanager/scvmm/armscvmm/autorest.md index be912d6e1c0c..1304d7b50d8a 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/autorest.md +++ b/sdk/resourcemanager/scvmm/armscvmm/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/scvmm/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/scvmm/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-10 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go index cea845178f08..b593e3a91dcd 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go @@ -46,7 +46,7 @@ func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Onboards the ScVmm availability set as an Azure resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *AvailabilitySetsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Onboards the ScVmm availability set as an Azure resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *AvailabilitySetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, resource AvailabilitySet, options *AvailabilitySetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deregisters the ScVmm availability set from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - options - AvailabilitySetsClientBeginDeleteOptions contains the optional parameters for the AvailabilitySetsClient.BeginDelete @@ -153,7 +153,7 @@ func (client *AvailabilitySetsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deregisters the ScVmm availability set from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *AvailabilitySetsClient) deleteOperation(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, options *AvailabilitySetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +207,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r // Get - Implements AvailabilitySet GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. @@ -253,7 +253,7 @@ func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (Av // NewListByResourceGroupPager - List of AvailabilitySets in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AvailabilitySetsClientListByResourceGroupOptions contains the optional parameters for the AvailabilitySetsClient.NewListByResourceGroupPager // method. @@ -313,7 +313,7 @@ func (client *AvailabilitySetsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *AvailabilitySetsClient) listByResourceGroupHandleResponse(resp *ht // NewListBySubscriptionPager - List of AvailabilitySets in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager // method. func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] { @@ -368,7 +368,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *htt // BeginUpdate - Updates the AvailabilitySets resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - properties - The resource properties to be updated. @@ -413,7 +413,7 @@ func (client *AvailabilitySetsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates the AvailabilitySets resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *AvailabilitySetsClient) update(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, properties AvailabilitySetTagsUpdate, options *AvailabilitySetsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginUpdate" @@ -455,7 +455,7 @@ func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go deleted file mode 100644 index de9ef8437cfa..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go +++ /dev/null @@ -1,488 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListBySubscriptionPager_availabilitySetsListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListBySubscriptionPager_availabilitySetsListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListByResourceGroupPager_availabilitySetsListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListByResourceGroupPager_availabilitySetsListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgscvmm", "-", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgscvmm", "V", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginCreateOrUpdate_availabilitySetsCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.AvailabilitySet{ - Location: to.Ptr("jelevilan"), - Tags: map[string]*string{ - "key5701": to.Ptr("cldtxloqh"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.AvailabilitySetProperties{ - AvailabilitySetName: to.Ptr("njrpftunzo"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginCreateOrUpdate_availabilitySetsCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "_", armscvmm.AvailabilitySet{ - Location: to.Ptr("jelevilan"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginUpdate_availabilitySetsUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.AvailabilitySetTagsUpdate{ - Tags: map[string]*string{ - "key1460": to.Ptr("vcbwibkvr"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginUpdate_availabilitySetsUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginUpdate(ctx, "rgscvmm", "1", armscvmm.AvailabilitySetTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginDelete_availabilitySetsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginDelete(ctx, "rgscvmm", "_", &armscvmm.AvailabilitySetsClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginDelete_availabilitySetsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginDelete(ctx, "rgscvmm", "6", &armscvmm.AvailabilitySetsClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go b/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go index defd671ed809..5f2de325e9bd 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go @@ -46,7 +46,7 @@ func NewCloudsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Onboards the ScVmm fabric cloud as an Azure cloud resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *CloudsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Onboards the ScVmm fabric cloud as an Azure cloud resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *CloudsClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudResourceName string, resource Cloud, options *CloudsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deregisters the ScVmm fabric cloud from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - options - CloudsClientBeginDeleteOptions contains the optional parameters for the CloudsClient.BeginDelete method. @@ -152,7 +152,7 @@ func (client *CloudsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deregisters the ScVmm fabric cloud from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *CloudsClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudResourceName string, options *CloudsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *CloudsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -206,7 +206,7 @@ func (client *CloudsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Implements Cloud GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - options - CloudsClientGetOptions contains the optional parameters for the CloudsClient.Get method. @@ -252,7 +252,7 @@ func (client *CloudsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *CloudsClient) getHandleResponse(resp *http.Response) (CloudsClient // NewListByResourceGroupPager - List of Clouds in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudsClientListByResourceGroupOptions contains the optional parameters for the CloudsClient.NewListByResourceGroupPager // method. @@ -312,7 +312,7 @@ func (client *CloudsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *CloudsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - List of Clouds in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - CloudsClientListBySubscriptionOptions contains the optional parameters for the CloudsClient.NewListBySubscriptionPager // method. func (client *CloudsClient) NewListBySubscriptionPager(options *CloudsClientListBySubscriptionOptions) *runtime.Pager[CloudsClientListBySubscriptionResponse] { @@ -367,7 +367,7 @@ func (client *CloudsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *CloudsClient) listBySubscriptionHandleResponse(resp *http.Response // BeginUpdate - Updates the Clouds resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - properties - The resource properties to be updated. @@ -411,7 +411,7 @@ func (client *CloudsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates the Clouds resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *CloudsClient) update(ctx context.Context, resourceGroupName string, cloudResourceName string, properties CloudTagsUpdate, options *CloudsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginUpdate" @@ -453,7 +453,7 @@ func (client *CloudsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go deleted file mode 100644 index 13b1ecee71db..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go +++ /dev/null @@ -1,570 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json -func ExampleCloudsClient_NewListBySubscriptionPager_cloudsListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MinimumSet_Gen.json -func ExampleCloudsClient_NewListBySubscriptionPager_cloudsListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json -func ExampleCloudsClient_NewListByResourceGroupPager_cloudsListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MinimumSet_Gen.json -func ExampleCloudsClient_NewListByResourceGroupPager_cloudsListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json -func ExampleCloudsClient_Get_cloudsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudsClient().Get(ctx, "rgscvmm", "_", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json -func ExampleCloudsClient_Get_cloudsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudsClient().Get(ctx, "rgscvmm", "i", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json -func ExampleCloudsClient_BeginCreateOrUpdate_cloudsCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "2", armscvmm.Cloud{ - Location: to.Ptr("khwsdmaxfhmbu"), - Tags: map[string]*string{ - "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.CloudProperties{ - CloudCapacity: &armscvmm.CloudCapacity{}, - InventoryItemID: to.Ptr("qjd"), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MinimumSet_Gen.json -func ExampleCloudsClient_BeginCreateOrUpdate_cloudsCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.Cloud{ - Location: to.Ptr("khwsdmaxfhmbu"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json -func ExampleCloudsClient_BeginUpdate_cloudsUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginUpdate(ctx, "rgscvmm", "P", armscvmm.CloudTagsUpdate{ - Tags: map[string]*string{ - "key5266": to.Ptr("hjpcnwmpnixsolrxnbl"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json -func ExampleCloudsClient_BeginUpdate_cloudsUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginUpdate(ctx, "rgscvmm", "_", armscvmm.CloudTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json -func ExampleCloudsClient_BeginDelete_cloudsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginDelete(ctx, "rgscvmm", "-", &armscvmm.CloudsClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json -func ExampleCloudsClient_BeginDelete_cloudsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginDelete(ctx, "rgscvmm", "1", &armscvmm.CloudsClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/constants.go b/sdk/resourcemanager/scvmm/armscvmm/constants.go index 7c68e179fa2f..941176f967e1 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/constants.go +++ b/sdk/resourcemanager/scvmm/armscvmm/constants.go @@ -10,7 +10,7 @@ package armscvmm const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/scvmm/armscvmm/go.mod b/sdk/resourcemanager/scvmm/armscvmm/go.mod index bd204cd34872..ad56824aeda2 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/go.mod +++ b/sdk/resourcemanager/scvmm/armscvmm/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/scvmm/armscvmm/go.sum b/sdk/resourcemanager/scvmm/armscvmm/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/go.sum +++ b/sdk/resourcemanager/scvmm/armscvmm/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go index abaabf3a1784..a19e5074b1bf 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go @@ -41,7 +41,7 @@ func NewGuestAgentsClient(credential azcore.TokenCredential, options *arm.Client // BeginCreate - Create Or Update GuestAgent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - resource - Resource create parameters. // - options - GuestAgentsClientBeginCreateOptions contains the optional parameters for the GuestAgentsClient.BeginCreate method. @@ -66,7 +66,7 @@ func (client *GuestAgentsClient) BeginCreate(ctx context.Context, resourceURI st // Create - Create Or Update GuestAgent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *GuestAgentsClient) create(ctx context.Context, resourceURI string, resource GuestAgent, options *GuestAgentsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "GuestAgentsClient.BeginCreate" @@ -97,7 +97,7 @@ func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -109,7 +109,7 @@ func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resour // Delete - Implements GuestAgent DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientDeleteOptions contains the optional parameters for the GuestAgentsClient.Delete method. func (client *GuestAgentsClient) Delete(ctx context.Context, resourceURI string, options *GuestAgentsClientDeleteOptions) (GuestAgentsClientDeleteResponse, error) { @@ -142,7 +142,7 @@ func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -151,7 +151,7 @@ func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resour // Get - Implements GuestAgent GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientGetOptions contains the optional parameters for the GuestAgentsClient.Get method. func (client *GuestAgentsClient) Get(ctx context.Context, resourceURI string, options *GuestAgentsClientGetOptions) (GuestAgentsClientGetResponse, error) { @@ -185,7 +185,7 @@ func (client *GuestAgentsClient) getCreateRequest(ctx context.Context, resourceU return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *GuestAgentsClient) getHandleResponse(resp *http.Response) (GuestAg // NewListByVirtualMachineInstancePager - Returns the list of GuestAgent of the given vm. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientListByVirtualMachineInstanceOptions contains the optional parameters for the GuestAgentsClient.NewListByVirtualMachineInstancePager // method. @@ -238,7 +238,7 @@ func (client *GuestAgentsClient) listByVirtualMachineInstanceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go deleted file mode 100644 index 0ea7db384610..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go +++ /dev/null @@ -1,293 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json -func ExampleGuestAgentsClient_NewListByVirtualMachineInstancePager_guestAgentsListByVirtualMachineInstanceMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGuestAgentsClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GuestAgentListResult = armscvmm.GuestAgentListResult{ - // Value: []*armscvmm.GuestAgent{ - // { - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MinimumSet_Gen.json -func ExampleGuestAgentsClient_NewListByVirtualMachineInstancePager_guestAgentsListByVirtualMachineInstanceMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGuestAgentsClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GuestAgentListResult = armscvmm.GuestAgentListResult{ - // Value: []*armscvmm.GuestAgent{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json -func ExampleGuestAgentsClient_Get_guestAgentsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGuestAgentsClient().Get(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GuestAgent = armscvmm.GuestAgent{ - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MinimumSet_Gen.json -func ExampleGuestAgentsClient_Get_guestAgentsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGuestAgentsClient().Get(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GuestAgent = armscvmm.GuestAgent{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json -func ExampleGuestAgentsClient_BeginCreate_guestAgentsCreateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentsClient().BeginCreate(ctx, "gtgclehcbsyave", armscvmm.GuestAgent{ - Properties: &armscvmm.GuestAgentProperties{ - Credentials: &armscvmm.GuestCredential{ - Password: to.Ptr("gkvbnmuahumuoibvscoxzfdqwvfuf"), - Username: to.Ptr("jqxuwirrcpfv"), - }, - HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - }, - ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GuestAgent = armscvmm.GuestAgent{ - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MinimumSet_Gen.json -func ExampleGuestAgentsClient_BeginCreate_guestAgentsCreateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentsClient().BeginCreate(ctx, "gtgclehcbsyave", armscvmm.GuestAgent{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GuestAgent = armscvmm.GuestAgent{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json -func ExampleGuestAgentsClient_Delete_guestAgentsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGuestAgentsClient().Delete(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MinimumSet_Gen.json -func ExampleGuestAgentsClient_Delete_guestAgentsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGuestAgentsClient().Delete(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go index 33d02089cc34..c90100c46477 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go @@ -46,7 +46,7 @@ func NewInventoryItemsClient(subscriptionID string, credential azcore.TokenCrede // Create - Create Or Update InventoryItem. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -98,7 +98,7 @@ func (client *InventoryItemsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -119,7 +119,7 @@ func (client *InventoryItemsClient) createHandleResponse(resp *http.Response) (I // Delete - Deletes an inventoryItem. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -169,7 +169,7 @@ func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, res // Get - Shows an inventory item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -229,7 +229,7 @@ func (client *InventoryItemsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +246,7 @@ func (client *InventoryItemsClient) getHandleResponse(resp *http.Response) (Inve // NewListByVmmServerPager - Returns the list of inventoryItems in the given VmmServer. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - InventoryItemsClientListByVmmServerOptions contains the optional parameters for the InventoryItemsClient.NewListByVmmServerPager @@ -294,7 +294,7 @@ func (client *InventoryItemsClient) listByVmmServerCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go deleted file mode 100644 index 72dfbef0933f..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go +++ /dev/null @@ -1,264 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json -func ExampleInventoryItemsClient_NewListByVmmServerPager_inventoryItemsListByVmmServerMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInventoryItemsClient().NewListByVmmServerPager("rgscvmm", "X", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InventoryItemListResult = armscvmm.InventoryItemListResult{ - // Value: []*armscvmm.InventoryItem{ - // { - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MinimumSet_Gen.json -func ExampleInventoryItemsClient_NewListByVmmServerPager_inventoryItemsListByVmmServerMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInventoryItemsClient().NewListByVmmServerPager("rgscvmm", "H", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InventoryItemListResult = armscvmm.InventoryItemListResult{ - // Value: []*armscvmm.InventoryItem{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Get_inventoryItemsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "rgscvmm", "1", "2bFBede6-EEf8-becB-dBbd-B96DbBFdB3f3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InventoryItem = armscvmm.InventoryItem{ - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Get_inventoryItemsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "rgscvmm", "_", "cacb8Ceb-efAC-bebb-ae7C-dec8C5Bb7100", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InventoryItem = armscvmm.InventoryItem{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Create_inventoryItemsCreateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "rgscvmm", "O", "1BdDc2Ab-bDd9-Ebd6-bfdb-C0dbbdB5DEDf", armscvmm.InventoryItem{ - Kind: to.Ptr("M\\d_,V."), - Properties: &armscvmm.InventoryItemProperties{ - InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InventoryItem = armscvmm.InventoryItem{ - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Create_inventoryItemsCreateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "rgscvmm", ".", "bbFb0cBb-50ce-4bfc-3eeD-bC26AbCC257a", armscvmm.InventoryItem{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InventoryItem = armscvmm.InventoryItem{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Delete_inventoryItemsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "rgscvmm", "b", "EcECadfd-Eaaa-e5Ce-ebdA-badeEd3c6af1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Delete_inventoryItemsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "rgscvmm", "_", "cDBcbae6-BC3d-52fe-CedC-7eFeaBFabb82", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/models.go b/sdk/resourcemanager/scvmm/armscvmm/models.go index 954137ee3c26..56712fc917c8 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/models.go +++ b/sdk/resourcemanager/scvmm/armscvmm/models.go @@ -239,6 +239,9 @@ type GuestAgentProperties struct { // HTTP Proxy configuration for the VM. HTTPProxyConfig *HTTPProxyConfiguration + // The resource id of the private link scope this machine is assigned to, if any. + PrivateLinkScopeResourceID *string + // Gets or sets the guest agent provisioning action. ProvisioningAction *ProvisioningAction @@ -549,6 +552,27 @@ type OsProfileForVMInstance struct { // Gets or sets computer name. ComputerName *string + // Gets or sets the domain name. + DomainName *string + + // Password of the domain the VM has to join. + DomainPassword *string + + // Gets or sets the domain username. + DomainUsername *string + + // Gets or sets the product key.Input format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx + ProductKey *string + + // Get or sets the commands to be run once at the time of creation separated by semicolons. + RunOnceCommands *string + + // Gets or sets the index value of the timezone. + Timezone *int32 + + // Gets or sets the workgroup. + Workgroup *string + // READ-ONLY; Gets os sku. OSSKU *string diff --git a/sdk/resourcemanager/scvmm/armscvmm/models_serde.go b/sdk/resourcemanager/scvmm/armscvmm/models_serde.go index a0c75adc8c61..257a76cefd1f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/models_serde.go +++ b/sdk/resourcemanager/scvmm/armscvmm/models_serde.go @@ -586,6 +586,7 @@ func (g GuestAgentProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "credentials", g.Credentials) populate(objectMap, "customResourceName", g.CustomResourceName) populate(objectMap, "httpProxyConfig", g.HTTPProxyConfig) + populate(objectMap, "privateLinkScopeResourceId", g.PrivateLinkScopeResourceID) populate(objectMap, "provisioningAction", g.ProvisioningAction) populate(objectMap, "provisioningState", g.ProvisioningState) populate(objectMap, "status", g.Status) @@ -611,6 +612,9 @@ func (g *GuestAgentProperties) UnmarshalJSON(data []byte) error { case "httpProxyConfig": err = unpopulate(val, "HTTPProxyConfig", &g.HTTPProxyConfig) delete(rawMsg, key) + case "privateLinkScopeResourceId": + err = unpopulate(val, "PrivateLinkScopeResourceID", &g.PrivateLinkScopeResourceID) + delete(rawMsg, key) case "provisioningAction": err = unpopulate(val, "ProvisioningAction", &g.ProvisioningAction) delete(rawMsg, key) @@ -1323,9 +1327,16 @@ func (o OsProfileForVMInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adminPassword", o.AdminPassword) populate(objectMap, "computerName", o.ComputerName) + populate(objectMap, "domainName", o.DomainName) + populate(objectMap, "domainPassword", o.DomainPassword) + populate(objectMap, "domainUsername", o.DomainUsername) populate(objectMap, "osSku", o.OSSKU) populate(objectMap, "osType", o.OSType) populate(objectMap, "osVersion", o.OSVersion) + populate(objectMap, "productKey", o.ProductKey) + populate(objectMap, "runOnceCommands", o.RunOnceCommands) + populate(objectMap, "timezone", o.Timezone) + populate(objectMap, "workgroup", o.Workgroup) return json.Marshal(objectMap) } @@ -1344,6 +1355,15 @@ func (o *OsProfileForVMInstance) UnmarshalJSON(data []byte) error { case "computerName": err = unpopulate(val, "ComputerName", &o.ComputerName) delete(rawMsg, key) + case "domainName": + err = unpopulate(val, "DomainName", &o.DomainName) + delete(rawMsg, key) + case "domainPassword": + err = unpopulate(val, "DomainPassword", &o.DomainPassword) + delete(rawMsg, key) + case "domainUsername": + err = unpopulate(val, "DomainUsername", &o.DomainUsername) + delete(rawMsg, key) case "osSku": err = unpopulate(val, "OSSKU", &o.OSSKU) delete(rawMsg, key) @@ -1353,6 +1373,18 @@ func (o *OsProfileForVMInstance) UnmarshalJSON(data []byte) error { case "osVersion": err = unpopulate(val, "OSVersion", &o.OSVersion) delete(rawMsg, key) + case "productKey": + err = unpopulate(val, "ProductKey", &o.ProductKey) + delete(rawMsg, key) + case "runOnceCommands": + err = unpopulate(val, "RunOnceCommands", &o.RunOnceCommands) + delete(rawMsg, key) + case "timezone": + err = unpopulate(val, "Timezone", &o.Timezone) + delete(rawMsg, key) + case "workgroup": + err = unpopulate(val, "Workgroup", &o.Workgroup) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) diff --git a/sdk/resourcemanager/scvmm/armscvmm/operations_client.go b/sdk/resourcemanager/scvmm/armscvmm/operations_client.go index 859c2036320a..71a20790552f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/operations_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go deleted file mode 100644 index 15482cfb6029..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armscvmm.OperationListResult{ - // Value: []*armscvmm.Operation{ - // { - // Name: to.Ptr("rieknsh"), - // ActionType: to.Ptr(armscvmm.ActionTypeInternal), - // Display: &armscvmm.OperationDisplay{ - // Description: to.Ptr("fmwevntnynhgzoksqpjidn"), - // Operation: to.Ptr("v"), - // Provider: to.Ptr("avkabpzrbafrbnubspbrsippj"), - // Resource: to.Ptr("qojushhvjhkwwmboofogcky"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armscvmm.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armscvmm.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go index baed77d9ab5c..0ad33f957eca 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go @@ -41,7 +41,7 @@ func NewVirtualMachineInstancesClient(credential azcore.TokenCredential, options // BeginCreateCheckpoint - Creates a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginCreateCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateCheckpoint @@ -67,7 +67,7 @@ func (client *VirtualMachineInstancesClient) BeginCreateCheckpoint(ctx context.C // CreateCheckpoint - Creates a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) createCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineCreateCheckpoint, options *VirtualMachineInstancesClientBeginCreateCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginCreateCheckpoint" @@ -98,7 +98,7 @@ func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -111,7 +111,7 @@ func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx c // set only during virtual machine instance creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - resource - Resource create parameters. // - options - VirtualMachineInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateOrUpdate @@ -138,7 +138,7 @@ func (client *VirtualMachineInstancesClient) BeginCreateOrUpdate(ctx context.Con // during virtual machine instance creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) createOrUpdate(ctx context.Context, resourceURI string, resource VirtualMachineInstance, options *VirtualMachineInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginCreateOrUpdate" @@ -169,7 +169,7 @@ func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -181,7 +181,7 @@ func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - The operation to delete a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginDelete // method. @@ -206,7 +206,7 @@ func (client *VirtualMachineInstancesClient) BeginDelete(ctx context.Context, re // Delete - The operation to delete a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) deleteOperation(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginDelete" @@ -237,7 +237,7 @@ func (client *VirtualMachineInstancesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.DeleteFromHost != nil { reqQP.Set("deleteFromHost", string(*options.DeleteFromHost)) } @@ -252,7 +252,7 @@ func (client *VirtualMachineInstancesClient) deleteCreateRequest(ctx context.Con // BeginDeleteCheckpoint - Deletes a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginDeleteCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginDeleteCheckpoint @@ -278,7 +278,7 @@ func (client *VirtualMachineInstancesClient) BeginDeleteCheckpoint(ctx context.C // DeleteCheckpoint - Deletes a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) deleteCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineDeleteCheckpoint, options *VirtualMachineInstancesClientBeginDeleteCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginDeleteCheckpoint" @@ -309,7 +309,7 @@ func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -321,7 +321,7 @@ func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx c // Get - Retrieves information about a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientGetOptions contains the optional parameters for the VirtualMachineInstancesClient.Get // method. @@ -356,7 +356,7 @@ func (client *VirtualMachineInstancesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +373,7 @@ func (client *VirtualMachineInstancesClient) getHandleResponse(resp *http.Respon // NewListPager - Lists all of the virtual machine instances within the specified parent resource. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientListOptions contains the optional parameters for the VirtualMachineInstancesClient.NewListPager // method. @@ -409,7 +409,7 @@ func (client *VirtualMachineInstancesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,7 +427,7 @@ func (client *VirtualMachineInstancesClient) listHandleResponse(resp *http.Respo // BeginRestart - The operation to restart a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginRestartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestart // method. @@ -452,7 +452,7 @@ func (client *VirtualMachineInstancesClient) BeginRestart(ctx context.Context, r // Restart - The operation to restart a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) restart(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginRestart" @@ -483,7 +483,7 @@ func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,7 +492,7 @@ func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Co // BeginRestoreCheckpoint - Restores to a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginRestoreCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestoreCheckpoint @@ -518,7 +518,7 @@ func (client *VirtualMachineInstancesClient) BeginRestoreCheckpoint(ctx context. // RestoreCheckpoint - Restores to a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) restoreCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineRestoreCheckpoint, options *VirtualMachineInstancesClientBeginRestoreCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginRestoreCheckpoint" @@ -549,7 +549,7 @@ func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -561,7 +561,7 @@ func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx // BeginStart - The operation to start a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginStartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStart // method. @@ -586,7 +586,7 @@ func (client *VirtualMachineInstancesClient) BeginStart(ctx context.Context, res // Start - The operation to start a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) start(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginStart" @@ -617,7 +617,7 @@ func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -626,7 +626,7 @@ func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Cont // BeginStop - The operation to power off (stop) a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginStopOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStop @@ -652,7 +652,7 @@ func (client *VirtualMachineInstancesClient) BeginStop(ctx context.Context, reso // Stop - The operation to power off (stop) a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) stop(ctx context.Context, resourceURI string, body StopVirtualMachineOptions, options *VirtualMachineInstancesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginStop" @@ -683,7 +683,7 @@ func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -695,7 +695,7 @@ func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Conte // BeginUpdate - The operation to update a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - properties - The resource properties to be updated. // - options - VirtualMachineInstancesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginUpdate @@ -721,7 +721,7 @@ func (client *VirtualMachineInstancesClient) BeginUpdate(ctx context.Context, re // Update - The operation to update a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) update(ctx context.Context, resourceURI string, properties VirtualMachineInstanceUpdate, options *VirtualMachineInstancesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginUpdate" @@ -752,7 +752,7 @@ func (client *VirtualMachineInstancesClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go deleted file mode 100644 index d2eb007ddf2a..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go +++ /dev/null @@ -1,1079 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_NewListPager_virtualMachineInstancesListMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("gtgclehcbsyave", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineInstanceListResult = armscvmm.VirtualMachineInstanceListResult{ - // Value: []*armscvmm.VirtualMachineInstance{ - // { - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_NewListPager_virtualMachineInstancesListMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("gtgclehcbsyave", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineInstanceListResult = armscvmm.VirtualMachineInstanceListResult{ - // Value: []*armscvmm.VirtualMachineInstance{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_Get_virtualMachineInstancesGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_Get_virtualMachineInstancesGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armscvmm.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_virtualMachineInstancesCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstance{ - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualMachineInstanceProperties{ - AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - { - Name: to.Ptr("lwbhaseo"), - ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - }}, - HardwareProfile: &armscvmm.HardwareProfile{ - CPUCount: to.Ptr[int32](22), - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - DynamicMemoryMaxMB: to.Ptr[int32](2), - DynamicMemoryMinMB: to.Ptr[int32](30), - IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - MemoryMB: to.Ptr[int32](5), - }, - InfrastructureProfile: &armscvmm.InfrastructureProfile{ - BiosGUID: to.Ptr("xixivxifyql"), - CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - Generation: to.Ptr[int32](28), - InventoryItemID: to.Ptr("ihkkqmg"), - LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - Name: to.Ptr("keqn"), - Description: to.Ptr("qurzfrgyflrh"), - CheckpointID: to.Ptr("wsqmrje"), - ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - }, - TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - UUID: to.Ptr("hrpw"), - VMName: to.Ptr("qovpayfydhcvfrhe"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - NetworkProfile: &armscvmm.NetworkProfile{ - NetworkInterfaces: []*armscvmm.NetworkInterface{ - { - Name: to.Ptr("kvofzqulbjlbtt"), - IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - MacAddress: to.Ptr("oaeqqegt"), - MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - NicID: to.Ptr("roxpsvlo"), - VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - }}, - }, - OSProfile: &armscvmm.OsProfileForVMInstance{ - AdminPassword: to.Ptr("vavtppmmhlspydtkzxda"), - ComputerName: to.Ptr("uuxpcxuxcufllc"), - OSType: to.Ptr(armscvmm.OsTypeWindows), - }, - StorageProfile: &armscvmm.StorageProfile{ - Disks: []*armscvmm.VirtualDisk{ - { - Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - Bus: to.Ptr[int32](8), - BusType: to.Ptr("zu"), - CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - DiskSizeGB: to.Ptr[int32](30), - Lun: to.Ptr[int32](10), - StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - Name: to.Ptr("ceiyfrflu"), - ID: to.Ptr("o"), - }, - TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("kz"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_virtualMachineInstancesCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstance{ - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armscvmm.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginUpdate_virtualMachineInstancesUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstanceUpdate{ - Properties: &armscvmm.VirtualMachineInstanceUpdateProperties{ - AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - { - Name: to.Ptr("lwbhaseo"), - ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - }}, - HardwareProfile: &armscvmm.HardwareProfileUpdate{ - CPUCount: to.Ptr[int32](22), - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - DynamicMemoryMaxMB: to.Ptr[int32](2), - DynamicMemoryMinMB: to.Ptr[int32](30), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - MemoryMB: to.Ptr[int32](5), - }, - InfrastructureProfile: &armscvmm.InfrastructureProfileUpdate{ - CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - }, - NetworkProfile: &armscvmm.NetworkProfileUpdate{ - NetworkInterfaces: []*armscvmm.NetworkInterfaceUpdate{ - { - Name: to.Ptr("kvofzqulbjlbtt"), - IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - MacAddress: to.Ptr("oaeqqegt"), - MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - NicID: to.Ptr("roxpsvlo"), - VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - }}, - }, - StorageProfile: &armscvmm.StorageProfileUpdate{ - Disks: []*armscvmm.VirtualDiskUpdate{ - { - Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - Bus: to.Ptr[int32](8), - BusType: to.Ptr("zu"), - DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - DiskSizeGB: to.Ptr[int32](30), - Lun: to.Ptr[int32](10), - StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - Name: to.Ptr("ceiyfrflu"), - ID: to.Ptr("o"), - }, - VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("kz"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginUpdate_virtualMachineInstancesUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstanceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armscvmm.VirtualMachineInstance{ - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDelete_virtualMachineInstancesDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "gtgclehcbsyave", &armscvmm.VirtualMachineInstancesClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue), - DeleteFromHost: to.Ptr(armscvmm.DeleteFromHostTrue), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDelete_virtualMachineInstancesDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "gtgclehcbsyave", &armscvmm.VirtualMachineInstancesClientBeginDeleteOptions{Force: nil, - DeleteFromHost: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateCheckpoint_virtualMachineInstancesCreateCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineCreateCheckpoint{ - Name: to.Ptr("ilvltf"), - Description: to.Ptr("zoozhfbepldrgpjqsbhpqebtodrhvy"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateCheckpoint_virtualMachineInstancesCreateCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineCreateCheckpoint{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDeleteCheckpoint_virtualMachineInstancesDeleteCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDeleteCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineDeleteCheckpoint{ - ID: to.Ptr("eenfflimcbgqfsebdusophahjpk"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDeleteCheckpoint_virtualMachineInstancesDeleteCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDeleteCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineDeleteCheckpoint{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestart_virtualMachineInstancesRestartMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestart_virtualMachineInstancesRestartMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestoreCheckpoint_virtualMachineInstancesRestoreCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestoreCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineRestoreCheckpoint{ - ID: to.Ptr("rweqduwzsn"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestoreCheckpoint_virtualMachineInstancesRestoreCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestoreCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineRestoreCheckpoint{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStart_virtualMachineInstancesStartMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStart_virtualMachineInstancesStartMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStop_virtualMachineInstancesStopMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "gtgclehcbsyave", armscvmm.StopVirtualMachineOptions{ - SkipShutdown: to.Ptr(armscvmm.SkipShutdownTrue), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStop_virtualMachineInstancesStopMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "gtgclehcbsyave", armscvmm.StopVirtualMachineOptions{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go index 84281bc35baf..30b8ef90956b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go @@ -46,7 +46,7 @@ func NewVirtualMachineTemplatesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Onboards the ScVmm VM Template as an Azure VM Template resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *VirtualMachineTemplatesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Onboards the ScVmm VM Template as an Azure VM Template resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineTemplatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, resource VirtualMachineTemplate, options *VirtualMachineTemplatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deregisters the ScVmm VM Template from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - options - VirtualMachineTemplatesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginDelete @@ -153,7 +153,7 @@ func (client *VirtualMachineTemplatesClient) BeginDelete(ctx context.Context, re // Delete - Deregisters the ScVmm VM Template from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineTemplatesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, options *VirtualMachineTemplatesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VirtualMachineTemplatesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +207,7 @@ func (client *VirtualMachineTemplatesClient) deleteCreateRequest(ctx context.Con // Get - Implements VirtualMachineTemplate GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - options - VirtualMachineTemplatesClientGetOptions contains the optional parameters for the VirtualMachineTemplatesClient.Get @@ -254,7 +254,7 @@ func (client *VirtualMachineTemplatesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *VirtualMachineTemplatesClient) getHandleResponse(resp *http.Respon // NewListByResourceGroupPager - List of VirtualMachineTemplates in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualMachineTemplatesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListByResourceGroupPager // method. @@ -314,7 +314,7 @@ func (client *VirtualMachineTemplatesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *VirtualMachineTemplatesClient) listByResourceGroupHandleResponse(r // NewListBySubscriptionPager - List of VirtualMachineTemplates in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - VirtualMachineTemplatesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListBySubscriptionPager // method. func (client *VirtualMachineTemplatesClient) NewListBySubscriptionPager(options *VirtualMachineTemplatesClientListBySubscriptionOptions) *runtime.Pager[VirtualMachineTemplatesClientListBySubscriptionResponse] { @@ -369,7 +369,7 @@ func (client *VirtualMachineTemplatesClient) listBySubscriptionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,7 @@ func (client *VirtualMachineTemplatesClient) listBySubscriptionHandleResponse(re // BeginUpdate - Updates the VirtualMachineTemplate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - properties - The resource properties to be updated. @@ -414,7 +414,7 @@ func (client *VirtualMachineTemplatesClient) BeginUpdate(ctx context.Context, re // Update - Updates the VirtualMachineTemplate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineTemplatesClient) update(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, properties VirtualMachineTemplateTagsUpdate, options *VirtualMachineTemplatesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginUpdate" @@ -456,7 +456,7 @@ func (client *VirtualMachineTemplatesClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go deleted file mode 100644 index 0b71bb748b18..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go +++ /dev/null @@ -1,739 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListBySubscriptionPager_virtualMachineTemplatesListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListBySubscriptionPager_virtualMachineTemplatesListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListByResourceGroupPager_virtualMachineTemplatesListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListByResourceGroupPager_virtualMachineTemplatesListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_Get_virtualMachineTemplatesGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "rgscvmm", "4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_Get_virtualMachineTemplatesGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "rgscvmm", "m", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginCreateOrUpdate_virtualMachineTemplatesCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreateOrUpdate(ctx, "rgscvmm", "6", armscvmm.VirtualMachineTemplate{ - Location: to.Ptr("ayxsyduviotylbojh"), - Tags: map[string]*string{ - "key9494": to.Ptr("kkbmfpwhmvlobm"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualMachineTemplateProperties{ - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - OSType: to.Ptr(armscvmm.OsTypeWindows), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginCreateOrUpdate_virtualMachineTemplatesCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreateOrUpdate(ctx, "rgscvmm", "P", armscvmm.VirtualMachineTemplate{ - Location: to.Ptr("ayxsyduviotylbojh"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginUpdate_virtualMachineTemplatesUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginUpdate(ctx, "rgscvmm", "g", armscvmm.VirtualMachineTemplateTagsUpdate{ - Tags: map[string]*string{ - "key6634": to.Ptr("wwfhrg"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginUpdate_virtualMachineTemplatesUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualMachineTemplateTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginDelete_virtualMachineTemplatesDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "rgscvmm", "6", &armscvmm.VirtualMachineTemplatesClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginDelete_virtualMachineTemplatesDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "rgscvmm", "5", &armscvmm.VirtualMachineTemplatesClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go index c3ee98db816a..fd4acca640f4 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go @@ -46,7 +46,7 @@ func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Onboards the ScVmm virtual network as an Azure virtual network resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Onboards the ScVmm virtual network as an Azure virtual network resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, resource VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deregisters the ScVmm virtual network from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete @@ -153,7 +153,7 @@ func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deregisters the ScVmm virtual network from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +207,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re // Get - Implements VirtualNetwork GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. @@ -253,7 +253,7 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir // NewListByResourceGroupPager - List of VirtualNetworks in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.NewListByResourceGroupPager // method. @@ -313,7 +313,7 @@ func (client *VirtualNetworksClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *VirtualNetworksClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - List of VirtualNetworks in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.NewListBySubscriptionPager // method. func (client *VirtualNetworksClient) NewListBySubscriptionPager(options *VirtualNetworksClientListBySubscriptionOptions) *runtime.Pager[VirtualNetworksClientListBySubscriptionResponse] { @@ -368,7 +368,7 @@ func (client *VirtualNetworksClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,7 @@ func (client *VirtualNetworksClient) listBySubscriptionHandleResponse(resp *http // BeginUpdate - Updates the VirtualNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - properties - The resource properties to be updated. @@ -413,7 +413,7 @@ func (client *VirtualNetworksClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates the VirtualNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualNetworksClient) update(ctx context.Context, resourceGroupName string, virtualNetworkName string, properties VirtualNetworkTagsUpdate, options *VirtualNetworksClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginUpdate" @@ -455,7 +455,7 @@ func (client *VirtualNetworksClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go deleted file mode 100644 index 48165b958265..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,500 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_NewListBySubscriptionPager_virtualNetworksListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_NewListBySubscriptionPager_virtualNetworksListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager_virtualNetworksListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager_virtualNetworksListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_Get_virtualNetworksGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rgscvmm", "2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_Get_virtualNetworksGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rgscvmm", "-", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_virtualNetworksCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rgscvmm", "_", armscvmm.VirtualNetwork{ - Location: to.Ptr("fky"), - Tags: map[string]*string{ - "key705": to.Ptr("apgplvjdyocx"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualNetworkProperties{ - InventoryItemID: to.Ptr("bxn"), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_virtualNetworksCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualNetwork{ - Location: to.Ptr("fky"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginUpdate_virtualNetworksUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginUpdate(ctx, "rgscvmm", "S", armscvmm.VirtualNetworkTagsUpdate{ - Tags: map[string]*string{ - "key9516": to.Ptr("oxduo"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginUpdate_virtualNetworksUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualNetworkTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginDelete_virtualNetworksDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rgscvmm", ".", &armscvmm.VirtualNetworksClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginDelete_virtualNetworksDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rgscvmm", "1", &armscvmm.VirtualNetworksClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go index e47d239a05b4..5b63a4eb8026 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go @@ -41,7 +41,7 @@ func NewVMInstanceHybridIdentityMetadatasClient(credential azcore.TokenCredentia // Get - Implements HybridIdentityMetadata GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VMInstanceHybridIdentityMetadatasClientGetOptions contains the optional parameters for the VMInstanceHybridIdentityMetadatasClient.Get // method. @@ -76,7 +76,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -93,7 +93,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) getHandleResponse(resp *h // NewListByVirtualMachineInstancePager - Returns the list of HybridIdentityMetadata of the given VM. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VMInstanceHybridIdentityMetadatasClientListByVirtualMachineInstanceOptions contains the optional parameters for // the VMInstanceHybridIdentityMetadatasClient.NewListByVirtualMachineInstancePager method. @@ -129,7 +129,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) listByVirtualMachineInsta return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go deleted file mode 100644 index 28cdf105c571..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_NewListByVirtualMachineInstancePager_vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VMInstanceHybridIdentityMetadataListResult = armscvmm.VMInstanceHybridIdentityMetadataListResult{ - // Value: []*armscvmm.VMInstanceHybridIdentityMetadata{ - // { - // Name: to.Ptr("rxvpcegqc"), - // Type: to.Ptr("ixqhymswessvylnqgti"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.VMInstanceHybridIdentityMetadataProperties{ - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // PublicKey: to.Ptr("hijhfxcdjuzidfjjztoh"), - // ResourceUID: to.Ptr("mikbntobifeiouinvsalnu"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MinimumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_NewListByVirtualMachineInstancePager_vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VMInstanceHybridIdentityMetadataListResult = armscvmm.VMInstanceHybridIdentityMetadataListResult{ - // Value: []*armscvmm.VMInstanceHybridIdentityMetadata{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_Get_vmInstanceHybridIdentityMetadatasGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().Get(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VMInstanceHybridIdentityMetadata = armscvmm.VMInstanceHybridIdentityMetadata{ - // Name: to.Ptr("rxvpcegqc"), - // Type: to.Ptr("ixqhymswessvylnqgti"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.VMInstanceHybridIdentityMetadataProperties{ - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // PublicKey: to.Ptr("hijhfxcdjuzidfjjztoh"), - // ResourceUID: to.Ptr("mikbntobifeiouinvsalnu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MinimumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_Get_vmInstanceHybridIdentityMetadatasGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().Get(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VMInstanceHybridIdentityMetadata = armscvmm.VMInstanceHybridIdentityMetadata{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go index 13f2dad140c1..0fe0192fadfe 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go @@ -46,7 +46,7 @@ func NewVmmServersClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Onboards the SCVmm fabric as an Azure VmmServer resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *VmmServersClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Onboards the SCVmm fabric as an Azure VmmServer resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VmmServersClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmmServerName string, resource VmmServer, options *VmmServersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Removes the SCVmm fabric from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - VmmServersClientBeginDeleteOptions contains the optional parameters for the VmmServersClient.BeginDelete method. @@ -152,7 +152,7 @@ func (client *VmmServersClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Removes the SCVmm fabric from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VmmServersClient) deleteOperation(ctx context.Context, resourceGroupName string, vmmServerName string, options *VmmServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *VmmServersClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -206,7 +206,7 @@ func (client *VmmServersClient) deleteCreateRequest(ctx context.Context, resourc // Get - Implements VmmServer GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - VmmServersClientGetOptions contains the optional parameters for the VmmServersClient.Get method. @@ -252,7 +252,7 @@ func (client *VmmServersClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *VmmServersClient) getHandleResponse(resp *http.Response) (VmmServe // NewListByResourceGroupPager - List of VmmServers in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VmmServersClientListByResourceGroupOptions contains the optional parameters for the VmmServersClient.NewListByResourceGroupPager // method. @@ -312,7 +312,7 @@ func (client *VmmServersClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *VmmServersClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List of VmmServers in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - VmmServersClientListBySubscriptionOptions contains the optional parameters for the VmmServersClient.NewListBySubscriptionPager // method. func (client *VmmServersClient) NewListBySubscriptionPager(options *VmmServersClientListBySubscriptionOptions) *runtime.Pager[VmmServersClientListBySubscriptionResponse] { @@ -367,7 +367,7 @@ func (client *VmmServersClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *VmmServersClient) listBySubscriptionHandleResponse(resp *http.Resp // BeginUpdate - Updates the VmmServers resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - properties - The resource properties to be updated. @@ -411,7 +411,7 @@ func (client *VmmServersClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates the VmmServers resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VmmServersClient) update(ctx context.Context, resourceGroupName string, vmmServerName string, properties VmmServerTagsUpdate, options *VmmServersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginUpdate" @@ -453,7 +453,7 @@ func (client *VmmServersClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go deleted file mode 100644 index e440882550b1..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go +++ /dev/null @@ -1,528 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json -func ExampleVmmServersClient_NewListBySubscriptionPager_vmmServersListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MinimumSet_Gen.json -func ExampleVmmServersClient_NewListBySubscriptionPager_vmmServersListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVmmServersClient_NewListByResourceGroupPager_vmmServersListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVmmServersClient_NewListByResourceGroupPager_vmmServersListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json -func ExampleVmmServersClient_Get_vmmServersGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVmmServersClient().Get(ctx, "rgscvmm", ".", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen.json -func ExampleVmmServersClient_Get_vmmServersGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVmmServersClient().Get(ctx, "rgscvmm", "D", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginCreateOrUpdate_vmmServersCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.VmmServer{ - Location: to.Ptr("hslxkyzktvwpqbypvs"), - Tags: map[string]*string{ - "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VmmServerProperties{ - Credentials: &armscvmm.VmmCredential{ - Password: to.Ptr("gaecsnkjr"), - Username: to.Ptr("jbuoltypmrgqfi"), - }, - Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - Port: to.Ptr[int32](4), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginCreateOrUpdate_vmmServersCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginCreateOrUpdate(ctx, "rgscvmm", "w", armscvmm.VmmServer{ - Location: to.Ptr("hslxkyzktvwpqbypvs"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginUpdate_vmmServersUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginUpdate(ctx, "rgscvmm", "Y", armscvmm.VmmServerTagsUpdate{ - Tags: map[string]*string{ - "key7187": to.Ptr("oktnfvklfchnquelzzdagtpwfskzc"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginUpdate_vmmServersUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginUpdate(ctx, "rgscvmm", "_", armscvmm.VmmServerTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginDelete_vmmServersDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginDelete(ctx, "rgscvmm", ".", &armscvmm.VmmServersClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginDelete_vmmServersDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginDelete(ctx, "rgscvmm", "8", &armscvmm.VmmServersClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/CHANGELOG.md b/sdk/resourcemanager/servicenetworking/armservicenetworking/CHANGELOG.md index 936481ac695d..4a6f2568380e 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/CHANGELOG.md +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.1.0-beta.2 (2024-08-27) +### Other Changes + + ## 1.0.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client.go index 98868c7284e5..40fdc2d44dd2 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client.go @@ -46,7 +46,7 @@ func NewAssociationsInterfaceClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Create a Association // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - associationName - Name of Association @@ -74,7 +74,7 @@ func (client *AssociationsInterfaceClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Create a Association // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview func (client *AssociationsInterfaceClient) createOrUpdate(ctx context.Context, resourceGroupName string, trafficControllerName string, associationName string, resource Association, options *AssociationsInterfaceClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AssociationsInterfaceClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *AssociationsInterfaceClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -132,7 +132,7 @@ func (client *AssociationsInterfaceClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete a Association // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - associationName - Name of Association @@ -159,7 +159,7 @@ func (client *AssociationsInterfaceClient) BeginDelete(ctx context.Context, reso // Delete - Delete a Association // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview func (client *AssociationsInterfaceClient) deleteOperation(ctx context.Context, resourceGroupName string, trafficControllerName string, associationName string, options *AssociationsInterfaceClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AssociationsInterfaceClient.BeginDelete" @@ -174,7 +174,7 @@ func (client *AssociationsInterfaceClient) deleteOperation(ctx context.Context, if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -205,7 +205,7 @@ func (client *AssociationsInterfaceClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *AssociationsInterfaceClient) deleteCreateRequest(ctx context.Conte // Get - Get a Association // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - associationName - Name of Association @@ -266,7 +266,7 @@ func (client *AssociationsInterfaceClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *AssociationsInterfaceClient) getHandleResponse(resp *http.Response // NewListByTrafficControllerPager - List Association resources by TrafficController // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - options - AssociationsInterfaceClientListByTrafficControllerOptions contains the optional parameters for the AssociationsInterfaceClient.NewListByTrafficControllerPager @@ -331,7 +331,7 @@ func (client *AssociationsInterfaceClient) listByTrafficControllerCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,7 @@ func (client *AssociationsInterfaceClient) listByTrafficControllerHandleResponse // Update - Update a Association // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - associationName - Name of Association @@ -402,7 +402,7 @@ func (client *AssociationsInterfaceClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client_example_test.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client_example_test.go deleted file mode 100644 index 2cba5d9ea1ef..000000000000 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/associationsinterface_client_example_test.go +++ /dev/null @@ -1,198 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicenetworking_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicenetworking/armservicenetworking" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationsGet.json -func ExampleAssociationsInterfaceClient_NewListByTrafficControllerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssociationsInterfaceClient().NewListByTrafficControllerPager("rg1", "tc1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssociationListResult = armservicenetworking.AssociationListResult{ - // Value: []*armservicenetworking.Association{ - // { - // Name: to.Ptr("as1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/associations"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.AssociationProperties{ - // AssociationType: to.Ptr(armservicenetworking.AssociationTypeSubnets), - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // Subnet: &armservicenetworking.AssociationSubnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationGet.json -func ExampleAssociationsInterfaceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssociationsInterfaceClient().Get(ctx, "rg1", "tc1", "as1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Association = armservicenetworking.Association{ - // Name: to.Ptr("as1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/associations"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.AssociationProperties{ - // AssociationType: to.Ptr(armservicenetworking.AssociationTypeSubnets), - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // Subnet: &armservicenetworking.AssociationSubnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationPut.json -func ExampleAssociationsInterfaceClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAssociationsInterfaceClient().BeginCreateOrUpdate(ctx, "rg1", "tc1", "as1", armservicenetworking.Association{ - Location: to.Ptr("NorthCentralUS"), - Properties: &armservicenetworking.AssociationProperties{ - AssociationType: to.Ptr(armservicenetworking.AssociationTypeSubnets), - Subnet: &armservicenetworking.AssociationSubnet{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Association = armservicenetworking.Association{ - // Name: to.Ptr("associatedvnet-1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/associations"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.AssociationProperties{ - // AssociationType: to.Ptr(armservicenetworking.AssociationTypeSubnets), - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // Subnet: &armservicenetworking.AssociationSubnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationPatch.json -func ExampleAssociationsInterfaceClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssociationsInterfaceClient().Update(ctx, "rg1", "tc1", "as1", armservicenetworking.AssociationUpdate{ - Properties: &armservicenetworking.AssociationUpdateProperties{ - AssociationType: to.Ptr(armservicenetworking.AssociationTypeSubnets), - Subnet: &armservicenetworking.AssociationSubnetUpdate{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Association = armservicenetworking.Association{ - // Name: to.Ptr("as1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/associations"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.AssociationProperties{ - // AssociationType: to.Ptr(armservicenetworking.AssociationTypeSubnets), - // Subnet: &armservicenetworking.AssociationSubnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationDelete.json -func ExampleAssociationsInterfaceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAssociationsInterfaceClient().BeginDelete(ctx, "rg1", "tc1", "as1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/autorest.md b/sdk/resourcemanager/servicenetworking/armservicenetworking/autorest.md index a42c041d31f9..1fa5cb220450 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/autorest.md +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicenetworking/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicenetworking/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-11-01 +module-version: 1.1.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/client_factory.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/client_factory.go index e3e94fcfa2f2..b3ec6ff8b8ba 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/client_factory.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,36 +26,51 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewAssociationsInterfaceClient creates a new instance of AssociationsInterfaceClient. func (c *ClientFactory) NewAssociationsInterfaceClient() *AssociationsInterfaceClient { - subClient, _ := NewAssociationsInterfaceClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AssociationsInterfaceClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewFrontendsInterfaceClient creates a new instance of FrontendsInterfaceClient. func (c *ClientFactory) NewFrontendsInterfaceClient() *FrontendsInterfaceClient { - subClient, _ := NewFrontendsInterfaceClient(c.subscriptionID, c.credential, c.options) - return subClient + return &FrontendsInterfaceClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } +} + +// NewSecurityPoliciesInterfaceClient creates a new instance of SecurityPoliciesInterfaceClient. +func (c *ClientFactory) NewSecurityPoliciesInterfaceClient() *SecurityPoliciesInterfaceClient { + return &SecurityPoliciesInterfaceClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewTrafficControllerInterfaceClient creates a new instance of TrafficControllerInterfaceClient. func (c *ClientFactory) NewTrafficControllerInterfaceClient() *TrafficControllerInterfaceClient { - subClient, _ := NewTrafficControllerInterfaceClient(c.subscriptionID, c.credential, c.options) - return subClient + return &TrafficControllerInterfaceClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/constants.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/constants.go index 4a6d266648f2..cbf759a4747e 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/constants.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/constants.go @@ -10,7 +10,7 @@ package armservicenetworking const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicenetworking/armservicenetworking" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.2" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -27,9 +27,11 @@ func PossibleActionTypeValues() []ActionType { } } +// AssociationType - Association Type Enum type AssociationType string const ( + // AssociationTypeSubnets - Association of Type Subnet AssociationTypeSubnets AssociationType = "subnets" ) @@ -79,16 +81,39 @@ func PossibleOriginValues() []Origin { } } +// PolicyType - Policy Type of the Security Policy +type PolicyType string + +const ( + // PolicyTypeWAF - Policy of Type WAF + PolicyTypeWAF PolicyType = "waf" +) + +// PossiblePolicyTypeValues returns the possible values for the PolicyType const type. +func PossiblePolicyTypeValues() []PolicyType { + return []PolicyType{ + PolicyTypeWAF, + } +} + +// ProvisioningState - Resource Provisioning State Enum type ProvisioningState string const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateAccepted - Resource in Accepted State + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled - Resource in Canceled State + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting - Resource in Deleting State + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Resource in Failed State + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning - Resource in Provisioning State ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" + // ProvisioningStateSucceeded - Resource in Succeeded State + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating - Resource in Updating State + ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/associationsinterface_server.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/associationsinterface_server.go index 762cd7853950..7e9364abd690 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/associationsinterface_server.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/associationsinterface_server.go @@ -29,7 +29,7 @@ type AssociationsInterfaceServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, trafficControllerName string, associationName string, resource armservicenetworking.Association, options *armservicenetworking.AssociationsInterfaceClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armservicenetworking.AssociationsInterfaceClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method AssociationsInterfaceClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, trafficControllerName string, associationName string, options *armservicenetworking.AssociationsInterfaceClientBeginDeleteOptions) (resp azfake.PollerResponder[armservicenetworking.AssociationsInterfaceClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method AssociationsInterfaceClient.Get @@ -188,9 +188,9 @@ func (a *AssociationsInterfaceServerTransport) dispatchBeginDelete(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { a.beginDelete.remove(req) diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/frontendsinterface_server.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/frontendsinterface_server.go index 628e4af7a79f..74480f8fa6e5 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/frontendsinterface_server.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/frontendsinterface_server.go @@ -29,7 +29,7 @@ type FrontendsInterfaceServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, trafficControllerName string, frontendName string, resource armservicenetworking.Frontend, options *armservicenetworking.FrontendsInterfaceClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armservicenetworking.FrontendsInterfaceClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method FrontendsInterfaceClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, trafficControllerName string, frontendName string, options *armservicenetworking.FrontendsInterfaceClientBeginDeleteOptions) (resp azfake.PollerResponder[armservicenetworking.FrontendsInterfaceClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method FrontendsInterfaceClient.Get @@ -188,9 +188,9 @@ func (f *FrontendsInterfaceServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { f.beginDelete.remove(req) diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/securitypoliciesinterface_server.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/securitypoliciesinterface_server.go new file mode 100644 index 000000000000..71b054235b84 --- /dev/null +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/securitypoliciesinterface_server.go @@ -0,0 +1,319 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicenetworking/armservicenetworking" + "net/http" + "net/url" + "regexp" +) + +// SecurityPoliciesInterfaceServer is a fake server for instances of the armservicenetworking.SecurityPoliciesInterfaceClient type. +type SecurityPoliciesInterfaceServer struct { + // BeginCreateOrUpdate is the fake for method SecurityPoliciesInterfaceClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, resource armservicenetworking.SecurityPolicy, options *armservicenetworking.SecurityPoliciesInterfaceClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armservicenetworking.SecurityPoliciesInterfaceClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method SecurityPoliciesInterfaceClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, options *armservicenetworking.SecurityPoliciesInterfaceClientBeginDeleteOptions) (resp azfake.PollerResponder[armservicenetworking.SecurityPoliciesInterfaceClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPoliciesInterfaceClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, options *armservicenetworking.SecurityPoliciesInterfaceClientGetOptions) (resp azfake.Responder[armservicenetworking.SecurityPoliciesInterfaceClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByTrafficControllerPager is the fake for method SecurityPoliciesInterfaceClient.NewListByTrafficControllerPager + // HTTP status codes to indicate success: http.StatusOK + NewListByTrafficControllerPager func(resourceGroupName string, trafficControllerName string, options *armservicenetworking.SecurityPoliciesInterfaceClientListByTrafficControllerOptions) (resp azfake.PagerResponder[armservicenetworking.SecurityPoliciesInterfaceClientListByTrafficControllerResponse]) + + // Update is the fake for method SecurityPoliciesInterfaceClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, properties armservicenetworking.SecurityPolicyUpdate, options *armservicenetworking.SecurityPoliciesInterfaceClientUpdateOptions) (resp azfake.Responder[armservicenetworking.SecurityPoliciesInterfaceClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewSecurityPoliciesInterfaceServerTransport creates a new instance of SecurityPoliciesInterfaceServerTransport with the provided implementation. +// The returned SecurityPoliciesInterfaceServerTransport instance is connected to an instance of armservicenetworking.SecurityPoliciesInterfaceClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPoliciesInterfaceServerTransport(srv *SecurityPoliciesInterfaceServer) *SecurityPoliciesInterfaceServerTransport { + return &SecurityPoliciesInterfaceServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armservicenetworking.SecurityPoliciesInterfaceClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armservicenetworking.SecurityPoliciesInterfaceClientDeleteResponse]](), + newListByTrafficControllerPager: newTracker[azfake.PagerResponder[armservicenetworking.SecurityPoliciesInterfaceClientListByTrafficControllerResponse]](), + } +} + +// SecurityPoliciesInterfaceServerTransport connects instances of armservicenetworking.SecurityPoliciesInterfaceClient to instances of SecurityPoliciesInterfaceServer. +// Don't use this type directly, use NewSecurityPoliciesInterfaceServerTransport instead. +type SecurityPoliciesInterfaceServerTransport struct { + srv *SecurityPoliciesInterfaceServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armservicenetworking.SecurityPoliciesInterfaceClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armservicenetworking.SecurityPoliciesInterfaceClientDeleteResponse]] + newListByTrafficControllerPager *tracker[azfake.PagerResponder[armservicenetworking.SecurityPoliciesInterfaceClientListByTrafficControllerResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPoliciesInterfaceServerTransport. +func (s *SecurityPoliciesInterfaceServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "SecurityPoliciesInterfaceClient.BeginCreateOrUpdate": + resp, err = s.dispatchBeginCreateOrUpdate(req) + case "SecurityPoliciesInterfaceClient.BeginDelete": + resp, err = s.dispatchBeginDelete(req) + case "SecurityPoliciesInterfaceClient.Get": + resp, err = s.dispatchGet(req) + case "SecurityPoliciesInterfaceClient.NewListByTrafficControllerPager": + resp, err = s.dispatchNewListByTrafficControllerPager(req) + case "SecurityPoliciesInterfaceClient.Update": + resp, err = s.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *SecurityPoliciesInterfaceServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceNetworking/trafficControllers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityPolicy/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicenetworking.SecurityPolicy](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + trafficControllerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("trafficControllerName")]) + if err != nil { + return nil, err + } + securityPolicyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("securityPolicyName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, trafficControllerNameParam, securityPolicyNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (s *SecurityPoliciesInterfaceServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceNetworking/trafficControllers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityPolicy/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + trafficControllerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("trafficControllerName")]) + if err != nil { + return nil, err + } + securityPolicyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("securityPolicyName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, trafficControllerNameParam, securityPolicyNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *SecurityPoliciesInterfaceServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceNetworking/trafficControllers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityPolicy/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + trafficControllerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("trafficControllerName")]) + if err != nil { + return nil, err + } + securityPolicyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("securityPolicyName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, trafficControllerNameParam, securityPolicyNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityPolicy, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPoliciesInterfaceServerTransport) dispatchNewListByTrafficControllerPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListByTrafficControllerPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByTrafficControllerPager not implemented")} + } + newListByTrafficControllerPager := s.newListByTrafficControllerPager.get(req) + if newListByTrafficControllerPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceNetworking/trafficControllers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityPolicy` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + trafficControllerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("trafficControllerName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListByTrafficControllerPager(resourceGroupNameParam, trafficControllerNameParam, nil) + newListByTrafficControllerPager = &resp + s.newListByTrafficControllerPager.add(req, newListByTrafficControllerPager) + server.PagerResponderInjectNextLinks(newListByTrafficControllerPager, req, func(page *armservicenetworking.SecurityPoliciesInterfaceClientListByTrafficControllerResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByTrafficControllerPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByTrafficControllerPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByTrafficControllerPager) { + s.newListByTrafficControllerPager.remove(req) + } + return resp, nil +} + +func (s *SecurityPoliciesInterfaceServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if s.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceNetworking/trafficControllers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/securityPolicy/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicenetworking.SecurityPolicyUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + trafficControllerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("trafficControllerName")]) + if err != nil { + return nil, err + } + securityPolicyNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("securityPolicyName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Update(req.Context(), resourceGroupNameParam, trafficControllerNameParam, securityPolicyNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SecurityPolicy, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/server_factory.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/server_factory.go index c5efb1fb7ba1..eff1829529d6 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/server_factory.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/server_factory.go @@ -22,6 +22,7 @@ type ServerFactory struct { AssociationsInterfaceServer AssociationsInterfaceServer FrontendsInterfaceServer FrontendsInterfaceServer OperationsServer OperationsServer + SecurityPoliciesInterfaceServer SecurityPoliciesInterfaceServer TrafficControllerInterfaceServer TrafficControllerInterfaceServer } @@ -42,6 +43,7 @@ type ServerFactoryTransport struct { trAssociationsInterfaceServer *AssociationsInterfaceServerTransport trFrontendsInterfaceServer *FrontendsInterfaceServerTransport trOperationsServer *OperationsServerTransport + trSecurityPoliciesInterfaceServer *SecurityPoliciesInterfaceServerTransport trTrafficControllerInterfaceServer *TrafficControllerInterfaceServerTransport } @@ -71,6 +73,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) + case "SecurityPoliciesInterfaceClient": + initServer(s, &s.trSecurityPoliciesInterfaceServer, func() *SecurityPoliciesInterfaceServerTransport { + return NewSecurityPoliciesInterfaceServerTransport(&s.srv.SecurityPoliciesInterfaceServer) + }) + resp, err = s.trSecurityPoliciesInterfaceServer.Do(req) case "TrafficControllerInterfaceClient": initServer(s, &s.trTrafficControllerInterfaceServer, func() *TrafficControllerInterfaceServerTransport { return NewTrafficControllerInterfaceServerTransport(&s.srv.TrafficControllerInterfaceServer) diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/time_rfc3339.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/time_rfc3339.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/trafficcontrollerinterface_server.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/trafficcontrollerinterface_server.go index 993d37add085..6934459ff187 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/trafficcontrollerinterface_server.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/fake/trafficcontrollerinterface_server.go @@ -29,7 +29,7 @@ type TrafficControllerInterfaceServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, trafficControllerName string, resource armservicenetworking.TrafficController, options *armservicenetworking.TrafficControllerInterfaceClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armservicenetworking.TrafficControllerInterfaceClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method TrafficControllerInterfaceClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, trafficControllerName string, options *armservicenetworking.TrafficControllerInterfaceClientBeginDeleteOptions) (resp azfake.PollerResponder[armservicenetworking.TrafficControllerInterfaceClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method TrafficControllerInterfaceClient.Get @@ -188,9 +188,9 @@ func (t *TrafficControllerInterfaceServerTransport) dispatchBeginDelete(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { t.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { t.beginDelete.remove(req) diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client.go index b69b46d6c449..90015a6dbaf3 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client.go @@ -46,7 +46,7 @@ func NewFrontendsInterfaceClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Create a Frontend // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - frontendName - Frontends @@ -74,7 +74,7 @@ func (client *FrontendsInterfaceClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create a Frontend // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview func (client *FrontendsInterfaceClient) createOrUpdate(ctx context.Context, resourceGroupName string, trafficControllerName string, frontendName string, resource Frontend, options *FrontendsInterfaceClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FrontendsInterfaceClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *FrontendsInterfaceClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -132,7 +132,7 @@ func (client *FrontendsInterfaceClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Delete a Frontend // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - frontendName - Frontends @@ -159,7 +159,7 @@ func (client *FrontendsInterfaceClient) BeginDelete(ctx context.Context, resourc // Delete - Delete a Frontend // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview func (client *FrontendsInterfaceClient) deleteOperation(ctx context.Context, resourceGroupName string, trafficControllerName string, frontendName string, options *FrontendsInterfaceClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FrontendsInterfaceClient.BeginDelete" @@ -174,7 +174,7 @@ func (client *FrontendsInterfaceClient) deleteOperation(ctx context.Context, res if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -205,7 +205,7 @@ func (client *FrontendsInterfaceClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *FrontendsInterfaceClient) deleteCreateRequest(ctx context.Context, // Get - Get a Frontend // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - frontendName - Frontends @@ -265,7 +265,7 @@ func (client *FrontendsInterfaceClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *FrontendsInterfaceClient) getHandleResponse(resp *http.Response) ( // NewListByTrafficControllerPager - List Frontend resources by TrafficController // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - options - FrontendsInterfaceClientListByTrafficControllerOptions contains the optional parameters for the FrontendsInterfaceClient.NewListByTrafficControllerPager @@ -330,7 +330,7 @@ func (client *FrontendsInterfaceClient) listByTrafficControllerCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +348,7 @@ func (client *FrontendsInterfaceClient) listByTrafficControllerHandleResponse(re // Update - Update a Frontend // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - frontendName - Frontends @@ -401,7 +401,7 @@ func (client *FrontendsInterfaceClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client_example_test.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client_example_test.go deleted file mode 100644 index 261369fbe915..000000000000 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/frontendsinterface_client_example_test.go +++ /dev/null @@ -1,175 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicenetworking_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicenetworking/armservicenetworking" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendsGet.json -func ExampleFrontendsInterfaceClient_NewListByTrafficControllerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFrontendsInterfaceClient().NewListByTrafficControllerPager("rg1", "tc1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FrontendListResult = armservicenetworking.FrontendListResult{ - // Value: []*armservicenetworking.Frontend{ - // { - // Name: to.Ptr("fe1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/frontends"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.FrontendProperties{ - // Fqdn: to.Ptr("test.net"), - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendGet.json -func ExampleFrontendsInterfaceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFrontendsInterfaceClient().Get(ctx, "rg1", "tc1", "fe1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Frontend = armservicenetworking.Frontend{ - // Name: to.Ptr("fe1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/frontends"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.FrontendProperties{ - // Fqdn: to.Ptr("test.net"), - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendPut.json -func ExampleFrontendsInterfaceClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFrontendsInterfaceClient().BeginCreateOrUpdate(ctx, "rg1", "tc1", "fe1", armservicenetworking.Frontend{ - Location: to.Ptr("NorthCentralUS"), - Properties: &armservicenetworking.FrontendProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Frontend = armservicenetworking.Frontend{ - // Name: to.Ptr("fe1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/frontends"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.FrontendProperties{ - // Fqdn: to.Ptr("test.net"), - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendPatch.json -func ExampleFrontendsInterfaceClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFrontendsInterfaceClient().Update(ctx, "rg1", "tc1", "fe1", armservicenetworking.FrontendUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Frontend = armservicenetworking.Frontend{ - // Name: to.Ptr("fe1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/frontends"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // Location: to.Ptr("NorthCentralUS"), - // Properties: &armservicenetworking.FrontendProperties{ - // Fqdn: to.Ptr("test.net"), - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendDelete.json -func ExampleFrontendsInterfaceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFrontendsInterfaceClient().BeginDelete(ctx, "rg1", "tc1", "fe1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/go.mod b/sdk/resourcemanager/servicenetworking/armservicenetworking/go.mod index 484babbec608..af302b2f8eae 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/go.mod +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicenetworking/a go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/go.sum b/sdk/resourcemanager/servicenetworking/armservicenetworking/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/go.sum +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/models.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/models.go index 2111d1db8771..7723667482a0 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/models.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/models.go @@ -69,7 +69,7 @@ type AssociationSubnetUpdate struct { // AssociationUpdate - The type used for update operations of the Association. type AssociationUpdate struct { - // The updatable properties of the Association. + // The resource-specific properties for this resource. Properties *AssociationUpdateProperties // Resource tags. @@ -85,7 +85,7 @@ type AssociationUpdateProperties struct { Subnet *AssociationSubnetUpdate } -// Frontend Subresource of Traffic Controller. +// Frontend Sub Resource of Traffic Controller. type Frontend struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -188,6 +188,78 @@ type ResourceID struct { ID *string } +// SecurityPolicy Subresource of Traffic Controller. +type SecurityPolicy struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // The resource-specific properties for this resource. + Properties *SecurityPolicyProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// SecurityPolicyConfigurations Subresource of Traffic Controller. +type SecurityPolicyConfigurations struct { + // Contains reference to a WAF-type security policy that is applied at the Traffic Controller level. + WafSecurityPolicy *WafSecurityPolicy +} + +// SecurityPolicyConfigurationsUpdate - SecurityPolicyConfigurations Subresource of Traffic Controller. +type SecurityPolicyConfigurationsUpdate struct { + // Contains reference to a WAF-type security policy that is applied at the Traffic Controller level. + WafSecurityPolicy *WafSecurityPolicyUpdate +} + +// SecurityPolicyListResult - The response of a SecurityPolicy list operation. +type SecurityPolicyListResult struct { + // REQUIRED; The SecurityPolicy items on this page + Value []*SecurityPolicy + + // The link to the next page of items + NextLink *string +} + +// SecurityPolicyProperties - SecurityPolicy Properties. +type SecurityPolicyProperties struct { + // Web Application Firewall Policy of the Traffic Controller Security Policy + WafPolicy *WafPolicy + + // READ-ONLY; Type of the Traffic Controller Security Policy + PolicyType *PolicyType + + // READ-ONLY; Provisioning State of Traffic Controller SecurityPolicy Resource + ProvisioningState *ProvisioningState +} + +// SecurityPolicyUpdate - The type used for update operations of the SecurityPolicy. +type SecurityPolicyUpdate struct { + // The resource-specific properties for this resource. + Properties *SecurityPolicyUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// SecurityPolicyUpdateProperties - The updatable properties of the SecurityPolicy. +type SecurityPolicyUpdateProperties struct { + // Web Application Firewall Policy of the Traffic Controller Security Policy + WafPolicy *WafPolicyUpdate +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -244,6 +316,9 @@ type TrafficControllerListResult struct { // TrafficControllerProperties - Traffic Controller Properties. type TrafficControllerProperties struct { + // Security Policy Configuration + SecurityPolicyConfigurations *SecurityPolicyConfigurations + // READ-ONLY; Associations References List Associations []*ResourceID @@ -255,10 +330,46 @@ type TrafficControllerProperties struct { // READ-ONLY; The status of the last operation. ProvisioningState *ProvisioningState + + // READ-ONLY; Security Policies References List + SecurityPolicies []*ResourceID } // TrafficControllerUpdate - The type used for update operations of the TrafficController. type TrafficControllerUpdate struct { + // The resource-specific properties for this resource. + Properties *TrafficControllerUpdateProperties + // Resource tags. Tags map[string]*string } + +// TrafficControllerUpdateProperties - The updatable properties of the TrafficController. +type TrafficControllerUpdateProperties struct { + // Security Policy Configuration + SecurityPolicyConfigurations *SecurityPolicyConfigurationsUpdate +} + +// WafPolicy - Web Application Firewall Policy +type WafPolicy struct { + // REQUIRED; Resource ID of the WAF + ID *string +} + +// WafPolicyUpdate - Web Application Firewall Policy +type WafPolicyUpdate struct { + // Resource ID of the WAF + ID *string +} + +// WafSecurityPolicy - Web Application Firewall Security Policy +type WafSecurityPolicy struct { + // REQUIRED; Resource ID of the Waf Security Policy + ID *string +} + +// WafSecurityPolicyUpdate - Web Application Firewall Security Policy +type WafSecurityPolicyUpdate struct { + // Resource ID of the Waf Security Policy + ID *string +} diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/models_serde.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/models_serde.go index e595b80706d0..bbc64dfc3412 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/models_serde.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/models_serde.go @@ -528,6 +528,235 @@ func (r *ResourceID) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicy. +func (s SecurityPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicy. +func (s *SecurityPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyConfigurations. +func (s SecurityPolicyConfigurations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "wafSecurityPolicy", s.WafSecurityPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyConfigurations. +func (s *SecurityPolicyConfigurations) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "wafSecurityPolicy": + err = unpopulate(val, "WafSecurityPolicy", &s.WafSecurityPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyConfigurationsUpdate. +func (s SecurityPolicyConfigurationsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "wafSecurityPolicy", s.WafSecurityPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyConfigurationsUpdate. +func (s *SecurityPolicyConfigurationsUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "wafSecurityPolicy": + err = unpopulate(val, "WafSecurityPolicy", &s.WafSecurityPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyListResult. +func (s SecurityPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyListResult. +func (s *SecurityPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyProperties. +func (s SecurityPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "policyType", s.PolicyType) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "wafPolicy", s.WafPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyProperties. +func (s *SecurityPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "policyType": + err = unpopulate(val, "PolicyType", &s.PolicyType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "wafPolicy": + err = unpopulate(val, "WafPolicy", &s.WafPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyUpdate. +func (s SecurityPolicyUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyUpdate. +func (s *SecurityPolicyUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyUpdateProperties. +func (s SecurityPolicyUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "wafPolicy", s.WafPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyUpdateProperties. +func (s *SecurityPolicyUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "wafPolicy": + err = unpopulate(val, "WafPolicy", &s.WafPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -664,6 +893,8 @@ func (t TrafficControllerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "configurationEndpoints", t.ConfigurationEndpoints) populate(objectMap, "frontends", t.Frontends) populate(objectMap, "provisioningState", t.ProvisioningState) + populate(objectMap, "securityPolicies", t.SecurityPolicies) + populate(objectMap, "securityPolicyConfigurations", t.SecurityPolicyConfigurations) return json.Marshal(objectMap) } @@ -688,6 +919,12 @@ func (t *TrafficControllerProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) delete(rawMsg, key) + case "securityPolicies": + err = unpopulate(val, "SecurityPolicies", &t.SecurityPolicies) + delete(rawMsg, key) + case "securityPolicyConfigurations": + err = unpopulate(val, "SecurityPolicyConfigurations", &t.SecurityPolicyConfigurations) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -699,6 +936,7 @@ func (t *TrafficControllerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrafficControllerUpdate. func (t TrafficControllerUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "properties", t.Properties) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } @@ -712,6 +950,9 @@ func (t *TrafficControllerUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) @@ -723,6 +964,141 @@ func (t *TrafficControllerUpdate) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TrafficControllerUpdateProperties. +func (t TrafficControllerUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "securityPolicyConfigurations", t.SecurityPolicyConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrafficControllerUpdateProperties. +func (t *TrafficControllerUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "securityPolicyConfigurations": + err = unpopulate(val, "SecurityPolicyConfigurations", &t.SecurityPolicyConfigurations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafPolicy. +func (w WafPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafPolicy. +func (w *WafPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafPolicyUpdate. +func (w WafPolicyUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafPolicyUpdate. +func (w *WafPolicyUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafSecurityPolicy. +func (w WafSecurityPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafSecurityPolicy. +func (w *WafSecurityPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafSecurityPolicyUpdate. +func (w WafSecurityPolicyUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafSecurityPolicyUpdate. +func (w *WafSecurityPolicyUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return @@ -734,7 +1110,7 @@ func populate(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client.go index 1000bf18cf09..ae25aca1116d 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client_example_test.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client_example_test.go deleted file mode 100644 index 734431ef05cd..000000000000 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/operations_client_example_test.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicenetworking_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicenetworking/armservicenetworking" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armservicenetworking.OperationListResult{ - // Value: []*armservicenetworking.Operation{ - // { - // Name: to.Ptr("Microsoft.ServiceNetworking/trafficControllers/read"), - // Display: &armservicenetworking.OperationDisplay{ - // Description: to.Ptr("Traffic Controller is a L7 Load Balancing solution for a Multi Cluster setup"), - // Operation: to.Ptr("Get Traffic Controller configuration"), - // Provider: to.Ptr("Microsoft Service Networking"), - // Resource: to.Ptr("Traffic Controller"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr(armservicenetworking.OriginUserSystem), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/options.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/options.go index 35b047221323..c25d85b968fa 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/options.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/options.go @@ -73,6 +73,38 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } +// SecurityPoliciesInterfaceClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.BeginCreateOrUpdate +// method. +type SecurityPoliciesInterfaceClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPoliciesInterfaceClientBeginDeleteOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.BeginDelete +// method. +type SecurityPoliciesInterfaceClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPoliciesInterfaceClientGetOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.Get +// method. +type SecurityPoliciesInterfaceClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPoliciesInterfaceClientListByTrafficControllerOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.NewListByTrafficControllerPager +// method. +type SecurityPoliciesInterfaceClientListByTrafficControllerOptions struct { + // placeholder for future optional parameters +} + +// SecurityPoliciesInterfaceClientUpdateOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.Update +// method. +type SecurityPoliciesInterfaceClientUpdateOptions struct { + // placeholder for future optional parameters +} + // TrafficControllerInterfaceClientBeginCreateOrUpdateOptions contains the optional parameters for the TrafficControllerInterfaceClient.BeginCreateOrUpdate // method. type TrafficControllerInterfaceClientBeginCreateOrUpdateOptions struct { diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/response_types.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/responses.go similarity index 76% rename from sdk/resourcemanager/servicenetworking/armservicenetworking/response_types.go rename to sdk/resourcemanager/servicenetworking/armservicenetworking/responses.go index 3cd51f53b009..6bfb68611c48 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/response_types.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/responses.go @@ -39,7 +39,7 @@ type AssociationsInterfaceClientUpdateResponse struct { // FrontendsInterfaceClientCreateOrUpdateResponse contains the response from method FrontendsInterfaceClient.BeginCreateOrUpdate. type FrontendsInterfaceClientCreateOrUpdateResponse struct { - // Frontend Subresource of Traffic Controller. + // Frontend Sub Resource of Traffic Controller. Frontend } @@ -50,7 +50,7 @@ type FrontendsInterfaceClientDeleteResponse struct { // FrontendsInterfaceClientGetResponse contains the response from method FrontendsInterfaceClient.Get. type FrontendsInterfaceClientGetResponse struct { - // Frontend Subresource of Traffic Controller. + // Frontend Sub Resource of Traffic Controller. Frontend } @@ -62,7 +62,7 @@ type FrontendsInterfaceClientListByTrafficControllerResponse struct { // FrontendsInterfaceClientUpdateResponse contains the response from method FrontendsInterfaceClient.Update. type FrontendsInterfaceClientUpdateResponse struct { - // Frontend Subresource of Traffic Controller. + // Frontend Sub Resource of Traffic Controller. Frontend } @@ -72,6 +72,35 @@ type OperationsClientListResponse struct { OperationListResult } +// SecurityPoliciesInterfaceClientCreateOrUpdateResponse contains the response from method SecurityPoliciesInterfaceClient.BeginCreateOrUpdate. +type SecurityPoliciesInterfaceClientCreateOrUpdateResponse struct { + // SecurityPolicy Subresource of Traffic Controller. + SecurityPolicy +} + +// SecurityPoliciesInterfaceClientDeleteResponse contains the response from method SecurityPoliciesInterfaceClient.BeginDelete. +type SecurityPoliciesInterfaceClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPoliciesInterfaceClientGetResponse contains the response from method SecurityPoliciesInterfaceClient.Get. +type SecurityPoliciesInterfaceClientGetResponse struct { + // SecurityPolicy Subresource of Traffic Controller. + SecurityPolicy +} + +// SecurityPoliciesInterfaceClientListByTrafficControllerResponse contains the response from method SecurityPoliciesInterfaceClient.NewListByTrafficControllerPager. +type SecurityPoliciesInterfaceClientListByTrafficControllerResponse struct { + // The response of a SecurityPolicy list operation. + SecurityPolicyListResult +} + +// SecurityPoliciesInterfaceClientUpdateResponse contains the response from method SecurityPoliciesInterfaceClient.Update. +type SecurityPoliciesInterfaceClientUpdateResponse struct { + // SecurityPolicy Subresource of Traffic Controller. + SecurityPolicy +} + // TrafficControllerInterfaceClientCreateOrUpdateResponse contains the response from method TrafficControllerInterfaceClient.BeginCreateOrUpdate. type TrafficControllerInterfaceClientCreateOrUpdateResponse struct { // Concrete tracked resource types can be created by aliasing this type using a specific property type. diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/securitypoliciesinterface_client.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/securitypoliciesinterface_client.go new file mode 100644 index 000000000000..aa1d95e8f095 --- /dev/null +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/securitypoliciesinterface_client.go @@ -0,0 +1,421 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armservicenetworking + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SecurityPoliciesInterfaceClient contains the methods for the SecurityPoliciesInterface group. +// Don't use this type directly, use NewSecurityPoliciesInterfaceClient() instead. +type SecurityPoliciesInterfaceClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSecurityPoliciesInterfaceClient creates a new instance of SecurityPoliciesInterfaceClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPoliciesInterfaceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPoliciesInterfaceClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPoliciesInterfaceClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a SecurityPolicy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - trafficControllerName - traffic controller name for path +// - securityPolicyName - SecurityPolicy +// - resource - Resource create parameters. +// - options - SecurityPoliciesInterfaceClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.BeginCreateOrUpdate +// method. +func (client *SecurityPoliciesInterfaceClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, resource SecurityPolicy, options *SecurityPoliciesInterfaceClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityPoliciesInterfaceClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, trafficControllerName, securityPolicyName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesInterfaceClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SecurityPoliciesInterfaceClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a SecurityPolicy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-01-preview +func (client *SecurityPoliciesInterfaceClient) createOrUpdate(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, resource SecurityPolicy, options *SecurityPoliciesInterfaceClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "SecurityPoliciesInterfaceClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, trafficControllerName, securityPolicyName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPoliciesInterfaceClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, resource SecurityPolicy, options *SecurityPoliciesInterfaceClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicy/{securityPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if trafficControllerName == "" { + return nil, errors.New("parameter trafficControllerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trafficControllerName}", url.PathEscape(trafficControllerName)) + if securityPolicyName == "" { + return nil, errors.New("parameter securityPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPolicyName}", url.PathEscape(securityPolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete a SecurityPolicy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - trafficControllerName - traffic controller name for path +// - securityPolicyName - SecurityPolicy +// - options - SecurityPoliciesInterfaceClientBeginDeleteOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.BeginDelete +// method. +func (client *SecurityPoliciesInterfaceClient) BeginDelete(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, options *SecurityPoliciesInterfaceClientBeginDeleteOptions) (*runtime.Poller[SecurityPoliciesInterfaceClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, trafficControllerName, securityPolicyName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesInterfaceClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SecurityPoliciesInterfaceClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a SecurityPolicy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-01-preview +func (client *SecurityPoliciesInterfaceClient) deleteOperation(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, options *SecurityPoliciesInterfaceClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "SecurityPoliciesInterfaceClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, trafficControllerName, securityPolicyName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPoliciesInterfaceClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, options *SecurityPoliciesInterfaceClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicy/{securityPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if trafficControllerName == "" { + return nil, errors.New("parameter trafficControllerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trafficControllerName}", url.PathEscape(trafficControllerName)) + if securityPolicyName == "" { + return nil, errors.New("parameter securityPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPolicyName}", url.PathEscape(securityPolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a SecurityPolicy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - trafficControllerName - traffic controller name for path +// - securityPolicyName - SecurityPolicy +// - options - SecurityPoliciesInterfaceClientGetOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.Get +// method. +func (client *SecurityPoliciesInterfaceClient) Get(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, options *SecurityPoliciesInterfaceClientGetOptions) (SecurityPoliciesInterfaceClientGetResponse, error) { + var err error + const operationName = "SecurityPoliciesInterfaceClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, trafficControllerName, securityPolicyName, options) + if err != nil { + return SecurityPoliciesInterfaceClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPoliciesInterfaceClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPoliciesInterfaceClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPoliciesInterfaceClient) getCreateRequest(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, options *SecurityPoliciesInterfaceClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicy/{securityPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if trafficControllerName == "" { + return nil, errors.New("parameter trafficControllerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trafficControllerName}", url.PathEscape(trafficControllerName)) + if securityPolicyName == "" { + return nil, errors.New("parameter securityPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPolicyName}", url.PathEscape(securityPolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPoliciesInterfaceClient) getHandleResponse(resp *http.Response) (SecurityPoliciesInterfaceClientGetResponse, error) { + result := SecurityPoliciesInterfaceClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPolicy); err != nil { + return SecurityPoliciesInterfaceClientGetResponse{}, err + } + return result, nil +} + +// NewListByTrafficControllerPager - List SecurityPolicy resources by TrafficController +// +// Generated from API version 2024-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - trafficControllerName - traffic controller name for path +// - options - SecurityPoliciesInterfaceClientListByTrafficControllerOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.NewListByTrafficControllerPager +// method. +func (client *SecurityPoliciesInterfaceClient) NewListByTrafficControllerPager(resourceGroupName string, trafficControllerName string, options *SecurityPoliciesInterfaceClientListByTrafficControllerOptions) *runtime.Pager[SecurityPoliciesInterfaceClientListByTrafficControllerResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPoliciesInterfaceClientListByTrafficControllerResponse]{ + More: func(page SecurityPoliciesInterfaceClientListByTrafficControllerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPoliciesInterfaceClientListByTrafficControllerResponse) (SecurityPoliciesInterfaceClientListByTrafficControllerResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPoliciesInterfaceClient.NewListByTrafficControllerPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByTrafficControllerCreateRequest(ctx, resourceGroupName, trafficControllerName, options) + }, nil) + if err != nil { + return SecurityPoliciesInterfaceClientListByTrafficControllerResponse{}, err + } + return client.listByTrafficControllerHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByTrafficControllerCreateRequest creates the ListByTrafficController request. +func (client *SecurityPoliciesInterfaceClient) listByTrafficControllerCreateRequest(ctx context.Context, resourceGroupName string, trafficControllerName string, options *SecurityPoliciesInterfaceClientListByTrafficControllerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicy" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if trafficControllerName == "" { + return nil, errors.New("parameter trafficControllerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trafficControllerName}", url.PathEscape(trafficControllerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByTrafficControllerHandleResponse handles the ListByTrafficController response. +func (client *SecurityPoliciesInterfaceClient) listByTrafficControllerHandleResponse(resp *http.Response) (SecurityPoliciesInterfaceClientListByTrafficControllerResponse, error) { + result := SecurityPoliciesInterfaceClientListByTrafficControllerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPolicyListResult); err != nil { + return SecurityPoliciesInterfaceClientListByTrafficControllerResponse{}, err + } + return result, nil +} + +// Update - Update a SecurityPolicy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - trafficControllerName - traffic controller name for path +// - securityPolicyName - SecurityPolicy +// - properties - The resource properties to be updated. +// - options - SecurityPoliciesInterfaceClientUpdateOptions contains the optional parameters for the SecurityPoliciesInterfaceClient.Update +// method. +func (client *SecurityPoliciesInterfaceClient) Update(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, properties SecurityPolicyUpdate, options *SecurityPoliciesInterfaceClientUpdateOptions) (SecurityPoliciesInterfaceClientUpdateResponse, error) { + var err error + const operationName = "SecurityPoliciesInterfaceClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, trafficControllerName, securityPolicyName, properties, options) + if err != nil { + return SecurityPoliciesInterfaceClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPoliciesInterfaceClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPoliciesInterfaceClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *SecurityPoliciesInterfaceClient) updateCreateRequest(ctx context.Context, resourceGroupName string, trafficControllerName string, securityPolicyName string, properties SecurityPolicyUpdate, options *SecurityPoliciesInterfaceClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicy/{securityPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if trafficControllerName == "" { + return nil, errors.New("parameter trafficControllerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trafficControllerName}", url.PathEscape(trafficControllerName)) + if securityPolicyName == "" { + return nil, errors.New("parameter securityPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPolicyName}", url.PathEscape(securityPolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *SecurityPoliciesInterfaceClient) updateHandleResponse(resp *http.Response) (SecurityPoliciesInterfaceClientUpdateResponse, error) { + result := SecurityPoliciesInterfaceClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPolicy); err != nil { + return SecurityPoliciesInterfaceClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/time_rfc3339.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/time_rfc3339.go index 8ad85197d842..e2b025f5d16c 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/time_rfc3339.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client.go index be066259f3b3..7a6f8a7978ef 100644 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client.go +++ b/sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client.go @@ -46,7 +46,7 @@ func NewTrafficControllerInterfaceClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Create a TrafficController // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *TrafficControllerInterfaceClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Create a TrafficController // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview func (client *TrafficControllerInterfaceClient) createOrUpdate(ctx context.Context, resourceGroupName string, trafficControllerName string, resource TrafficController, options *TrafficControllerInterfaceClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "TrafficControllerInterfaceClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *TrafficControllerInterfaceClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *TrafficControllerInterfaceClient) createOrUpdateCreateRequest(ctx // BeginDelete - Delete a TrafficController // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - options - TrafficControllerInterfaceClientBeginDeleteOptions contains the optional parameters for the TrafficControllerInterfaceClient.BeginDelete @@ -153,7 +153,7 @@ func (client *TrafficControllerInterfaceClient) BeginDelete(ctx context.Context, // Delete - Delete a TrafficController // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview func (client *TrafficControllerInterfaceClient) deleteOperation(ctx context.Context, resourceGroupName string, trafficControllerName string, options *TrafficControllerInterfaceClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TrafficControllerInterfaceClient.BeginDelete" @@ -168,7 +168,7 @@ func (client *TrafficControllerInterfaceClient) deleteOperation(ctx context.Cont if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -195,7 +195,7 @@ func (client *TrafficControllerInterfaceClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,7 @@ func (client *TrafficControllerInterfaceClient) deleteCreateRequest(ctx context. // Get - Get a TrafficController // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - options - TrafficControllerInterfaceClientGetOptions contains the optional parameters for the TrafficControllerInterfaceClient.Get @@ -251,7 +251,7 @@ func (client *TrafficControllerInterfaceClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *TrafficControllerInterfaceClient) getHandleResponse(resp *http.Res // NewListByResourceGroupPager - List TrafficController resources by resource group // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - TrafficControllerInterfaceClientListByResourceGroupOptions contains the optional parameters for the TrafficControllerInterfaceClient.NewListByResourceGroupPager // method. @@ -311,7 +311,7 @@ func (client *TrafficControllerInterfaceClient) listByResourceGroupCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *TrafficControllerInterfaceClient) listByResourceGroupHandleRespons // NewListBySubscriptionPager - List TrafficController resources by subscription ID // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - options - TrafficControllerInterfaceClientListBySubscriptionOptions contains the optional parameters for the TrafficControllerInterfaceClient.NewListBySubscriptionPager // method. func (client *TrafficControllerInterfaceClient) NewListBySubscriptionPager(options *TrafficControllerInterfaceClientListBySubscriptionOptions) *runtime.Pager[TrafficControllerInterfaceClientListBySubscriptionResponse] { @@ -366,7 +366,7 @@ func (client *TrafficControllerInterfaceClient) listBySubscriptionCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +384,7 @@ func (client *TrafficControllerInterfaceClient) listBySubscriptionHandleResponse // Update - Update a TrafficController // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trafficControllerName - traffic controller name for path // - properties - The resource properties to be updated. @@ -432,7 +432,7 @@ func (client *TrafficControllerInterfaceClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client_example_test.go b/sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client_example_test.go deleted file mode 100644 index 3d753cf55300..000000000000 --- a/sdk/resourcemanager/servicenetworking/armservicenetworking/trafficcontrollerinterface_client_example_test.go +++ /dev/null @@ -1,279 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicenetworking_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicenetworking/armservicenetworking" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllersGetList.json -func ExampleTrafficControllerInterfaceClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTrafficControllerInterfaceClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TrafficControllerListResult = armservicenetworking.TrafficControllerListResult{ - // Value: []*armservicenetworking.TrafficController{ - // { - // Name: to.Ptr("tc1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1"), - // Location: to.Ptr("NorthCentralUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armservicenetworking.TrafficControllerProperties{ - // Associations: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1"), - // }}, - // ConfigurationEndpoints: []*string{ - // to.Ptr("abc.trafficcontroller.azure.net")}, - // Frontends: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // }}, - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllersGet.json -func ExampleTrafficControllerInterfaceClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTrafficControllerInterfaceClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TrafficControllerListResult = armservicenetworking.TrafficControllerListResult{ - // Value: []*armservicenetworking.TrafficController{ - // { - // Name: to.Ptr("tc1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1"), - // Location: to.Ptr("NorthCentralUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armservicenetworking.TrafficControllerProperties{ - // Associations: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1"), - // }}, - // ConfigurationEndpoints: []*string{ - // to.Ptr("abc.trafficcontroller.azure.net")}, - // Frontends: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // }}, - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerGet.json -func ExampleTrafficControllerInterfaceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTrafficControllerInterfaceClient().Get(ctx, "rg1", "tc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TrafficController = armservicenetworking.TrafficController{ - // Name: to.Ptr("tc1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1"), - // Location: to.Ptr("NorthCentralUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armservicenetworking.TrafficControllerProperties{ - // Associations: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1"), - // }}, - // ConfigurationEndpoints: []*string{ - // to.Ptr("abc.trafficcontroller.azure.net")}, - // Frontends: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // }}, - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerPut.json -func ExampleTrafficControllerInterfaceClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTrafficControllerInterfaceClient().BeginCreateOrUpdate(ctx, "rg1", "tc1", armservicenetworking.TrafficController{ - Location: to.Ptr("NorthCentralUS"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TrafficController = armservicenetworking.TrafficController{ - // Name: to.Ptr("tc1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1"), - // Location: to.Ptr("NorthCentralUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armservicenetworking.TrafficControllerProperties{ - // Associations: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1"), - // }}, - // ConfigurationEndpoints: []*string{ - // to.Ptr("abc.trafficcontroller.azure.net")}, - // Frontends: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // }}, - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerPatch.json -func ExampleTrafficControllerInterfaceClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTrafficControllerInterfaceClient().Update(ctx, "rg1", "tc1", armservicenetworking.TrafficControllerUpdate{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TrafficController = armservicenetworking.TrafficController{ - // Name: to.Ptr("tc1"), - // Type: to.Ptr("Microsoft.ServiceNetworking/trafficControllers"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1"), - // Location: to.Ptr("NorthCentralUS"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armservicenetworking.TrafficControllerProperties{ - // Associations: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1"), - // }}, - // ConfigurationEndpoints: []*string{ - // to.Ptr("abc.trafficcontroller.azure.net")}, - // Frontends: []*armservicenetworking.ResourceID{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1"), - // }}, - // ProvisioningState: to.Ptr(armservicenetworking.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerDelete.json -func ExampleTrafficControllerInterfaceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicenetworking.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTrafficControllerInterfaceClient().BeginDelete(ctx, "rg1", "tc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sphere/armsphere/CHANGELOG.md b/sdk/resourcemanager/sphere/armsphere/CHANGELOG.md index ba549517a435..05f1f6d2b1cc 100644 --- a/sdk/resourcemanager/sphere/armsphere/CHANGELOG.md +++ b/sdk/resourcemanager/sphere/armsphere/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2024-08-27) +### Other Changes + + ## 1.0.0 (2024-03-26) ### Breaking Changes diff --git a/sdk/resourcemanager/sphere/armsphere/autorest.md b/sdk/resourcemanager/sphere/armsphere/autorest.md index be8292df2b98..055882c587ff 100644 --- a/sdk/resourcemanager/sphere/armsphere/autorest.md +++ b/sdk/resourcemanager/sphere/armsphere/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sphere/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sphere/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2024-04-01 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/sphere/armsphere/catalogs_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/catalogs_client_example_test.go deleted file mode 100644 index 51e5ae59813b..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/catalogs_client_example_test.go +++ /dev/null @@ -1,432 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsSub.json -func ExampleCatalogsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCatalogsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CatalogListResult = armsphere.CatalogListResult{ - // Value: []*armsphere.Catalog{ - // { - // Name: to.Ptr("MyCatalog1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1"), - // Location: to.Ptr("global"), - // }, - // { - // Name: to.Ptr("MyCatalog2"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup2/providers/Microsoft.AzureSphere/catalogs/MyCatalog2"), - // Location: to.Ptr("global"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsRG.json -func ExampleCatalogsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCatalogsClient().NewListByResourceGroupPager("MyResourceGroup1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CatalogListResult = armsphere.CatalogListResult{ - // Value: []*armsphere.Catalog{ - // { - // Name: to.Ptr("MyCatalog1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1"), - // Location: to.Ptr("global"), - // }, - // { - // Name: to.Ptr("MyCatalog2"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog2"), - // Location: to.Ptr("global"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalog.json -func ExampleCatalogsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCatalogsClient().Get(ctx, "MyResourceGroup1", "MyCatalog1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Catalog = armsphere.Catalog{ - // Name: to.Ptr("MyCatalog1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1"), - // Location: to.Ptr("global"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutCatalog.json -func ExampleCatalogsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCatalogsClient().BeginCreateOrUpdate(ctx, "MyResourceGroup1", "MyCatalog1", armsphere.Catalog{ - Location: to.Ptr("global"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Catalog = armsphere.Catalog{ - // Name: to.Ptr("MyCatalog1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1"), - // Location: to.Ptr("global"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchCatalog.json -func ExampleCatalogsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCatalogsClient().Update(ctx, "MyResourceGroup1", "MyCatalog1", armsphere.CatalogUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Catalog = armsphere.Catalog{ - // Name: to.Ptr("MyCatalog1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1"), - // Location: to.Ptr("global"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteCatalog.json -func ExampleCatalogsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCatalogsClient().BeginDelete(ctx, "MyResourceGroup1", "MyCatalog1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesCatalog.json -func ExampleCatalogsClient_CountDevices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCatalogsClient().CountDevices(ctx, "MyResourceGroup1", "MyCatalog1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CountDevicesResponse = armsphere.CountDevicesResponse{ - // Value: to.Ptr[int32](3), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDeploymentsByCatalog.json -func ExampleCatalogsClient_NewListDeploymentsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCatalogsClient().NewListDeploymentsPager("MyResourceGroup1", "MyCatalog1", &armsphere.CatalogsClientListDeploymentsOptions{Filter: nil, - Top: nil, - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeploymentListResult = armsphere.DeploymentListResult{ - // Value: []*armsphere.Deployment{ - // { - // Name: to.Ptr("DeploymentName1111"), - // Properties: &armsphere.DeploymentProperties{ - // }, - // }, - // { - // Name: to.Ptr("DeploymentName1121"), - // Properties: &armsphere.DeploymentProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDeviceGroupsCatalog.json -func ExampleCatalogsClient_NewListDeviceGroupsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCatalogsClient().NewListDeviceGroupsPager("MyResourceGroup1", "MyCatalog1", armsphere.ListDeviceGroupsRequest{ - DeviceGroupName: to.Ptr("MyDeviceGroup1"), - }, &armsphere.CatalogsClientListDeviceGroupsOptions{Filter: nil, - Top: nil, - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceGroupListResult = armsphere.DeviceGroupListResult{ - // Value: []*armsphere.DeviceGroup{ - // { - // Name: to.Ptr("MyDeviceGroup1"), - // Type: to.Ptr("microsoft.azureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup1"), - // }, - // { - // Name: to.Ptr("MyDeviceGroup2"), - // Type: to.Ptr("microsoft.azureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct2/devicegroups/MyDeviceGroup2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDeviceInsightsCatalog.json -func ExampleCatalogsClient_NewListDeviceInsightsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCatalogsClient().NewListDeviceInsightsPager("MyResourceGroup1", "MyCatalog1", &armsphere.CatalogsClientListDeviceInsightsOptions{Filter: nil, - Top: to.Ptr[int32](10), - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PagedDeviceInsight = armsphere.PagedDeviceInsight{ - // Value: []*armsphere.DeviceInsight{ - // { - // Description: to.Ptr("eventDescription1"), - // DeviceID: to.Ptr("eventIdentifier1"), - // EndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-30T23:54:21.960Z"); return t}()), - // EventCategory: to.Ptr("eventCategory1"), - // EventClass: to.Ptr("eventClass1"), - // EventCount: to.Ptr[int32](1), - // EventType: to.Ptr("eventType1"), - // StartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-30T21:51:39.260Z"); return t}()), - // }, - // { - // Description: to.Ptr("eventDescription2"), - // DeviceID: to.Ptr("eventIdentifier2"), - // EndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-07T17:34:12.500Z"); return t}()), - // EventCategory: to.Ptr("eventCategory2"), - // EventClass: to.Ptr("eventClass2"), - // EventCount: to.Ptr[int32](1), - // EventType: to.Ptr("eventType2"), - // StartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-06T12:41:39.260Z"); return t}()), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDevicesByCatalog.json -func ExampleCatalogsClient_NewListDevicesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCatalogsClient().NewListDevicesPager("MyResourceGroup1", "MyCatalog1", &armsphere.CatalogsClientListDevicesOptions{Filter: nil, - Top: nil, - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceListResult = armsphere.DeviceListResult{ - // Value: []*armsphere.Device{ - // { - // Name: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - // Properties: &armsphere.DeviceProperties{ - // }, - // }, - // { - // Name: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - // Properties: &armsphere.DeviceProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostUploadImageCatalog.json -func ExampleCatalogsClient_BeginUploadImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCatalogsClient().BeginUploadImage(ctx, "MyResourceGroup1", "MyCatalog1", armsphere.Image{ - Properties: &armsphere.ImageProperties{ - Image: to.Ptr("bXliYXNlNjRzdHJpbmc="), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sphere/armsphere/certificates_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/certificates_client_example_test.go deleted file mode 100644 index 72b5e6dabbb9..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/certificates_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificates.json -func ExampleCertificatesClient_NewListByCatalogPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificatesClient().NewListByCatalogPager("MyResourceGroup1", "MyCatalog1", &armsphere.CertificatesClientListByCatalogOptions{Filter: nil, - Top: nil, - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CertificateListResult = armsphere.CertificateListResult{ - // Value: []*armsphere.Certificate{ - // }, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificate.json -func ExampleCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().Get(ctx, "MyResourceGroup1", "MyCatalog1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Certificate = armsphere.Certificate{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostRetrieveCatalogCertChain.json -func ExampleCertificatesClient_RetrieveCertChain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().RetrieveCertChain(ctx, "MyResourceGroup1", "MyCatalog1", "active", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateChainResponse = armsphere.CertificateChainResponse{ - // CertificateChain: to.Ptr("ABynaryRepresentationOfTheRequestedCatalogCertificateChain"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostRetrieveProofOfPossessionNonce.json -func ExampleCertificatesClient_RetrieveProofOfPossessionNonce() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().RetrieveProofOfPossessionNonce(ctx, "MyResourceGroup1", "MyCatalog1", "active", armsphere.ProofOfPossessionNonceRequest{ - ProofOfPossessionNonce: to.Ptr("proofOfPossessionNonce"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProofOfPossessionNonceResponse = armsphere.ProofOfPossessionNonceResponse{ - // Certificate: to.Ptr("bXliYXNlNjRzdHJpbmc="), - // } -} diff --git a/sdk/resourcemanager/sphere/armsphere/constants.go b/sdk/resourcemanager/sphere/armsphere/constants.go index 4fa7e90a0c8f..07028e01a14e 100644 --- a/sdk/resourcemanager/sphere/armsphere/constants.go +++ b/sdk/resourcemanager/sphere/armsphere/constants.go @@ -10,7 +10,7 @@ package armsphere const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/sphere/armsphere/deployments_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/deployments_client_example_test.go deleted file mode 100644 index 2c840eda3fb5..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/deployments_client_example_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployments.json -func ExampleDeploymentsClient_NewListByDeviceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeploymentsClient().NewListByDeviceGroupPager("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", &armsphere.DeploymentsClientListByDeviceGroupOptions{Filter: nil, - Top: nil, - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeploymentListResult = armsphere.DeploymentListResult{ - // Value: []*armsphere.Deployment{ - // { - // Name: to.Ptr("MyDeployment1"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/deviceGroups/MyDeviceGroup1/deployments/MyDeployment1"), - // Properties: &armsphere.DeploymentProperties{ - // DeployedImages: []*armsphere.Image{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/images/MyImage1"), - // Properties: &armsphere.ImageProperties{ - // Description: to.Ptr("description"), - // ComponentID: to.Ptr("componentId"), - // Image: to.Ptr("dGVzdGltYWdl"), - // ImageType: to.Ptr(armsphere.ImageType("ImageType")), - // ProvisioningState: to.Ptr(armsphere.ProvisioningStateSucceeded), - // RegionalDataBoundary: to.Ptr(armsphere.RegionalDataBoundaryNone), - // URI: to.Ptr("imageUri"), - // }, - // }}, - // DeploymentDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T21:51:39.269Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployment.json -func ExampleDeploymentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().Get(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", "MyDeployment1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Deployment = armsphere.Deployment{ - // Name: to.Ptr("MyDeployment1"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/deviceGroups/MyDeviceGroup1/deployments/MyDeployment1"), - // Properties: &armsphere.DeploymentProperties{ - // DeployedImages: []*armsphere.Image{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/images/MyImage1"), - // Properties: &armsphere.ImageProperties{ - // Description: to.Ptr("description"), - // ComponentID: to.Ptr("componentId"), - // Image: to.Ptr("dGVzdGltYWdl"), - // ImageType: to.Ptr(armsphere.ImageType("ImageType")), - // ProvisioningState: to.Ptr(armsphere.ProvisioningStateSucceeded), - // RegionalDataBoundary: to.Ptr(armsphere.RegionalDataBoundaryNone), - // URI: to.Ptr("imageUri"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeployment.json -func ExampleDeploymentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", "MyDeployment1", armsphere.Deployment{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Deployment = armsphere.Deployment{ - // Name: to.Ptr("MyDeployment1"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/deviceGroups/MyDeviceGroup1/deployments/MyDeployment1"), - // Properties: &armsphere.DeploymentProperties{ - // DeployedImages: []*armsphere.Image{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/images/MyImage1"), - // Properties: &armsphere.ImageProperties{ - // Image: to.Ptr("MyImage"), - // ImageID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ImageType: to.Ptr(armsphere.ImageTypeInvalidImageType), - // ProvisioningState: to.Ptr(armsphere.ProvisioningStateSucceeded), - // RegionalDataBoundary: to.Ptr(armsphere.RegionalDataBoundaryNone), - // URI: to.Ptr("imageUri"), - // }, - // }}, - // ProvisioningState: to.Ptr(armsphere.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeployment.json -func ExampleDeploymentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginDelete(ctx, "MyResourceGroup1", "MyCatalog1", "MyProductName1", "DeviceGroupName1", "MyDeploymentName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sphere/armsphere/devicegroups_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/devicegroups_client_example_test.go deleted file mode 100644 index d2b2ff47a629..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/devicegroups_client_example_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroups.json -func ExampleDeviceGroupsClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeviceGroupsClient().NewListByProductPager("MyResourceGroup1", "MyCatalog1", "MyProduct1", &armsphere.DeviceGroupsClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceGroupListResult = armsphere.DeviceGroupListResult{ - // Value: []*armsphere.DeviceGroup{ - // { - // Name: to.Ptr("MyDeviceGroup1"), - // Type: to.Ptr("microsoft.azureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup1"), - // }, - // { - // Name: to.Ptr("MyDeviceGroup2"), - // Type: to.Ptr("microsoft.azureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/Products/MyProduct2/devicegroups/MyDeviceGroup2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroup.json -func ExampleDeviceGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeviceGroupsClient().Get(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeviceGroup = armsphere.DeviceGroup{ - // Type: to.Ptr("microsoft.azureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup1"), - // Properties: &armsphere.DeviceGroupProperties{ - // Description: to.Ptr("The description of MyDeviceGroup1"), - // OSFeedType: to.Ptr(armsphere.OSFeedTypeRetail), - // UpdatePolicy: to.Ptr(armsphere.UpdatePolicyUpdateAll), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeviceGroup.json -func ExampleDeviceGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeviceGroupsClient().BeginCreateOrUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", armsphere.DeviceGroup{ - Properties: &armsphere.DeviceGroupProperties{ - Description: to.Ptr("Description for MyDeviceGroup1"), - OSFeedType: to.Ptr(armsphere.OSFeedTypeRetail), - UpdatePolicy: to.Ptr(armsphere.UpdatePolicyUpdateAll), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeviceGroup = armsphere.DeviceGroup{ - // Type: to.Ptr("microsoft.AzureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup1"), - // Properties: &armsphere.DeviceGroupProperties{ - // Description: to.Ptr("Description of MyDeviceGroup1"), - // OSFeedType: to.Ptr(armsphere.OSFeedTypeRetail), - // UpdatePolicy: to.Ptr(armsphere.UpdatePolicyUpdateAll), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDeviceGroup.json -func ExampleDeviceGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeviceGroupsClient().BeginUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", armsphere.DeviceGroupUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeviceGroup = armsphere.DeviceGroup{ - // Type: to.Ptr("microsoft.azureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup1"), - // Properties: &armsphere.DeviceGroupProperties{ - // Description: to.Ptr("The description of MyDeviceGroup1"), - // OSFeedType: to.Ptr(armsphere.OSFeedTypeRetail), - // UpdatePolicy: to.Ptr(armsphere.UpdatePolicyUpdateAll), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeviceGroup.json -func ExampleDeviceGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeviceGroupsClient().BeginDelete(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostClaimDevices.json -func ExampleDeviceGroupsClient_BeginClaimDevices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeviceGroupsClient().BeginClaimDevices(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", armsphere.ClaimDevicesRequest{ - DeviceIdentifiers: []*string{ - to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesDeviceGroup.json -func ExampleDeviceGroupsClient_CountDevices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeviceGroupsClient().CountDevices(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CountDevicesResponse = armsphere.CountDevicesResponse{ - // Value: to.Ptr[int32](3), - // } -} diff --git a/sdk/resourcemanager/sphere/armsphere/devices_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/devices_client_example_test.go deleted file mode 100644 index fb3cdd91ebb0..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/devices_client_example_test.go +++ /dev/null @@ -1,205 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevices.json -func ExampleDevicesClient_NewListByDeviceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDevicesClient().NewListByDeviceGroupPager("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceListResult = armsphere.DeviceListResult{ - // Value: []*armsphere.Device{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/myProduct1/deviceGroups/myDeviceGroup1/devices/00000000-0000-0000-0000-000000000001"), - // Properties: &armsphere.DeviceProperties{ - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/myProduct1/deviceGroups/myDeviceGroup1/devices/00000000-0000-0000-0000-000000000002"), - // Properties: &armsphere.DeviceProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevice.json -func ExampleDevicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevicesClient().Get(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Device = armsphere.Device{ - // Name: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/myProduct1/deviceGroups/myDeviceGroup1/devices/00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - // Properties: &armsphere.DeviceProperties{ - // ChipSKU: to.Ptr("MyChipSku1"), - // LastAvailableOsVersion: to.Ptr("AvailableOsVersion1"), - // LastInstalledOsVersion: to.Ptr("InstalledOsVersion1"), - // LastOsUpdateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T23:54:21.960Z"); return t}()), - // LastUpdateRequestUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-01T23:54:21.960Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDevice.json -func ExampleDevicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevicesClient().BeginCreateOrUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", armsphere.Device{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Device = armsphere.Device{ - // Name: to.Ptr("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/myProduct1/deviceGroups/myDeviceGroup1/devices/00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - // Properties: &armsphere.DeviceProperties{ - // ChipSKU: to.Ptr("MyChipSku1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDevice.json -func ExampleDevicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevicesClient().BeginUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", armsphere.DeviceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Device = armsphere.Device{ - // Type: to.Ptr("Microsoft.AzureSphere/catalogs/products/devicegroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup1/device/00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - // Properties: &armsphere.DeviceProperties{ - // ChipSKU: to.Ptr("MyChipSku1"), - // LastAvailableOsVersion: to.Ptr("AvailableOsVersion1"), - // LastInstalledOsVersion: to.Ptr("InstalledOsVersion1"), - // LastOsUpdateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-30T23:54:21.960Z"); return t}()), - // LastUpdateRequestUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-01T23:54:21.960Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDevice.json -func ExampleDevicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevicesClient().BeginDelete(ctx, "MyResourceGroup1", "MyCatalog1", "MyProductName1", "DeviceGroupName1", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostGenerateDeviceCapabilityImage.json -func ExampleDevicesClient_BeginGenerateCapabilityImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevicesClient().BeginGenerateCapabilityImage(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", armsphere.GenerateCapabilityImageRequest{ - Capabilities: []*armsphere.CapabilityType{ - to.Ptr(armsphere.CapabilityTypeApplicationDevelopment)}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SignedCapabilityImageResponse = armsphere.SignedCapabilityImageResponse{ - // Image: to.Ptr("TheDeviceCapabilityImage"), - // } -} diff --git a/sdk/resourcemanager/sphere/armsphere/go.mod b/sdk/resourcemanager/sphere/armsphere/go.mod index 9cac9337d121..1e35eb6cfb25 100644 --- a/sdk/resourcemanager/sphere/armsphere/go.mod +++ b/sdk/resourcemanager/sphere/armsphere/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/sphere/armsphere/go.sum b/sdk/resourcemanager/sphere/armsphere/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/sphere/armsphere/go.sum +++ b/sdk/resourcemanager/sphere/armsphere/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/sphere/armsphere/images_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/images_client_example_test.go deleted file mode 100644 index 92f608e3b555..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/images_client_example_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImages.json -func ExampleImagesClient_NewListByCatalogPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewImagesClient().NewListByCatalogPager("MyResourceGroup1", "MyCatalog1", &armsphere.ImagesClientListByCatalogOptions{Filter: nil, - Top: nil, - Skip: nil, - Maxpagesize: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ImageListResult = armsphere.ImageListResult{ - // Value: []*armsphere.Image{ - // { - // Name: to.Ptr("MyImage1"), - // ID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }, - // { - // Name: to.Ptr("MyImage2"), - // ID: to.Ptr("00000000-0000-0000-0000-000000000002"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImage.json -func ExampleImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewImagesClient().Get(ctx, "MyResourceGroup1", "MyCatalog1", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armsphere.Image{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutImage.json -func ExampleImagesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "00000000-0000-0000-0000-000000000000", armsphere.Image{ - Properties: &armsphere.ImageProperties{ - Image: to.Ptr("bXliYXNlNjRzdHJpbmc="), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armsphere.Image{ - // Name: to.Ptr("MyProduct1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs/images"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/images/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteImage.json -func ExampleImagesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginDelete(ctx, "MyResourceGroup1", "MyCatalog1", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sphere/armsphere/models.go b/sdk/resourcemanager/sphere/armsphere/models.go index 13b001b86d90..00d8e2ce3bbf 100644 --- a/sdk/resourcemanager/sphere/armsphere/models.go +++ b/sdk/resourcemanager/sphere/armsphere/models.go @@ -39,7 +39,7 @@ type CatalogListResult struct { // REQUIRED; The Catalog items on this page Value []*Catalog - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } @@ -87,7 +87,7 @@ type CertificateListResult struct { // REQUIRED; The Certificate items on this page Value []*Certificate - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } @@ -150,7 +150,7 @@ type DeploymentListResult struct { // REQUIRED; The Deployment items on this page Value []*Deployment - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } @@ -210,7 +210,7 @@ type DeviceGroupListResult struct { // REQUIRED; The DeviceGroup items on this page Value []*DeviceGroup - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } @@ -294,7 +294,7 @@ type DeviceListResult struct { // REQUIRED; The Device items on this page Value []*Device - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } @@ -363,7 +363,7 @@ type ImageListResult struct { // REQUIRED; The Image items on this page Value []*Image - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } @@ -457,7 +457,7 @@ type PagedDeviceInsight struct { // REQUIRED; The DeviceInsight items on this page Value []*DeviceInsight - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } @@ -484,7 +484,7 @@ type ProductListResult struct { // REQUIRED; The Product items on this page Value []*Product - // READ-ONLY; The link to the next page of items + // The link to the next page of items NextLink *string } diff --git a/sdk/resourcemanager/sphere/armsphere/operations_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/operations_client_example_test.go deleted file mode 100644 index 40ab897e0e76..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/operations_client_example_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armsphere.OperationListResult{ - // Value: []*armsphere.Operation{ - // { - // Name: to.Ptr("Microsoft.AzureSphere/catalogs/Read"), - // Display: &armsphere.OperationDisplay{ - // Description: to.Ptr("Read Azure Sphere catalogs"), - // Operation: to.Ptr("Gets/List catalog"), - // Provider: to.Ptr("Microsoft.AzureSphere"), - // Resource: to.Ptr("catalog"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AzureSphere/catalogs/Write"), - // Display: &armsphere.OperationDisplay{ - // Description: to.Ptr("Writes Azure Sphere catalogs"), - // Operation: to.Ptr("Create/Update catalog"), - // Provider: to.Ptr("Microsoft.AzureSphere"), - // Resource: to.Ptr("catalog"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/sphere/armsphere/products_client_example_test.go b/sdk/resourcemanager/sphere/armsphere/products_client_example_test.go deleted file mode 100644 index d93c3e9cb565..000000000000 --- a/sdk/resourcemanager/sphere/armsphere/products_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsphere_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sphere/armsphere" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProducts.json -func ExampleProductsClient_NewListByCatalogPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProductsClient().NewListByCatalogPager("MyResourceGroup1", "MyCatalog1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProductListResult = armsphere.ProductListResult{ - // Value: []*armsphere.Product{ - // { - // Name: to.Ptr("MyProduct1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs/products"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1"), - // }, - // { - // Name: to.Ptr("MyProduct2"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs/products"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProduct.json -func ExampleProductsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProductsClient().Get(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Product = armsphere.Product{ - // Type: to.Ptr("microsoft.azureSphere/catalogs/products"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1"), - // Properties: &armsphere.ProductProperties{ - // Description: to.Ptr("product description."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutProduct.json -func ExampleProductsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProductsClient().BeginCreateOrUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", armsphere.Product{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Product = armsphere.Product{ - // Name: to.Ptr("MyProduct1"), - // Type: to.Ptr("Microsoft.AzureSphere/catalogs/products"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchProduct.json -func ExampleProductsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProductsClient().BeginUpdate(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", armsphere.ProductUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Product = armsphere.Product{ - // Type: to.Ptr("microsoft.azureSphere/catalogs/products"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1"), - // Properties: &armsphere.ProductProperties{ - // Description: to.Ptr("Product description."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteProduct.json -func ExampleProductsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProductsClient().BeginDelete(ctx, "MyResourceGroup1", "MyCatalog1", "MyProductName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesProduct.json -func ExampleProductsClient_CountDevices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProductsClient().CountDevices(ctx, "MyResourceGroup1", "MyCatalog1", "MyProduct1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CountDevicesResponse = armsphere.CountDevicesResponse{ - // Value: to.Ptr[int32](3), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/09c37754dac91874ff689ed1e60effb4268c8669/specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostGenerateDefaultDeviceGroups.json -func ExampleProductsClient_NewGenerateDefaultDeviceGroupsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsphere.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProductsClient().NewGenerateDefaultDeviceGroupsPager("MyResourceGroup1", "MyCatalog1", "MyProduct1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceGroupListResult = armsphere.DeviceGroupListResult{ - // Value: []*armsphere.DeviceGroup{ - // { - // Name: to.Ptr("MyDeviceGroup1"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup1"), - // Properties: &armsphere.DeviceGroupProperties{ - // Description: to.Ptr("Device group description 1"), - // AllowCrashDumpsCollection: to.Ptr(armsphere.AllowCrashDumpCollectionEnabled), - // OSFeedType: to.Ptr(armsphere.OSFeedTypeRetail), - // UpdatePolicy: to.Ptr(armsphere.UpdatePolicyUpdateAll), - // }, - // }, - // { - // Name: to.Ptr("MyDeviceGroup2"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup1/providers/Microsoft.AzureSphere/catalogs/MyCatalog1/products/MyProduct1/devicegroups/MyDeviceGroup2"), - // Properties: &armsphere.DeviceGroupProperties{ - // Description: to.Ptr("Device group description 2"), - // AllowCrashDumpsCollection: to.Ptr(armsphere.AllowCrashDumpCollectionEnabled), - // OSFeedType: to.Ptr(armsphere.OSFeedTypeRetail), - // UpdatePolicy: to.Ptr(armsphere.UpdatePolicyUpdateAll), - // }, - // }}, - // } - } -}