From 628f90572d675750d237c8225fd7024ae0e6ae47 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Mar 2023 17:44:08 +0000 Subject: [PATCH] CodeGen from PR 22846 in Azure/azure-rest-api-specs Merge a431955be525626af99cac8b7365400097d57a4b into 5a49823c43b422e5f3b0ec2ce8846d84cfe7c149 --- .../armservicefabricmesh/CHANGELOG.md | 12 + ...cation_client.go => application_client.go} | 44 +- .../armservicefabricmesh/autorest.md | 6 +- ...ackage_client.go => codepackage_client.go} | 22 +- ...zz_generated_constants.go => constants.go} | 3 +- ...ed_gateway_client.go => gateway_client.go} | 44 +- .../armservicefabricmesh/go.mod | 14 +- .../armservicefabricmesh/go.sum | 24 +- .../{zz_generated_models.go => models.go} | 98 +- .../armservicefabricmesh/models_serde.go | 3522 +++++++++++++++++ ...ed_network_client.go => network_client.go} | 44 +- ...rations_client.go => operations_client.go} | 9 +- ...phic_helpers.go => polymorphic_helpers.go} | 15 +- ...ed_response_types.go => response_types.go} | 29 +- ...ated_secret_client.go => secret_client.go} | 44 +- ...tvalue_client.go => secretvalue_client.go} | 53 +- ...ed_service_client.go => service_client.go} | 24 +- ...ica_client.go => servicereplica_client.go} | 28 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 3 +- ...ated_volume_client.go => volume_client.go} | 44 +- ...nerated_example_application_client_test.go | 171 - ...nerated_example_codepackage_client_test.go | 42 - ...e_generated_example_gateway_client_test.go | 185 - ...e_generated_example_network_client_test.go | 140 - ...ze_generated_example_secret_client_test.go | 140 - ...nerated_example_secretvalue_client_test.go | 140 - ...e_generated_example_service_client_test.go | 66 - ...ated_example_servicereplica_client_test.go | 68 - ...ze_generated_example_volume_client_test.go | 144 - .../zz_generated_models_serde.go | 912 ----- 30 files changed, 3847 insertions(+), 2243 deletions(-) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_application_client.go => application_client.go} (91%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_codepackage_client.go => codepackage_client.go} (88%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_constants.go => constants.go} (99%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_gateway_client.go => gateway_client.go} (91%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_models.go => models.go} (94%) create mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/models_serde.go rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_network_client.go => network_client.go} (91%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_operations_client.go => operations_client.go} (92%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_polymorphic_helpers.go => polymorphic_helpers.go} (95%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_response_types.go => response_types.go} (89%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_secret_client.go => secret_client.go} (91%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_secretvalue_client.go => secretvalue_client.go} (88%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_service_client.go => service_client.go} (90%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_servicereplica_client.go => servicereplica_client.go} (89%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_time_rfc3339.go => time_rfc3339.go} (96%) rename sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/{zz_generated_volume_client.go => volume_client.go} (91%) delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_application_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_codepackage_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_gateway_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_network_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secret_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secretvalue_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_service_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_servicereplica_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_volume_client_test.go delete mode 100644 sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/CHANGELOG.md b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/CHANGELOG.md index 9d664d7cd98a..f36aac4772cc 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/CHANGELOG.md +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 0.6.0 (2023-03-14) +### Features Added + +- New struct `AvailableOperationDescriptionProperties` +- New struct `Dimension` +- New struct `LogSpecification` +- New struct `MetricAvailability` +- New struct `MetricSpecification` +- New struct `ServiceSpecification` +- New field `Properties` in struct `OperationResult` + + ## 0.5.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 0.5.0, which contains breaking changes. diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_application_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/application_client.go similarity index 91% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_application_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/application_client.go index 4bce5393332e..ae31cc8edf44 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_application_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/application_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type ApplicationClient struct { } // NewApplicationClient creates a new instance of ApplicationClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewApplicationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +59,12 @@ func NewApplicationClient(subscriptionID string, credential azcore.TokenCredenti // with the same name exists, then it is updated with the specified description and // properties. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// applicationResourceDescription - Description for creating a Application resource. -// options - ApplicationClientCreateOptions contains the optional parameters for the ApplicationClient.Create method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - applicationResourceDescription - Description for creating a Application resource. +// - options - ApplicationClientCreateOptions contains the optional parameters for the ApplicationClient.Create method. func (client *ApplicationClient) Create(ctx context.Context, resourceGroupName string, applicationResourceName string, applicationResourceDescription ApplicationResourceDescription, options *ApplicationClientCreateOptions) (ApplicationClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, applicationResourceName, applicationResourceDescription, options) if err != nil { @@ -112,10 +114,11 @@ func (client *ApplicationClient) createHandleResponse(resp *http.Response) (Appl // Delete - Deletes the application resource identified by the name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// options - ApplicationClientDeleteOptions contains the optional parameters for the ApplicationClient.Delete method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - options - ApplicationClientDeleteOptions contains the optional parameters for the ApplicationClient.Delete method. func (client *ApplicationClient) Delete(ctx context.Context, resourceGroupName string, applicationResourceName string, options *ApplicationClientDeleteOptions) (ApplicationClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationResourceName, options) if err != nil { @@ -157,10 +160,11 @@ func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the information about the application resource with the given name. The information include the description // and other properties of the application. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// options - ApplicationClientGetOptions contains the optional parameters for the ApplicationClient.Get method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - options - ApplicationClientGetOptions contains the optional parameters for the ApplicationClient.Get method. func (client *ApplicationClient) Get(ctx context.Context, resourceGroupName string, applicationResourceName string, options *ApplicationClientGetOptions) (ApplicationClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, applicationResourceName, options) if err != nil { @@ -210,11 +214,11 @@ func (client *ApplicationClient) getHandleResponse(resp *http.Response) (Applica // NewListByResourceGroupPager - Gets the information about all application resources in a given resource group. The information // include the description and other properties of the Application. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// options - ApplicationClientListByResourceGroupOptions contains the optional parameters for the ApplicationClient.ListByResourceGroup -// method. +// - resourceGroupName - Azure resource group name +// - options - ApplicationClientListByResourceGroupOptions contains the optional parameters for the ApplicationClient.NewListByResourceGroupPager +// method. func (client *ApplicationClient) NewListByResourceGroupPager(resourceGroupName string, options *ApplicationClientListByResourceGroupOptions) *runtime.Pager[ApplicationClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ApplicationClientListByResourceGroupResponse]{ More: func(page ApplicationClientListByResourceGroupResponse) bool { @@ -276,10 +280,10 @@ func (client *ApplicationClient) listByResourceGroupHandleResponse(resp *http.Re // NewListBySubscriptionPager - Gets the information about all application resources in a given resource group. The information // include the description and other properties of the application. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// options - ApplicationClientListBySubscriptionOptions contains the optional parameters for the ApplicationClient.ListBySubscription -// method. +// - options - ApplicationClientListBySubscriptionOptions contains the optional parameters for the ApplicationClient.NewListBySubscriptionPager +// method. func (client *ApplicationClient) NewListBySubscriptionPager(options *ApplicationClientListBySubscriptionOptions) *runtime.Pager[ApplicationClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ApplicationClientListBySubscriptionResponse]{ More: func(page ApplicationClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/autorest.md b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/autorest.md index 5489eb66641f..d27d1c6e84f3 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/autorest.md +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabricmesh/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabricmesh/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicefabricmesh/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicefabricmesh/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.5.0 +module-version: 0.6.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_codepackage_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/codepackage_client.go similarity index 88% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_codepackage_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/codepackage_client.go index 17b0f331547e..e14e212533d9 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_codepackage_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/codepackage_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -32,9 +33,9 @@ type CodePackageClient struct { } // NewCodePackageClient creates a new instance of CodePackageClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCodePackageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CodePackageClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewCodePackageClient(subscriptionID string, credential azcore.TokenCredenti // GetContainerLogs - Gets the logs for the container of the specified code package of the service replica. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// serviceResourceName - The identity of the service. -// replicaName - Service Fabric replica name. -// codePackageName - The name of code package of the service. -// options - CodePackageClientGetContainerLogsOptions contains the optional parameters for the CodePackageClient.GetContainerLogs -// method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - serviceResourceName - The identity of the service. +// - replicaName - Service Fabric replica name. +// - codePackageName - The name of code package of the service. +// - options - CodePackageClientGetContainerLogsOptions contains the optional parameters for the CodePackageClient.GetContainerLogs +// method. func (client *CodePackageClient) GetContainerLogs(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string, replicaName string, codePackageName string, options *CodePackageClientGetContainerLogsOptions) (CodePackageClientGetContainerLogsResponse, error) { req, err := client.getContainerLogsCreateRequest(ctx, resourceGroupName, applicationResourceName, serviceResourceName, replicaName, codePackageName, options) if err != nil { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_constants.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/constants.go similarity index 99% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_constants.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/constants.go index a2b74fdc0b59..8f632309ef3b 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_constants.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh const ( moduleName = "armservicefabricmesh" - moduleVersion = "v0.5.0" + moduleVersion = "v0.6.0" ) // ApplicationScopedVolumeKind - Specifies the application-scoped volume kind. diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_gateway_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/gateway_client.go similarity index 91% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_gateway_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/gateway_client.go index a0b7fc75231c..ada7fec8a2ed 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_gateway_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/gateway_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type GatewayClient struct { } // NewGatewayClient creates a new instance of GatewayClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGatewayClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +59,12 @@ func NewGatewayClient(subscriptionID string, credential azcore.TokenCredential, // same name exists, then it is updated with the specified description and properties. Use // gateway resources to create a gateway for public connectivity for services within your application. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// gatewayResourceName - The identity of the gateway. -// gatewayResourceDescription - Description for creating a Gateway resource. -// options - GatewayClientCreateOptions contains the optional parameters for the GatewayClient.Create method. +// - resourceGroupName - Azure resource group name +// - gatewayResourceName - The identity of the gateway. +// - gatewayResourceDescription - Description for creating a Gateway resource. +// - options - GatewayClientCreateOptions contains the optional parameters for the GatewayClient.Create method. func (client *GatewayClient) Create(ctx context.Context, resourceGroupName string, gatewayResourceName string, gatewayResourceDescription GatewayResourceDescription, options *GatewayClientCreateOptions) (GatewayClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, gatewayResourceName, gatewayResourceDescription, options) if err != nil { @@ -112,10 +114,11 @@ func (client *GatewayClient) createHandleResponse(resp *http.Response) (GatewayC // Delete - Deletes the gateway resource identified by the name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// gatewayResourceName - The identity of the gateway. -// options - GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method. +// - resourceGroupName - Azure resource group name +// - gatewayResourceName - The identity of the gateway. +// - options - GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method. func (client *GatewayClient) Delete(ctx context.Context, resourceGroupName string, gatewayResourceName string, options *GatewayClientDeleteOptions) (GatewayClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayResourceName, options) if err != nil { @@ -157,10 +160,11 @@ func (client *GatewayClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the information about the gateway resource with the given name. The information include the description and // other properties of the gateway. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// gatewayResourceName - The identity of the gateway. -// options - GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method. +// - resourceGroupName - Azure resource group name +// - gatewayResourceName - The identity of the gateway. +// - options - GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method. func (client *GatewayClient) Get(ctx context.Context, resourceGroupName string, gatewayResourceName string, options *GatewayClientGetOptions) (GatewayClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayResourceName, options) if err != nil { @@ -210,11 +214,11 @@ func (client *GatewayClient) getHandleResponse(resp *http.Response) (GatewayClie // NewListByResourceGroupPager - Gets the information about all gateway resources in a given resource group. The information // include the description and other properties of the Gateway. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// options - GatewayClientListByResourceGroupOptions contains the optional parameters for the GatewayClient.ListByResourceGroup -// method. +// - resourceGroupName - Azure resource group name +// - options - GatewayClientListByResourceGroupOptions contains the optional parameters for the GatewayClient.NewListByResourceGroupPager +// method. func (client *GatewayClient) NewListByResourceGroupPager(resourceGroupName string, options *GatewayClientListByResourceGroupOptions) *runtime.Pager[GatewayClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[GatewayClientListByResourceGroupResponse]{ More: func(page GatewayClientListByResourceGroupResponse) bool { @@ -276,10 +280,10 @@ func (client *GatewayClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListBySubscriptionPager - Gets the information about all gateway resources in a given resource group. The information // include the description and other properties of the gateway. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// options - GatewayClientListBySubscriptionOptions contains the optional parameters for the GatewayClient.ListBySubscription -// method. +// - options - GatewayClientListBySubscriptionOptions contains the optional parameters for the GatewayClient.NewListBySubscriptionPager +// method. func (client *GatewayClient) NewListBySubscriptionPager(options *GatewayClientListBySubscriptionOptions) *runtime.Pager[GatewayClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[GatewayClientListBySubscriptionResponse]{ More: func(page GatewayClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.mod b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.mod index 345508db2d9c..674e1aa867e4 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.mod +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmesh/a go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.sum b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.sum +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/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/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_models.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/models.go similarity index 94% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_models.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/models.go index c6d8b3b2f926..1e836e928dfe 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_models.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -48,13 +49,13 @@ type ApplicationClientGetOptions struct { // placeholder for future optional parameters } -// ApplicationClientListByResourceGroupOptions contains the optional parameters for the ApplicationClient.ListByResourceGroup +// ApplicationClientListByResourceGroupOptions contains the optional parameters for the ApplicationClient.NewListByResourceGroupPager // method. type ApplicationClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ApplicationClientListBySubscriptionOptions contains the optional parameters for the ApplicationClient.ListBySubscription +// ApplicationClientListBySubscriptionOptions contains the optional parameters for the ApplicationClient.NewListBySubscriptionPager // method. type ApplicationClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -304,6 +305,12 @@ type AutoScalingTrigger struct { // GetAutoScalingTrigger implements the AutoScalingTriggerClassification interface for type AutoScalingTrigger. func (a *AutoScalingTrigger) GetAutoScalingTrigger() *AutoScalingTrigger { return a } +// AvailableOperationDescriptionProperties - Properties available for a Microsoft.Web resource provider operation. +type AvailableOperationDescriptionProperties struct { + // Resource metrics service provided by Microsoft.Insights resource provider. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + // AvailableOperationDisplay - An operation available at the listed Azure resource provider. type AvailableOperationDisplay struct { // Description of the available operation. @@ -359,7 +366,7 @@ type AzureInternalMonitoringPipelineSinkDescription struct { Description *string `json:"description,omitempty"` // Azure Internal monitoring agent fluentd configuration. - FluentdConfigURL interface{} `json:"fluentdConfigUrl,omitempty"` + FluentdConfigURL any `json:"fluentdConfigUrl,omitempty"` // Azure Internal monitoring agent configuration. MaConfigURL *string `json:"maConfigUrl,omitempty"` @@ -553,6 +560,15 @@ func (d *DiagnosticsSinkProperties) GetDiagnosticsSinkProperties() *DiagnosticsS return d } +// Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, where instance name is dimension +// of the metric HTTP request +type Dimension struct { + DisplayName *string `json:"displayName,omitempty"` + InternalName *string `json:"internalName,omitempty"` + Name *string `json:"name,omitempty"` + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + // EndpointProperties - Describes a container endpoint. type EndpointProperties struct { // REQUIRED; The name of the endpoint. @@ -620,12 +636,14 @@ type GatewayClientGetOptions struct { // placeholder for future optional parameters } -// GatewayClientListByResourceGroupOptions contains the optional parameters for the GatewayClient.ListByResourceGroup method. +// GatewayClientListByResourceGroupOptions contains the optional parameters for the GatewayClient.NewListByResourceGroupPager +// method. type GatewayClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// GatewayClientListBySubscriptionOptions contains the optional parameters for the GatewayClient.ListBySubscription method. +// GatewayClientListBySubscriptionOptions contains the optional parameters for the GatewayClient.NewListBySubscriptionPager +// method. type GatewayClientListBySubscriptionOptions struct { // placeholder for future optional parameters } @@ -894,6 +912,14 @@ func (l *LocalNetworkResourceProperties) GetNetworkResourcePropertiesBase() *Net } } +// LogSpecification - Log Definition of a single resource metric. +type LogSpecification struct { + BlobDuration *string `json:"blobDuration,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + LogFilterPattern *string `json:"logFilterPattern,omitempty"` + Name *string `json:"name,omitempty"` +} + // ManagedProxyResource - The resource model definition for Azure Resource Manager proxy resource. It will have everything // other than required location and tags. This proxy resource is explicitly created or updated by // including it in the parent resource. @@ -908,6 +934,33 @@ type ManagedProxyResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// MetricAvailability - Retention policy of a resource metric. +type MetricAvailability struct { + BlobDuration *string `json:"blobDuration,omitempty"` + TimeGrain *string `json:"timeGrain,omitempty"` +} + +// MetricSpecification - Definition of a single resource metric. +type MetricSpecification struct { + AggregationType *string `json:"aggregationType,omitempty"` + Availabilities []*MetricAvailability `json:"availabilities,omitempty"` + Category *string `json:"category,omitempty"` + Dimensions []*Dimension `json:"dimensions,omitempty"` + DisplayDescription *string `json:"displayDescription,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + IsInternal *bool `json:"isInternal,omitempty"` + MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` + Name *string `json:"name,omitempty"` + SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` + SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` + SupportedAggregationTypes []*string `json:"supportedAggregationTypes,omitempty"` + SupportedTimeGrainTypes []*string `json:"supportedTimeGrainTypes,omitempty"` + SupportsInstanceLevelAggregation *bool `json:"supportsInstanceLevelAggregation,omitempty"` + Unit *string `json:"unit,omitempty"` +} + // NetworkClientCreateOptions contains the optional parameters for the NetworkClient.Create method. type NetworkClientCreateOptions struct { // placeholder for future optional parameters @@ -923,12 +976,14 @@ type NetworkClientGetOptions struct { // placeholder for future optional parameters } -// NetworkClientListByResourceGroupOptions contains the optional parameters for the NetworkClient.ListByResourceGroup method. +// NetworkClientListByResourceGroupOptions contains the optional parameters for the NetworkClient.NewListByResourceGroupPager +// method. type NetworkClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// NetworkClientListBySubscriptionOptions contains the optional parameters for the NetworkClient.ListBySubscription method. +// NetworkClientListBySubscriptionOptions contains the optional parameters for the NetworkClient.NewListBySubscriptionPager +// method. type NetworkClientListBySubscriptionOptions struct { // placeholder for future optional parameters } @@ -1058,9 +1113,12 @@ type OperationResult struct { // Origin result Origin *string `json:"origin,omitempty"` + + // Properties of the operation + Properties *AvailableOperationDescriptionProperties `json:"properties,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -1152,12 +1210,14 @@ type SecretClientGetOptions struct { // placeholder for future optional parameters } -// SecretClientListByResourceGroupOptions contains the optional parameters for the SecretClient.ListByResourceGroup method. +// SecretClientListByResourceGroupOptions contains the optional parameters for the SecretClient.NewListByResourceGroupPager +// method. type SecretClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// SecretClientListBySubscriptionOptions contains the optional parameters for the SecretClient.ListBySubscription method. +// SecretClientListBySubscriptionOptions contains the optional parameters for the SecretClient.NewListBySubscriptionPager +// method. type SecretClientListBySubscriptionOptions struct { // placeholder for future optional parameters } @@ -1279,7 +1339,7 @@ type SecretValueClientGetOptions struct { // placeholder for future optional parameters } -// SecretValueClientListOptions contains the optional parameters for the SecretValueClient.List method. +// SecretValueClientListOptions contains the optional parameters for the SecretValueClient.NewListPager method. type SecretValueClientListOptions struct { // placeholder for future optional parameters } @@ -1341,7 +1401,7 @@ type ServiceClientGetOptions struct { // placeholder for future optional parameters } -// ServiceClientListOptions contains the optional parameters for the ServiceClient.List method. +// ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method. type ServiceClientListOptions struct { // placeholder for future optional parameters } @@ -1376,7 +1436,7 @@ type ServiceReplicaClientGetOptions struct { // placeholder for future optional parameters } -// ServiceReplicaClientListOptions contains the optional parameters for the ServiceReplicaClient.List method. +// ServiceReplicaClientListOptions contains the optional parameters for the ServiceReplicaClient.NewListPager method. type ServiceReplicaClientListOptions struct { // placeholder for future optional parameters } @@ -1493,6 +1553,12 @@ type ServiceResourceProperties struct { UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty" azure:"ro"` } +// ServiceSpecification - Resource metrics service provided by Microsoft.Insights resource provider. +type ServiceSpecification struct { + LogSpecifications []*LogSpecification `json:"logSpecifications,omitempty"` + MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"` +} + // Setting - Describes a setting for the container. The setting file path can be fetched from environment variable "Fabric_SettingPath". // The path for Windows container is "C:\secrets". The path for Linux container // is "/var/secrets". @@ -1549,12 +1615,14 @@ type VolumeClientGetOptions struct { // placeholder for future optional parameters } -// VolumeClientListByResourceGroupOptions contains the optional parameters for the VolumeClient.ListByResourceGroup method. +// VolumeClientListByResourceGroupOptions contains the optional parameters for the VolumeClient.NewListByResourceGroupPager +// method. type VolumeClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// VolumeClientListBySubscriptionOptions contains the optional parameters for the VolumeClient.ListBySubscription method. +// VolumeClientListBySubscriptionOptions contains the optional parameters for the VolumeClient.NewListBySubscriptionPager +// method. type VolumeClientListBySubscriptionOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/models_serde.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/models_serde.go new file mode 100644 index 000000000000..9373daa996ea --- /dev/null +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/models_serde.go @@ -0,0 +1,3522 @@ +//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 armservicefabricmesh + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AddRemoveReplicaScalingMechanism. +func (a AddRemoveReplicaScalingMechanism) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = AutoScalingMechanismKindAddRemoveReplica + populate(objectMap, "maxCount", a.MaxCount) + populate(objectMap, "minCount", a.MinCount) + populate(objectMap, "scaleIncrement", a.ScaleIncrement) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AddRemoveReplicaScalingMechanism. +func (a *AddRemoveReplicaScalingMechanism) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "maxCount": + err = unpopulate(val, "MaxCount", &a.MaxCount) + delete(rawMsg, key) + case "minCount": + err = unpopulate(val, "MinCount", &a.MinCount) + delete(rawMsg, key) + case "scaleIncrement": + err = unpopulate(val, "ScaleIncrement", &a.ScaleIncrement) + 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 ApplicationProperties. +func (a ApplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "debugParams", a.DebugParams) + populate(objectMap, "description", a.Description) + populate(objectMap, "diagnostics", a.Diagnostics) + populate(objectMap, "healthState", a.HealthState) + populate(objectMap, "serviceNames", a.ServiceNames) + populate(objectMap, "services", a.Services) + populate(objectMap, "status", a.Status) + populate(objectMap, "statusDetails", a.StatusDetails) + populate(objectMap, "unhealthyEvaluation", a.UnhealthyEvaluation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProperties. +func (a *ApplicationProperties) UnmarshalJSON(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 "debugParams": + err = unpopulate(val, "DebugParams", &a.DebugParams) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &a.Diagnostics) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &a.HealthState) + delete(rawMsg, key) + case "serviceNames": + err = unpopulate(val, "ServiceNames", &a.ServiceNames) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &a.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &a.StatusDetails) + delete(rawMsg, key) + case "unhealthyEvaluation": + err = unpopulate(val, "UnhealthyEvaluation", &a.UnhealthyEvaluation) + 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 ApplicationResourceDescription. +func (a ApplicationResourceDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceDescription. +func (a *ApplicationResourceDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceDescriptionList. +func (a ApplicationResourceDescriptionList) 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 ApplicationResourceDescriptionList. +func (a *ApplicationResourceDescriptionList) UnmarshalJSON(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 ApplicationResourceProperties. +func (a ApplicationResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "debugParams", a.DebugParams) + populate(objectMap, "description", a.Description) + populate(objectMap, "diagnostics", a.Diagnostics) + populate(objectMap, "healthState", a.HealthState) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "serviceNames", a.ServiceNames) + populate(objectMap, "services", a.Services) + populate(objectMap, "status", a.Status) + populate(objectMap, "statusDetails", a.StatusDetails) + populate(objectMap, "unhealthyEvaluation", a.UnhealthyEvaluation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceProperties. +func (a *ApplicationResourceProperties) UnmarshalJSON(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 "debugParams": + err = unpopulate(val, "DebugParams", &a.DebugParams) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &a.Diagnostics) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &a.HealthState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "serviceNames": + err = unpopulate(val, "ServiceNames", &a.ServiceNames) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &a.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &a.StatusDetails) + delete(rawMsg, key) + case "unhealthyEvaluation": + err = unpopulate(val, "UnhealthyEvaluation", &a.UnhealthyEvaluation) + 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 ApplicationScopedVolume. +func (a ApplicationScopedVolume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "creationParameters", a.CreationParameters) + populate(objectMap, "destinationPath", a.DestinationPath) + populate(objectMap, "name", a.Name) + populate(objectMap, "readOnly", a.ReadOnly) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationScopedVolume. +func (a *ApplicationScopedVolume) UnmarshalJSON(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 "creationParameters": + a.CreationParameters, err = unmarshalApplicationScopedVolumeCreationParametersClassification(val) + delete(rawMsg, key) + case "destinationPath": + err = unpopulate(val, "DestinationPath", &a.DestinationPath) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "readOnly": + err = unpopulate(val, "ReadOnly", &a.ReadOnly) + 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 ApplicationScopedVolumeCreationParameters. +func (a ApplicationScopedVolumeCreationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + objectMap["kind"] = a.Kind + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationScopedVolumeCreationParameters. +func (a *ApplicationScopedVolumeCreationParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + 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 ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. +func (a ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + objectMap["kind"] = ApplicationScopedVolumeKindServiceFabricVolumeDisk + populate(objectMap, "sizeDisk", a.SizeDisk) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. +func (a *ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "sizeDisk": + err = unpopulate(val, "SizeDisk", &a.SizeDisk) + 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 AutoScalingMechanism. +func (a AutoScalingMechanism) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = a.Kind + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScalingMechanism. +func (a *AutoScalingMechanism) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &a.Kind) + 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 AutoScalingMetric. +func (a AutoScalingMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = a.Kind + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScalingMetric. +func (a *AutoScalingMetric) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &a.Kind) + 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 AutoScalingPolicy. +func (a AutoScalingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mechanism", a.Mechanism) + populate(objectMap, "name", a.Name) + populate(objectMap, "trigger", a.Trigger) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScalingPolicy. +func (a *AutoScalingPolicy) UnmarshalJSON(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 "mechanism": + a.Mechanism, err = unmarshalAutoScalingMechanismClassification(val) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "trigger": + a.Trigger, err = unmarshalAutoScalingTriggerClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutoScalingResourceMetric. +func (a AutoScalingResourceMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = AutoScalingMetricKindResource + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScalingResourceMetric. +func (a *AutoScalingResourceMetric) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + 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 AutoScalingTrigger. +func (a AutoScalingTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = a.Kind + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScalingTrigger. +func (a *AutoScalingTrigger) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &a.Kind) + 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 AvailableOperationDescriptionProperties. +func (a AvailableOperationDescriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", a.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableOperationDescriptionProperties. +func (a *AvailableOperationDescriptionProperties) UnmarshalJSON(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 "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &a.ServiceSpecification) + 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 AvailableOperationDisplay. +func (a AvailableOperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "operation", a.Operation) + populate(objectMap, "provider", a.Provider) + populate(objectMap, "resource", a.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableOperationDisplay. +func (a *AvailableOperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &a.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &a.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &a.Resource) + 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 AverageLoadScalingTrigger. +func (a AverageLoadScalingTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = AutoScalingTriggerKindAverageLoad + populate(objectMap, "lowerLoadThreshold", a.LowerLoadThreshold) + populate(objectMap, "metric", a.Metric) + populate(objectMap, "scaleIntervalInSeconds", a.ScaleIntervalInSeconds) + populate(objectMap, "upperLoadThreshold", a.UpperLoadThreshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AverageLoadScalingTrigger. +func (a *AverageLoadScalingTrigger) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "lowerLoadThreshold": + err = unpopulate(val, "LowerLoadThreshold", &a.LowerLoadThreshold) + delete(rawMsg, key) + case "metric": + a.Metric, err = unmarshalAutoScalingMetricClassification(val) + delete(rawMsg, key) + case "scaleIntervalInSeconds": + err = unpopulate(val, "ScaleIntervalInSeconds", &a.ScaleIntervalInSeconds) + delete(rawMsg, key) + case "upperLoadThreshold": + err = unpopulate(val, "UpperLoadThreshold", &a.UpperLoadThreshold) + 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 AzureInternalMonitoringPipelineSinkDescription. +func (a AzureInternalMonitoringPipelineSinkDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "autoKeyConfigUrl", a.AutoKeyConfigURL) + populate(objectMap, "description", a.Description) + populate(objectMap, "fluentdConfigUrl", &a.FluentdConfigURL) + objectMap["kind"] = DiagnosticsSinkKindAzureInternalMonitoringPipeline + populate(objectMap, "maConfigUrl", a.MaConfigURL) + populate(objectMap, "name", a.Name) + populate(objectMap, "namespace", a.Namespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureInternalMonitoringPipelineSinkDescription. +func (a *AzureInternalMonitoringPipelineSinkDescription) UnmarshalJSON(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 "accountName": + err = unpopulate(val, "AccountName", &a.AccountName) + delete(rawMsg, key) + case "autoKeyConfigUrl": + err = unpopulate(val, "AutoKeyConfigURL", &a.AutoKeyConfigURL) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "fluentdConfigUrl": + err = unpopulate(val, "FluentdConfigURL", &a.FluentdConfigURL) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "maConfigUrl": + err = unpopulate(val, "MaConfigURL", &a.MaConfigURL) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &a.Namespace) + 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 ContainerCodePackageProperties. +func (c ContainerCodePackageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "commands", c.Commands) + populate(objectMap, "diagnostics", c.Diagnostics) + populate(objectMap, "endpoints", c.Endpoints) + populate(objectMap, "entrypoint", c.Entrypoint) + populate(objectMap, "environmentVariables", c.EnvironmentVariables) + populate(objectMap, "image", c.Image) + populate(objectMap, "imageRegistryCredential", c.ImageRegistryCredential) + populate(objectMap, "instanceView", c.InstanceView) + populate(objectMap, "labels", c.Labels) + populate(objectMap, "name", c.Name) + populate(objectMap, "reliableCollectionsRefs", c.ReliableCollectionsRefs) + populate(objectMap, "resources", c.Resources) + populate(objectMap, "settings", c.Settings) + populate(objectMap, "volumeRefs", c.VolumeRefs) + populate(objectMap, "volumes", c.Volumes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerCodePackageProperties. +func (c *ContainerCodePackageProperties) UnmarshalJSON(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 "commands": + err = unpopulate(val, "Commands", &c.Commands) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &c.Diagnostics) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &c.Endpoints) + delete(rawMsg, key) + case "entrypoint": + err = unpopulate(val, "Entrypoint", &c.Entrypoint) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &c.EnvironmentVariables) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &c.Image) + delete(rawMsg, key) + case "imageRegistryCredential": + err = unpopulate(val, "ImageRegistryCredential", &c.ImageRegistryCredential) + delete(rawMsg, key) + case "instanceView": + err = unpopulate(val, "InstanceView", &c.InstanceView) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &c.Labels) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "reliableCollectionsRefs": + err = unpopulate(val, "ReliableCollectionsRefs", &c.ReliableCollectionsRefs) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &c.Resources) + delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &c.Settings) + delete(rawMsg, key) + case "volumeRefs": + err = unpopulate(val, "VolumeRefs", &c.VolumeRefs) + delete(rawMsg, key) + case "volumes": + err = unpopulate(val, "Volumes", &c.Volumes) + 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 ContainerEvent. +func (c ContainerEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", c.Count) + populate(objectMap, "firstTimestamp", c.FirstTimestamp) + populate(objectMap, "lastTimestamp", c.LastTimestamp) + populate(objectMap, "message", c.Message) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerEvent. +func (c *ContainerEvent) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &c.Count) + delete(rawMsg, key) + case "firstTimestamp": + err = unpopulate(val, "FirstTimestamp", &c.FirstTimestamp) + delete(rawMsg, key) + case "lastTimestamp": + err = unpopulate(val, "LastTimestamp", &c.LastTimestamp) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerInstanceView. +func (c ContainerInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentState", c.CurrentState) + populate(objectMap, "events", c.Events) + populate(objectMap, "previousState", c.PreviousState) + populate(objectMap, "restartCount", c.RestartCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerInstanceView. +func (c *ContainerInstanceView) UnmarshalJSON(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 "currentState": + err = unpopulate(val, "CurrentState", &c.CurrentState) + delete(rawMsg, key) + case "events": + err = unpopulate(val, "Events", &c.Events) + delete(rawMsg, key) + case "previousState": + err = unpopulate(val, "PreviousState", &c.PreviousState) + delete(rawMsg, key) + case "restartCount": + err = unpopulate(val, "RestartCount", &c.RestartCount) + 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 ContainerLabel. +func (c ContainerLabel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerLabel. +func (c *ContainerLabel) UnmarshalJSON(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 "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerLogs. +func (c ContainerLogs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "content", c.Content) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerLogs. +func (c *ContainerLogs) UnmarshalJSON(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 "content": + err = unpopulate(val, "Content", &c.Content) + 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 ContainerState. +func (c ContainerState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "detailStatus", c.DetailStatus) + populate(objectMap, "exitCode", c.ExitCode) + populateTimeRFC3339(objectMap, "finishTime", c.FinishTime) + populateTimeRFC3339(objectMap, "startTime", c.StartTime) + populate(objectMap, "state", c.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerState. +func (c *ContainerState) UnmarshalJSON(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 "detailStatus": + err = unpopulate(val, "DetailStatus", &c.DetailStatus) + delete(rawMsg, key) + case "exitCode": + err = unpopulate(val, "ExitCode", &c.ExitCode) + delete(rawMsg, key) + case "finishTime": + err = unpopulateTimeRFC3339(val, "FinishTime", &c.FinishTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + 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 DiagnosticsDescription. +func (d DiagnosticsDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultSinkRefs", d.DefaultSinkRefs) + populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "sinks", d.Sinks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsDescription. +func (d *DiagnosticsDescription) UnmarshalJSON(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 "defaultSinkRefs": + err = unpopulate(val, "DefaultSinkRefs", &d.DefaultSinkRefs) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + case "sinks": + d.Sinks, err = unmarshalDiagnosticsSinkPropertiesClassificationArray(val) + 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 DiagnosticsRef. +func (d DiagnosticsRef) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "sinkRefs", d.SinkRefs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsRef. +func (d *DiagnosticsRef) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + case "sinkRefs": + err = unpopulate(val, "SinkRefs", &d.SinkRefs) + 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 DiagnosticsSinkProperties. +func (d DiagnosticsSinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", d.Description) + objectMap["kind"] = d.Kind + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsSinkProperties. +func (d *DiagnosticsSinkProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Dimension. +func (d Dimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "internalName", d.InternalName) + populate(objectMap, "name", d.Name) + populate(objectMap, "toBeExportedForShoebox", d.ToBeExportedForShoebox) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Dimension. +func (d *Dimension) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "internalName": + err = unpopulate(val, "InternalName", &d.InternalName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "toBeExportedForShoebox": + err = unpopulate(val, "ToBeExportedForShoebox", &d.ToBeExportedForShoebox) + 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 EndpointProperties. +func (e EndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + populate(objectMap, "port", e.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointProperties. +func (e *EndpointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &e.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointRef. +func (e EndpointRef) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointRef. +func (e *EndpointRef) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentVariable. +func (e EnvironmentVariable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVariable. +func (e *EnvironmentVariable) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetailsModel. +func (e ErrorDetailsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailsModel. +func (e *ErrorDetailsModel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorErrorModel. +func (e ErrorErrorModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "innerError", e.InnerError) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorErrorModel. +func (e *ErrorErrorModel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "innerError": + err = unpopulate(val, "InnerError", &e.InnerError) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorModel. +func (e ErrorModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorModel. +func (e *ErrorModel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayDestination. +func (g GatewayDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationName", g.ApplicationName) + populate(objectMap, "endpointName", g.EndpointName) + populate(objectMap, "serviceName", g.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayDestination. +func (g *GatewayDestination) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationName": + err = unpopulate(val, "ApplicationName", &g.ApplicationName) + delete(rawMsg, key) + case "endpointName": + err = unpopulate(val, "EndpointName", &g.EndpointName) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &g.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayProperties. +func (g GatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", g.Description) + populate(objectMap, "destinationNetwork", g.DestinationNetwork) + populate(objectMap, "http", g.HTTP) + populate(objectMap, "ipAddress", g.IPAddress) + populate(objectMap, "sourceNetwork", g.SourceNetwork) + populate(objectMap, "status", g.Status) + populate(objectMap, "statusDetails", g.StatusDetails) + populate(objectMap, "tcp", g.TCP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayProperties. +func (g *GatewayProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "destinationNetwork": + err = unpopulate(val, "DestinationNetwork", &g.DestinationNetwork) + delete(rawMsg, key) + case "http": + err = unpopulate(val, "HTTP", &g.HTTP) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &g.IPAddress) + delete(rawMsg, key) + case "sourceNetwork": + err = unpopulate(val, "SourceNetwork", &g.SourceNetwork) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &g.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &g.StatusDetails) + delete(rawMsg, key) + case "tcp": + err = unpopulate(val, "TCP", &g.TCP) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceDescription. +func (g GatewayResourceDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceDescription. +func (g *GatewayResourceDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceDescriptionList. +func (g GatewayResourceDescriptionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceDescriptionList. +func (g *GatewayResourceDescriptionList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceProperties. +func (g GatewayResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", g.Description) + populate(objectMap, "destinationNetwork", g.DestinationNetwork) + populate(objectMap, "http", g.HTTP) + populate(objectMap, "ipAddress", g.IPAddress) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "sourceNetwork", g.SourceNetwork) + populate(objectMap, "status", g.Status) + populate(objectMap, "statusDetails", g.StatusDetails) + populate(objectMap, "tcp", g.TCP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceProperties. +func (g *GatewayResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "destinationNetwork": + err = unpopulate(val, "DestinationNetwork", &g.DestinationNetwork) + delete(rawMsg, key) + case "http": + err = unpopulate(val, "HTTP", &g.HTTP) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &g.IPAddress) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + delete(rawMsg, key) + case "sourceNetwork": + err = unpopulate(val, "SourceNetwork", &g.SourceNetwork) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &g.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &g.StatusDetails) + delete(rawMsg, key) + case "tcp": + err = unpopulate(val, "TCP", &g.TCP) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPConfig. +func (h HTTPConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hosts", h.Hosts) + populate(objectMap, "name", h.Name) + populate(objectMap, "port", h.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPConfig. +func (h *HTTPConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hosts": + err = unpopulate(val, "Hosts", &h.Hosts) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &h.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPHostConfig. +func (h HTTPHostConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", h.Name) + populate(objectMap, "routes", h.Routes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHostConfig. +func (h *HTTPHostConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &h.Routes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPRouteConfig. +func (h HTTPRouteConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destination", h.Destination) + populate(objectMap, "match", h.Match) + populate(objectMap, "name", h.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteConfig. +func (h *HTTPRouteConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destination": + err = unpopulate(val, "Destination", &h.Destination) + delete(rawMsg, key) + case "match": + err = unpopulate(val, "Match", &h.Match) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPRouteMatchHeader. +func (h HTTPRouteMatchHeader) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", h.Name) + populate(objectMap, "type", h.Type) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteMatchHeader. +func (h *HTTPRouteMatchHeader) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPRouteMatchPath. +func (h HTTPRouteMatchPath) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "rewrite", h.Rewrite) + populate(objectMap, "type", h.Type) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteMatchPath. +func (h *HTTPRouteMatchPath) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "rewrite": + err = unpopulate(val, "Rewrite", &h.Rewrite) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPRouteMatchRule. +func (h HTTPRouteMatchRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", h.Headers) + populate(objectMap, "path", h.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteMatchRule. +func (h *HTTPRouteMatchRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "headers": + err = unpopulate(val, "Headers", &h.Headers) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &h.Path) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageRegistryCredential. +func (i ImageRegistryCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", i.Password) + populate(objectMap, "server", i.Server) + populate(objectMap, "username", i.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageRegistryCredential. +func (i *ImageRegistryCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "password": + err = unpopulate(val, "Password", &i.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &i.Server) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &i.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InlinedValueSecretResourceProperties. +func (i InlinedValueSecretResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "contentType", i.ContentType) + populate(objectMap, "description", i.Description) + objectMap["kind"] = SecretKindInlinedValue + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "status", i.Status) + populate(objectMap, "statusDetails", i.StatusDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InlinedValueSecretResourceProperties. +func (i *InlinedValueSecretResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentType": + err = unpopulate(val, "ContentType", &i.ContentType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &i.StatusDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalNetworkResourceProperties. +func (l LocalNetworkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", l.Description) + objectMap["kind"] = NetworkKindLocal + populate(objectMap, "networkAddressPrefix", l.NetworkAddressPrefix) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "status", l.Status) + populate(objectMap, "statusDetails", l.StatusDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalNetworkResourceProperties. +func (l *LocalNetworkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &l.Kind) + delete(rawMsg, key) + case "networkAddressPrefix": + err = unpopulate(val, "NetworkAddressPrefix", &l.NetworkAddressPrefix) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &l.StatusDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogSpecification. +func (l LogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", l.BlobDuration) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "logFilterPattern", l.LogFilterPattern) + populate(objectMap, "name", l.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. +func (l *LogSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &l.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "logFilterPattern": + err = unpopulate(val, "LogFilterPattern", &l.LogFilterPattern) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedProxyResource. +func (m ManagedProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedProxyResource. +func (m *ManagedProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. +func (m MetricAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", m.BlobDuration) + populate(objectMap, "timeGrain", m.TimeGrain) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. +func (m *MetricAvailability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &m.BlobDuration) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. +func (m MetricSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "availabilities", m.Availabilities) + populate(objectMap, "category", m.Category) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "enableRegionalMdmAccount", m.EnableRegionalMdmAccount) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "isInternal", m.IsInternal) + populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) + populate(objectMap, "name", m.Name) + populate(objectMap, "sourceMdmAccount", m.SourceMdmAccount) + populate(objectMap, "sourceMdmNamespace", m.SourceMdmNamespace) + populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) + populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) + populate(objectMap, "supportsInstanceLevelAggregation", m.SupportsInstanceLevelAggregation) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. +func (m *MetricSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationType": + err = unpopulate(val, "AggregationType", &m.AggregationType) + delete(rawMsg, key) + case "availabilities": + err = unpopulate(val, "Availabilities", &m.Availabilities) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &m.Category) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &m.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "enableRegionalMdmAccount": + err = unpopulate(val, "EnableRegionalMdmAccount", &m.EnableRegionalMdmAccount) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) + delete(rawMsg, key) + case "isInternal": + err = unpopulate(val, "IsInternal", &m.IsInternal) + delete(rawMsg, key) + case "metricFilterPattern": + err = unpopulate(val, "MetricFilterPattern", &m.MetricFilterPattern) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "sourceMdmAccount": + err = unpopulate(val, "SourceMdmAccount", &m.SourceMdmAccount) + delete(rawMsg, key) + case "sourceMdmNamespace": + err = unpopulate(val, "SourceMdmNamespace", &m.SourceMdmNamespace) + delete(rawMsg, key) + case "supportedAggregationTypes": + err = unpopulate(val, "SupportedAggregationTypes", &m.SupportedAggregationTypes) + delete(rawMsg, key) + case "supportedTimeGrainTypes": + err = unpopulate(val, "SupportedTimeGrainTypes", &m.SupportedTimeGrainTypes) + delete(rawMsg, key) + case "supportsInstanceLevelAggregation": + err = unpopulate(val, "SupportsInstanceLevelAggregation", &m.SupportsInstanceLevelAggregation) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRef. +func (n NetworkRef) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpointRefs", n.EndpointRefs) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRef. +func (n *NetworkRef) UnmarshalJSON(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 "endpointRefs": + err = unpopulate(val, "EndpointRefs", &n.EndpointRefs) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkResourceDescription. +func (n NetworkResourceDescription) 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, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkResourceDescription. +func (n *NetworkResourceDescription) UnmarshalJSON(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": + n.Properties, err = unmarshalNetworkResourcePropertiesClassification(val) + 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 NetworkResourceDescriptionList. +func (n NetworkResourceDescriptionList) 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 NetworkResourceDescriptionList. +func (n *NetworkResourceDescriptionList) UnmarshalJSON(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 NetworkResourceProperties. +func (n NetworkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + objectMap["kind"] = "NetworkResourceProperties" + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "status", n.Status) + populate(objectMap, "statusDetails", n.StatusDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkResourceProperties. +func (n *NetworkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &n.Kind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &n.StatusDetails) + 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 NetworkResourcePropertiesBase. +func (n NetworkResourcePropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = n.Kind + populate(objectMap, "provisioningState", n.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkResourcePropertiesBase. +func (n *NetworkResourcePropertiesBase) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &n.Kind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + 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 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 OperationResult. +func (o OperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResult. +func (o *OperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisionedResourceProperties. +func (p ProvisionedResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisionedResourceProperties. +func (p *ProvisionedResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReliableCollectionsRef. +func (r ReliableCollectionsRef) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "doNotPersistState", r.DoNotPersistState) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReliableCollectionsRef. +func (r *ReliableCollectionsRef) UnmarshalJSON(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 "doNotPersistState": + err = unpopulate(val, "DoNotPersistState", &r.DoNotPersistState) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceLimits. +func (r ResourceLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpu", r.CPU) + populate(objectMap, "memoryInGB", r.MemoryInGB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLimits. +func (r *ResourceLimits) UnmarshalJSON(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 "cpu": + err = unpopulate(val, "CPU", &r.CPU) + delete(rawMsg, key) + case "memoryInGB": + err = unpopulate(val, "MemoryInGB", &r.MemoryInGB) + 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 ResourceRequests. +func (r ResourceRequests) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpu", r.CPU) + populate(objectMap, "memoryInGB", r.MemoryInGB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRequests. +func (r *ResourceRequests) UnmarshalJSON(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 "cpu": + err = unpopulate(val, "CPU", &r.CPU) + delete(rawMsg, key) + case "memoryInGB": + err = unpopulate(val, "MemoryInGB", &r.MemoryInGB) + 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 ResourceRequirements. +func (r ResourceRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limits", r.Limits) + populate(objectMap, "requests", r.Requests) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRequirements. +func (r *ResourceRequirements) UnmarshalJSON(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 "limits": + err = unpopulate(val, "Limits", &r.Limits) + delete(rawMsg, key) + case "requests": + err = unpopulate(val, "Requests", &r.Requests) + 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 SecretResourceDescription. +func (s SecretResourceDescription) 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, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretResourceDescription. +func (s *SecretResourceDescription) UnmarshalJSON(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": + s.Properties, err = unmarshalSecretResourcePropertiesClassification(val) + 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 SecretResourceDescriptionList. +func (s SecretResourceDescriptionList) 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 SecretResourceDescriptionList. +func (s *SecretResourceDescriptionList) UnmarshalJSON(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 SecretResourceProperties. +func (s SecretResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "contentType", s.ContentType) + populate(objectMap, "description", s.Description) + objectMap["kind"] = "SecretResourceProperties" + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "status", s.Status) + populate(objectMap, "statusDetails", s.StatusDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretResourceProperties. +func (s *SecretResourceProperties) UnmarshalJSON(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 "contentType": + err = unpopulate(val, "ContentType", &s.ContentType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &s.StatusDetails) + 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 SecretResourcePropertiesBase. +func (s SecretResourcePropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = s.Kind + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretResourcePropertiesBase. +func (s *SecretResourcePropertiesBase) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretValue. +func (s SecretValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretValue. +func (s *SecretValue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretValueProperties. +func (s SecretValueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretValueProperties. +func (s *SecretValueProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretValueResourceDescription. +func (s SecretValueResourceDescription) 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, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretValueResourceDescription. +func (s *SecretValueResourceDescription) UnmarshalJSON(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 "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 SecretValueResourceDescriptionList. +func (s SecretValueResourceDescriptionList) 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 SecretValueResourceDescriptionList. +func (s *SecretValueResourceDescriptionList) UnmarshalJSON(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 SecretValueResourceProperties. +func (s SecretValueResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretValueResourceProperties. +func (s *SecretValueResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "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 ServiceProperties. +func (s ServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoScalingPolicies", s.AutoScalingPolicies) + populate(objectMap, "description", s.Description) + populate(objectMap, "healthState", s.HealthState) + populate(objectMap, "replicaCount", s.ReplicaCount) + populate(objectMap, "status", s.Status) + populate(objectMap, "statusDetails", s.StatusDetails) + populate(objectMap, "unhealthyEvaluation", s.UnhealthyEvaluation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties. +func (s *ServiceProperties) UnmarshalJSON(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 "autoScalingPolicies": + err = unpopulate(val, "AutoScalingPolicies", &s.AutoScalingPolicies) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &s.HealthState) + delete(rawMsg, key) + case "replicaCount": + err = unpopulate(val, "ReplicaCount", &s.ReplicaCount) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &s.StatusDetails) + delete(rawMsg, key) + case "unhealthyEvaluation": + err = unpopulate(val, "UnhealthyEvaluation", &s.UnhealthyEvaluation) + 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 ServiceReplicaDescription. +func (s ServiceReplicaDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "codePackages", s.CodePackages) + populate(objectMap, "diagnostics", s.Diagnostics) + populate(objectMap, "networkRefs", s.NetworkRefs) + populate(objectMap, "osType", s.OSType) + populate(objectMap, "replicaName", s.ReplicaName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceReplicaDescription. +func (s *ServiceReplicaDescription) UnmarshalJSON(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 "codePackages": + err = unpopulate(val, "CodePackages", &s.CodePackages) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &s.Diagnostics) + delete(rawMsg, key) + case "networkRefs": + err = unpopulate(val, "NetworkRefs", &s.NetworkRefs) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &s.OSType) + delete(rawMsg, key) + case "replicaName": + err = unpopulate(val, "ReplicaName", &s.ReplicaName) + 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 ServiceReplicaDescriptionList. +func (s ServiceReplicaDescriptionList) 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 ServiceReplicaDescriptionList. +func (s *ServiceReplicaDescriptionList) UnmarshalJSON(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 ServiceReplicaProperties. +func (s ServiceReplicaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "codePackages", s.CodePackages) + populate(objectMap, "diagnostics", s.Diagnostics) + populate(objectMap, "networkRefs", s.NetworkRefs) + populate(objectMap, "osType", s.OSType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceReplicaProperties. +func (s *ServiceReplicaProperties) UnmarshalJSON(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 "codePackages": + err = unpopulate(val, "CodePackages", &s.CodePackages) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &s.Diagnostics) + delete(rawMsg, key) + case "networkRefs": + err = unpopulate(val, "NetworkRefs", &s.NetworkRefs) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &s.OSType) + 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 ServiceResourceDescription. +func (s ServiceResourceDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceDescription. +func (s *ServiceResourceDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceResourceDescriptionList. +func (s ServiceResourceDescriptionList) 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 ServiceResourceDescriptionList. +func (s *ServiceResourceDescriptionList) UnmarshalJSON(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 ServiceResourceProperties. +func (s ServiceResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoScalingPolicies", s.AutoScalingPolicies) + populate(objectMap, "codePackages", s.CodePackages) + populate(objectMap, "description", s.Description) + populate(objectMap, "diagnostics", s.Diagnostics) + populate(objectMap, "healthState", s.HealthState) + populate(objectMap, "networkRefs", s.NetworkRefs) + populate(objectMap, "osType", s.OSType) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "replicaCount", s.ReplicaCount) + populate(objectMap, "status", s.Status) + populate(objectMap, "statusDetails", s.StatusDetails) + populate(objectMap, "unhealthyEvaluation", s.UnhealthyEvaluation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceProperties. +func (s *ServiceResourceProperties) UnmarshalJSON(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 "autoScalingPolicies": + err = unpopulate(val, "AutoScalingPolicies", &s.AutoScalingPolicies) + delete(rawMsg, key) + case "codePackages": + err = unpopulate(val, "CodePackages", &s.CodePackages) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "diagnostics": + err = unpopulate(val, "Diagnostics", &s.Diagnostics) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &s.HealthState) + delete(rawMsg, key) + case "networkRefs": + err = unpopulate(val, "NetworkRefs", &s.NetworkRefs) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &s.OSType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "replicaCount": + err = unpopulate(val, "ReplicaCount", &s.ReplicaCount) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &s.StatusDetails) + delete(rawMsg, key) + case "unhealthyEvaluation": + err = unpopulate(val, "UnhealthyEvaluation", &s.UnhealthyEvaluation) + 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 ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logSpecifications", s.LogSpecifications) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) UnmarshalJSON(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 "logSpecifications": + err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) + delete(rawMsg, key) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) + 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 Setting. +func (s Setting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Setting. +func (s *Setting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + 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 TCPConfig. +func (t TCPConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destination", t.Destination) + populate(objectMap, "name", t.Name) + populate(objectMap, "port", t.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TCPConfig. +func (t *TCPConfig) UnmarshalJSON(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 "destination": + err = unpopulate(val, "Destination", &t.Destination) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &t.Port) + 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 TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + 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 VolumeProperties. +func (v VolumeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureFileParameters", v.AzureFileParameters) + populate(objectMap, "description", v.Description) + populate(objectMap, "provider", v.Provider) + populate(objectMap, "status", v.Status) + populate(objectMap, "statusDetails", v.StatusDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeProperties. +func (v *VolumeProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureFileParameters": + err = unpopulate(val, "AzureFileParameters", &v.AzureFileParameters) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &v.Description) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &v.Provider) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &v.StatusDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeProviderParametersAzureFile. +func (v VolumeProviderParametersAzureFile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountKey", v.AccountKey) + populate(objectMap, "accountName", v.AccountName) + populate(objectMap, "shareName", v.ShareName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeProviderParametersAzureFile. +func (v *VolumeProviderParametersAzureFile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountKey": + err = unpopulate(val, "AccountKey", &v.AccountKey) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &v.AccountName) + delete(rawMsg, key) + case "shareName": + err = unpopulate(val, "ShareName", &v.ShareName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeReference. +func (v VolumeReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationPath", v.DestinationPath) + populate(objectMap, "name", v.Name) + populate(objectMap, "readOnly", v.ReadOnly) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeReference. +func (v *VolumeReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationPath": + err = unpopulate(val, "DestinationPath", &v.DestinationPath) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "readOnly": + err = unpopulate(val, "ReadOnly", &v.ReadOnly) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeResourceDescription. +func (v VolumeResourceDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeResourceDescription. +func (v *VolumeResourceDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeResourceDescriptionList. +func (v VolumeResourceDescriptionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeResourceDescriptionList. +func (v *VolumeResourceDescriptionList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeResourceProperties. +func (v VolumeResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureFileParameters", v.AzureFileParameters) + populate(objectMap, "description", v.Description) + populate(objectMap, "provider", v.Provider) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "status", v.Status) + populate(objectMap, "statusDetails", v.StatusDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeResourceProperties. +func (v *VolumeResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureFileParameters": + err = unpopulate(val, "AzureFileParameters", &v.AzureFileParameters) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &v.Description) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &v.Provider) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &v.StatusDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_network_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/network_client.go similarity index 91% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_network_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/network_client.go index e452d2ce22e5..8e323467b802 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_network_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/network_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type NetworkClient struct { } // NewNetworkClient creates a new instance of NetworkClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNetworkClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +58,12 @@ func NewNetworkClient(subscriptionID string, credential azcore.TokenCredential, // Create - Creates a network resource with the specified name, description and properties. If a network resource with the // same name exists, then it is updated with the specified description and properties. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// networkResourceName - The identity of the network. -// networkResourceDescription - Description for creating a Network resource. -// options - NetworkClientCreateOptions contains the optional parameters for the NetworkClient.Create method. +// - resourceGroupName - Azure resource group name +// - networkResourceName - The identity of the network. +// - networkResourceDescription - Description for creating a Network resource. +// - options - NetworkClientCreateOptions contains the optional parameters for the NetworkClient.Create method. func (client *NetworkClient) Create(ctx context.Context, resourceGroupName string, networkResourceName string, networkResourceDescription NetworkResourceDescription, options *NetworkClientCreateOptions) (NetworkClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, networkResourceName, networkResourceDescription, options) if err != nil { @@ -111,10 +113,11 @@ func (client *NetworkClient) createHandleResponse(resp *http.Response) (NetworkC // Delete - Deletes the network resource identified by the name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// networkResourceName - The identity of the network. -// options - NetworkClientDeleteOptions contains the optional parameters for the NetworkClient.Delete method. +// - resourceGroupName - Azure resource group name +// - networkResourceName - The identity of the network. +// - options - NetworkClientDeleteOptions contains the optional parameters for the NetworkClient.Delete method. func (client *NetworkClient) Delete(ctx context.Context, resourceGroupName string, networkResourceName string, options *NetworkClientDeleteOptions) (NetworkClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkResourceName, options) if err != nil { @@ -156,10 +159,11 @@ func (client *NetworkClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the information about the network resource with the given name. The information include the description and // other properties of the network. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// networkResourceName - The identity of the network. -// options - NetworkClientGetOptions contains the optional parameters for the NetworkClient.Get method. +// - resourceGroupName - Azure resource group name +// - networkResourceName - The identity of the network. +// - options - NetworkClientGetOptions contains the optional parameters for the NetworkClient.Get method. func (client *NetworkClient) Get(ctx context.Context, resourceGroupName string, networkResourceName string, options *NetworkClientGetOptions) (NetworkClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, networkResourceName, options) if err != nil { @@ -209,11 +213,11 @@ func (client *NetworkClient) getHandleResponse(resp *http.Response) (NetworkClie // NewListByResourceGroupPager - Gets the information about all network resources in a given resource group. The information // include the description and other properties of the Network. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// options - NetworkClientListByResourceGroupOptions contains the optional parameters for the NetworkClient.ListByResourceGroup -// method. +// - resourceGroupName - Azure resource group name +// - options - NetworkClientListByResourceGroupOptions contains the optional parameters for the NetworkClient.NewListByResourceGroupPager +// method. func (client *NetworkClient) NewListByResourceGroupPager(resourceGroupName string, options *NetworkClientListByResourceGroupOptions) *runtime.Pager[NetworkClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[NetworkClientListByResourceGroupResponse]{ More: func(page NetworkClientListByResourceGroupResponse) bool { @@ -275,10 +279,10 @@ func (client *NetworkClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListBySubscriptionPager - Gets the information about all network resources in a given resource group. The information // include the description and other properties of the network. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// options - NetworkClientListBySubscriptionOptions contains the optional parameters for the NetworkClient.ListBySubscription -// method. +// - options - NetworkClientListBySubscriptionOptions contains the optional parameters for the NetworkClient.NewListBySubscriptionPager +// method. func (client *NetworkClient) NewListBySubscriptionPager(options *NetworkClientListBySubscriptionOptions) *runtime.Pager[NetworkClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[NetworkClientListBySubscriptionResponse]{ More: func(page NetworkClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_operations_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/operations_client.go similarity index 92% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_operations_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/operations_client.go index 130dc34a470f..3a01f5d9c6ca 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_operations_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -27,8 +28,8 @@ type OperationsClient struct { } // 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all the available operations provided by Service Fabric SeaBreeze resource provider. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - 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 { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/polymorphic_helpers.go similarity index 95% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/polymorphic_helpers.go index 7dcf2c8c9433..5abcfd9cd3a1 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/polymorphic_helpers.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -14,7 +15,7 @@ func unmarshalApplicationScopedVolumeCreationParametersClassification(rawMsg jso if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -32,7 +33,7 @@ func unmarshalAutoScalingMechanismClassification(rawMsg json.RawMessage) (AutoSc if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -50,7 +51,7 @@ func unmarshalAutoScalingMetricClassification(rawMsg json.RawMessage) (AutoScali if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -68,7 +69,7 @@ func unmarshalAutoScalingTriggerClassification(rawMsg json.RawMessage) (AutoScal if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -86,7 +87,7 @@ func unmarshalDiagnosticsSinkPropertiesClassification(rawMsg json.RawMessage) (D if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -123,7 +124,7 @@ func unmarshalNetworkResourcePropertiesClassification(rawMsg json.RawMessage) (N if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -141,7 +142,7 @@ func unmarshalSecretResourcePropertiesClassification(rawMsg json.RawMessage) (Se if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_response_types.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/response_types.go similarity index 89% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_response_types.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/response_types.go index f9c4e9fd8786..97b506959c9d 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_response_types.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -23,12 +24,12 @@ type ApplicationClientGetResponse struct { ApplicationResourceDescription } -// ApplicationClientListByResourceGroupResponse contains the response from method ApplicationClient.ListByResourceGroup. +// ApplicationClientListByResourceGroupResponse contains the response from method ApplicationClient.NewListByResourceGroupPager. type ApplicationClientListByResourceGroupResponse struct { ApplicationResourceDescriptionList } -// ApplicationClientListBySubscriptionResponse contains the response from method ApplicationClient.ListBySubscription. +// ApplicationClientListBySubscriptionResponse contains the response from method ApplicationClient.NewListBySubscriptionPager. type ApplicationClientListBySubscriptionResponse struct { ApplicationResourceDescriptionList } @@ -53,12 +54,12 @@ type GatewayClientGetResponse struct { GatewayResourceDescription } -// GatewayClientListByResourceGroupResponse contains the response from method GatewayClient.ListByResourceGroup. +// GatewayClientListByResourceGroupResponse contains the response from method GatewayClient.NewListByResourceGroupPager. type GatewayClientListByResourceGroupResponse struct { GatewayResourceDescriptionList } -// GatewayClientListBySubscriptionResponse contains the response from method GatewayClient.ListBySubscription. +// GatewayClientListBySubscriptionResponse contains the response from method GatewayClient.NewListBySubscriptionPager. type GatewayClientListBySubscriptionResponse struct { GatewayResourceDescriptionList } @@ -78,17 +79,17 @@ type NetworkClientGetResponse struct { NetworkResourceDescription } -// NetworkClientListByResourceGroupResponse contains the response from method NetworkClient.ListByResourceGroup. +// NetworkClientListByResourceGroupResponse contains the response from method NetworkClient.NewListByResourceGroupPager. type NetworkClientListByResourceGroupResponse struct { NetworkResourceDescriptionList } -// NetworkClientListBySubscriptionResponse contains the response from method NetworkClient.ListBySubscription. +// NetworkClientListBySubscriptionResponse contains the response from method NetworkClient.NewListBySubscriptionPager. type NetworkClientListBySubscriptionResponse struct { NetworkResourceDescriptionList } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } @@ -108,12 +109,12 @@ type SecretClientGetResponse struct { SecretResourceDescription } -// SecretClientListByResourceGroupResponse contains the response from method SecretClient.ListByResourceGroup. +// SecretClientListByResourceGroupResponse contains the response from method SecretClient.NewListByResourceGroupPager. type SecretClientListByResourceGroupResponse struct { SecretResourceDescriptionList } -// SecretClientListBySubscriptionResponse contains the response from method SecretClient.ListBySubscription. +// SecretClientListBySubscriptionResponse contains the response from method SecretClient.NewListBySubscriptionPager. type SecretClientListBySubscriptionResponse struct { SecretResourceDescriptionList } @@ -133,7 +134,7 @@ type SecretValueClientGetResponse struct { SecretValueResourceDescription } -// SecretValueClientListResponse contains the response from method SecretValueClient.List. +// SecretValueClientListResponse contains the response from method SecretValueClient.NewListPager. type SecretValueClientListResponse struct { SecretValueResourceDescriptionList } @@ -148,7 +149,7 @@ type ServiceClientGetResponse struct { ServiceResourceDescription } -// ServiceClientListResponse contains the response from method ServiceClient.List. +// ServiceClientListResponse contains the response from method ServiceClient.NewListPager. type ServiceClientListResponse struct { ServiceResourceDescriptionList } @@ -158,7 +159,7 @@ type ServiceReplicaClientGetResponse struct { ServiceReplicaDescription } -// ServiceReplicaClientListResponse contains the response from method ServiceReplicaClient.List. +// ServiceReplicaClientListResponse contains the response from method ServiceReplicaClient.NewListPager. type ServiceReplicaClientListResponse struct { ServiceReplicaDescriptionList } @@ -178,12 +179,12 @@ type VolumeClientGetResponse struct { VolumeResourceDescription } -// VolumeClientListByResourceGroupResponse contains the response from method VolumeClient.ListByResourceGroup. +// VolumeClientListByResourceGroupResponse contains the response from method VolumeClient.NewListByResourceGroupPager. type VolumeClientListByResourceGroupResponse struct { VolumeResourceDescriptionList } -// VolumeClientListBySubscriptionResponse contains the response from method VolumeClient.ListBySubscription. +// VolumeClientListBySubscriptionResponse contains the response from method VolumeClient.NewListBySubscriptionPager. type VolumeClientListBySubscriptionResponse struct { VolumeResourceDescriptionList } diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_secret_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/secret_client.go similarity index 91% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_secret_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/secret_client.go index 9973be811880..9d0362a5e617 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_secret_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/secret_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type SecretClient struct { } // NewSecretClient creates a new instance of SecretClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSecretClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecretClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +58,12 @@ func NewSecretClient(subscriptionID string, credential azcore.TokenCredential, o // Create - Creates a secret resource with the specified name, description and properties. If a secret resource with the same // name exists, then it is updated with the specified description and properties. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// secretResourceDescription - Description for creating a secret resource. -// options - SecretClientCreateOptions contains the optional parameters for the SecretClient.Create method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - secretResourceDescription - Description for creating a secret resource. +// - options - SecretClientCreateOptions contains the optional parameters for the SecretClient.Create method. func (client *SecretClient) Create(ctx context.Context, resourceGroupName string, secretResourceName string, secretResourceDescription SecretResourceDescription, options *SecretClientCreateOptions) (SecretClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, secretResourceName, secretResourceDescription, options) if err != nil { @@ -111,10 +113,11 @@ func (client *SecretClient) createHandleResponse(resp *http.Response) (SecretCli // Delete - Deletes the secret resource identified by the name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// options - SecretClientDeleteOptions contains the optional parameters for the SecretClient.Delete method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - options - SecretClientDeleteOptions contains the optional parameters for the SecretClient.Delete method. func (client *SecretClient) Delete(ctx context.Context, resourceGroupName string, secretResourceName string, options *SecretClientDeleteOptions) (SecretClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, secretResourceName, options) if err != nil { @@ -156,10 +159,11 @@ func (client *SecretClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the information about the secret resource with the given name. The information include the description and other // properties of the secret. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// options - SecretClientGetOptions contains the optional parameters for the SecretClient.Get method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - options - SecretClientGetOptions contains the optional parameters for the SecretClient.Get method. func (client *SecretClient) Get(ctx context.Context, resourceGroupName string, secretResourceName string, options *SecretClientGetOptions) (SecretClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, secretResourceName, options) if err != nil { @@ -209,11 +213,11 @@ func (client *SecretClient) getHandleResponse(resp *http.Response) (SecretClient // NewListByResourceGroupPager - Gets the information about all secret resources in a given resource group. The information // include the description and other properties of the Secret. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// options - SecretClientListByResourceGroupOptions contains the optional parameters for the SecretClient.ListByResourceGroup -// method. +// - resourceGroupName - Azure resource group name +// - options - SecretClientListByResourceGroupOptions contains the optional parameters for the SecretClient.NewListByResourceGroupPager +// method. func (client *SecretClient) NewListByResourceGroupPager(resourceGroupName string, options *SecretClientListByResourceGroupOptions) *runtime.Pager[SecretClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[SecretClientListByResourceGroupResponse]{ More: func(page SecretClientListByResourceGroupResponse) bool { @@ -275,10 +279,10 @@ func (client *SecretClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - Gets the information about all secret resources in a given resource group. The information // include the description and other properties of the secret. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// options - SecretClientListBySubscriptionOptions contains the optional parameters for the SecretClient.ListBySubscription -// method. +// - options - SecretClientListBySubscriptionOptions contains the optional parameters for the SecretClient.NewListBySubscriptionPager +// method. func (client *SecretClient) NewListBySubscriptionPager(options *SecretClientListBySubscriptionOptions) *runtime.Pager[SecretClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[SecretClientListBySubscriptionResponse]{ More: func(page SecretClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_secretvalue_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/secretvalue_client.go similarity index 88% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_secretvalue_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/secretvalue_client.go index 93b469491de3..25f53a57ca09 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_secretvalue_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/secretvalue_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type SecretValueClient struct { } // NewSecretValueClient creates a new instance of SecretValueClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSecretValueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecretValueClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ func NewSecretValueClient(subscriptionID string, credential azcore.TokenCredenti // Create - Creates a new value of the specified secret resource. The name of the value is typically the version identifier. // Once created the value cannot be changed. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. -// secretValueResourceDescription - Description for creating a value of a secret resource. -// options - SecretValueClientCreateOptions contains the optional parameters for the SecretValueClient.Create method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. +// - secretValueResourceDescription - Description for creating a value of a secret resource. +// - options - SecretValueClientCreateOptions contains the optional parameters for the SecretValueClient.Create method. func (client *SecretValueClient) Create(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string, secretValueResourceDescription SecretValueResourceDescription, options *SecretValueClientCreateOptions) (SecretValueClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, secretResourceName, secretValueResourceName, secretValueResourceDescription, options) if err != nil { @@ -114,11 +116,12 @@ func (client *SecretValueClient) createHandleResponse(resp *http.Response) (Secr // Delete - Deletes the secret value resource identified by the name. The name of the resource is typically the version associated // with that value. Deletion will fail if the specified value is in use. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. -// options - SecretValueClientDeleteOptions contains the optional parameters for the SecretValueClient.Delete method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. +// - options - SecretValueClientDeleteOptions contains the optional parameters for the SecretValueClient.Delete method. func (client *SecretValueClient) Delete(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string, options *SecretValueClientDeleteOptions) (SecretValueClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, secretResourceName, secretValueResourceName, options) if err != nil { @@ -161,11 +164,12 @@ func (client *SecretValueClient) deleteCreateRequest(ctx context.Context, resour // Get - Get the information about the specified named secret value resources. The information does not include the actual // value of the secret. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. -// options - SecretValueClientGetOptions contains the optional parameters for the SecretValueClient.Get method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. +// - options - SecretValueClientGetOptions contains the optional parameters for the SecretValueClient.Get method. func (client *SecretValueClient) Get(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string, options *SecretValueClientGetOptions) (SecretValueClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, secretResourceName, secretValueResourceName, options) if err != nil { @@ -216,11 +220,11 @@ func (client *SecretValueClient) getHandleResponse(resp *http.Response) (SecretV // NewListPager - Gets information about all secret value resources of the specified secret resource. The information includes // the names of the secret value resources, but not the actual values. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// options - SecretValueClientListOptions contains the optional parameters for the SecretValueClient.List method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - options - SecretValueClientListOptions contains the optional parameters for the SecretValueClient.NewListPager method. func (client *SecretValueClient) NewListPager(resourceGroupName string, secretResourceName string, options *SecretValueClientListOptions) *runtime.Pager[SecretValueClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SecretValueClientListResponse]{ More: func(page SecretValueClientListResponse) bool { @@ -283,11 +287,12 @@ func (client *SecretValueClient) listHandleResponse(resp *http.Response) (Secret // ListValue - Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// secretResourceName - The name of the secret resource. -// secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. -// options - SecretValueClientListValueOptions contains the optional parameters for the SecretValueClient.ListValue method. +// - resourceGroupName - Azure resource group name +// - secretResourceName - The name of the secret resource. +// - secretValueResourceName - The name of the secret resource value which is typically the version identifier for the value. +// - options - SecretValueClientListValueOptions contains the optional parameters for the SecretValueClient.ListValue method. func (client *SecretValueClient) ListValue(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string, options *SecretValueClientListValueOptions) (SecretValueClientListValueResponse, error) { req, err := client.listValueCreateRequest(ctx, resourceGroupName, secretResourceName, secretValueResourceName, options) if err != nil { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_service_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/service_client.go similarity index 90% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_service_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/service_client.go index d9982b072bb3..f28b4dd77e07 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_service_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/service_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type ServiceClient struct { } // NewServiceClient creates a new instance of ServiceClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +58,12 @@ func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, // Get - Gets the information about the service resource with the given name. The information include the description and // other properties of the service. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// serviceResourceName - The identity of the service. -// options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - serviceResourceName - The identity of the service. +// - options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. func (client *ServiceClient) Get(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string, options *ServiceClientGetOptions) (ServiceClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, applicationResourceName, serviceResourceName, options) if err != nil { @@ -112,11 +114,11 @@ func (client *ServiceClient) getHandleResponse(resp *http.Response) (ServiceClie // NewListPager - Gets the information about all services of an application resource. The information include the description // and other properties of the Service. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// options - ServiceClientListOptions contains the optional parameters for the ServiceClient.List method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - options - ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method. func (client *ServiceClient) NewListPager(resourceGroupName string, applicationResourceName string, options *ServiceClientListOptions) *runtime.Pager[ServiceClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceClientListResponse]{ More: func(page ServiceClientListResponse) bool { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_servicereplica_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/servicereplica_client.go similarity index 89% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_servicereplica_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/servicereplica_client.go index a188ba452f81..b1edd152e12d 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_servicereplica_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/servicereplica_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type ServiceReplicaClient struct { } // NewServiceReplicaClient creates a new instance of ServiceReplicaClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServiceReplicaClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceReplicaClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ func NewServiceReplicaClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets the information about the service replica with the given name. The information include the description and other // properties of the service replica. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// serviceResourceName - The identity of the service. -// replicaName - Service Fabric replica name. -// options - ServiceReplicaClientGetOptions contains the optional parameters for the ServiceReplicaClient.Get method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - serviceResourceName - The identity of the service. +// - replicaName - Service Fabric replica name. +// - options - ServiceReplicaClientGetOptions contains the optional parameters for the ServiceReplicaClient.Get method. func (client *ServiceReplicaClient) Get(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string, replicaName string, options *ServiceReplicaClientGetOptions) (ServiceReplicaClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, applicationResourceName, serviceResourceName, replicaName, options) if err != nil { @@ -114,12 +116,12 @@ func (client *ServiceReplicaClient) getHandleResponse(resp *http.Response) (Serv // NewListPager - Gets the information about all replicas of a given service of an application. The information includes the // runtime properties of the replica instance. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// applicationResourceName - The identity of the application. -// serviceResourceName - The identity of the service. -// options - ServiceReplicaClientListOptions contains the optional parameters for the ServiceReplicaClient.List method. +// - resourceGroupName - Azure resource group name +// - applicationResourceName - The identity of the application. +// - serviceResourceName - The identity of the service. +// - options - ServiceReplicaClientListOptions contains the optional parameters for the ServiceReplicaClient.NewListPager method. func (client *ServiceReplicaClient) NewListPager(resourceGroupName string, applicationResourceName string, serviceResourceName string, options *ServiceReplicaClientListOptions) *runtime.Pager[ServiceReplicaClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceReplicaClientListResponse]{ More: func(page ServiceReplicaClientListResponse) bool { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_time_rfc3339.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/time_rfc3339.go index f824913c3b26..3d72676c480a 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_volume_client.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/volume_client.go similarity index 91% rename from sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_volume_client.go rename to sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/volume_client.go index b42a8cd86821..1719d332a3af 100644 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_volume_client.go +++ b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/volume_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for 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 armservicefabricmesh @@ -31,9 +32,9 @@ type VolumeClient struct { } // NewVolumeClient creates a new instance of VolumeClient with the specified values. -// subscriptionID - The customer subscription identifier -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The customer subscription identifier +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVolumeClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumeClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +58,12 @@ func NewVolumeClient(subscriptionID string, credential azcore.TokenCredential, o // Create - Creates a volume resource with the specified name, description and properties. If a volume resource with the same // name exists, then it is updated with the specified description and properties. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// volumeResourceName - The identity of the volume. -// volumeResourceDescription - Description for creating a Volume resource. -// options - VolumeClientCreateOptions contains the optional parameters for the VolumeClient.Create method. +// - resourceGroupName - Azure resource group name +// - volumeResourceName - The identity of the volume. +// - volumeResourceDescription - Description for creating a Volume resource. +// - options - VolumeClientCreateOptions contains the optional parameters for the VolumeClient.Create method. func (client *VolumeClient) Create(ctx context.Context, resourceGroupName string, volumeResourceName string, volumeResourceDescription VolumeResourceDescription, options *VolumeClientCreateOptions) (VolumeClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, volumeResourceName, volumeResourceDescription, options) if err != nil { @@ -111,10 +113,11 @@ func (client *VolumeClient) createHandleResponse(resp *http.Response) (VolumeCli // Delete - Deletes the volume resource identified by the name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// volumeResourceName - The identity of the volume. -// options - VolumeClientDeleteOptions contains the optional parameters for the VolumeClient.Delete method. +// - resourceGroupName - Azure resource group name +// - volumeResourceName - The identity of the volume. +// - options - VolumeClientDeleteOptions contains the optional parameters for the VolumeClient.Delete method. func (client *VolumeClient) Delete(ctx context.Context, resourceGroupName string, volumeResourceName string, options *VolumeClientDeleteOptions) (VolumeClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, volumeResourceName, options) if err != nil { @@ -156,10 +159,11 @@ func (client *VolumeClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the information about the volume resource with the given name. The information include the description and other // properties of the volume. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// volumeResourceName - The identity of the volume. -// options - VolumeClientGetOptions contains the optional parameters for the VolumeClient.Get method. +// - resourceGroupName - Azure resource group name +// - volumeResourceName - The identity of the volume. +// - options - VolumeClientGetOptions contains the optional parameters for the VolumeClient.Get method. func (client *VolumeClient) Get(ctx context.Context, resourceGroupName string, volumeResourceName string, options *VolumeClientGetOptions) (VolumeClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, volumeResourceName, options) if err != nil { @@ -209,11 +213,11 @@ func (client *VolumeClient) getHandleResponse(resp *http.Response) (VolumeClient // NewListByResourceGroupPager - Gets the information about all volume resources in a given resource group. The information // include the description and other properties of the Volume. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// resourceGroupName - Azure resource group name -// options - VolumeClientListByResourceGroupOptions contains the optional parameters for the VolumeClient.ListByResourceGroup -// method. +// - resourceGroupName - Azure resource group name +// - options - VolumeClientListByResourceGroupOptions contains the optional parameters for the VolumeClient.NewListByResourceGroupPager +// method. func (client *VolumeClient) NewListByResourceGroupPager(resourceGroupName string, options *VolumeClientListByResourceGroupOptions) *runtime.Pager[VolumeClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[VolumeClientListByResourceGroupResponse]{ More: func(page VolumeClientListByResourceGroupResponse) bool { @@ -275,10 +279,10 @@ func (client *VolumeClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - Gets the information about all volume resources in a given resource group. The information // include the description and other properties of the volume. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2018-09-01-preview -// options - VolumeClientListBySubscriptionOptions contains the optional parameters for the VolumeClient.ListBySubscription -// method. +// - options - VolumeClientListBySubscriptionOptions contains the optional parameters for the VolumeClient.NewListBySubscriptionPager +// method. func (client *VolumeClient) NewListBySubscriptionPager(options *VolumeClientListBySubscriptionOptions) *runtime.Pager[VolumeClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[VolumeClientListBySubscriptionResponse]{ More: func(page VolumeClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_application_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_application_client_test.go deleted file mode 100644 index ea3be2224122..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_application_client_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. - -package armservicefabricmesh_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/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/create_update.json -func ExampleApplicationClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewApplicationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "sbz_demo", - "sampleApplication", - armservicefabricmesh.ApplicationResourceDescription{ - Location: to.Ptr("EastUS"), - Tags: map[string]*string{}, - Properties: &armservicefabricmesh.ApplicationResourceProperties{ - Description: to.Ptr("Service Fabric Mesh sample application."), - Services: []*armservicefabricmesh.ServiceResourceDescription{ - { - Name: to.Ptr("helloWorldService"), - Properties: &armservicefabricmesh.ServiceResourceProperties{ - Description: to.Ptr("SeaBreeze Hello World Service."), - ReplicaCount: to.Ptr[int32](1), - CodePackages: []*armservicefabricmesh.ContainerCodePackageProperties{ - { - Name: to.Ptr("helloWorldCode"), - Endpoints: []*armservicefabricmesh.EndpointProperties{ - { - Name: to.Ptr("helloWorldListener"), - Port: to.Ptr[int32](80), - }}, - Image: to.Ptr("seabreeze/sbz-helloworld:1.0-alpine"), - Resources: &armservicefabricmesh.ResourceRequirements{ - Requests: &armservicefabricmesh.ResourceRequests{ - CPU: to.Ptr[float64](1), - MemoryInGB: to.Ptr[float64](1), - }, - }, - }}, - NetworkRefs: []*armservicefabricmesh.NetworkRef{ - { - Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/networks/sampleNetwork"), - EndpointRefs: []*armservicefabricmesh.EndpointRef{ - { - Name: to.Ptr("helloWorldListener"), - }}, - }}, - OSType: to.Ptr(armservicefabricmesh.OperatingSystemTypeLinux), - }, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/get.json -func ExampleApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewApplicationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "sampleApplication", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/delete.json -func ExampleApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewApplicationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sbz_demo", - "sampleApplication", - 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/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/list_byResourceGroup.json -func ExampleApplicationClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewApplicationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sbz_demo", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/list_bySubscriptionId.json -func ExampleApplicationClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewApplicationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_codepackage_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_codepackage_client_test.go deleted file mode 100644 index 12d32bd89f86..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_codepackage_client_test.go +++ /dev/null @@ -1,42 +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. - -package armservicefabricmesh_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/codepackages/get_logs.json -func ExampleCodePackageClient_GetContainerLogs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewCodePackageClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetContainerLogs(ctx, - "sbz_demo", - "sbzDocApp", - "sbzDocService", - "0", - "sbzDocCode", - &armservicefabricmesh.CodePackageClientGetContainerLogsOptions{Tail: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_gateway_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_gateway_client_test.go deleted file mode 100644 index decd09be3325..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_gateway_client_test.go +++ /dev/null @@ -1,185 +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. - -package armservicefabricmesh_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/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/create_update.json -func ExampleGatewayClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewGatewayClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "sbz_demo", - "sampleGateway", - armservicefabricmesh.GatewayResourceDescription{ - Location: to.Ptr("EastUS"), - Tags: map[string]*string{}, - Properties: &armservicefabricmesh.GatewayResourceProperties{ - Description: to.Ptr("Service Fabric Mesh sample gateway."), - DestinationNetwork: &armservicefabricmesh.NetworkRef{ - Name: to.Ptr("helloWorldNetwork"), - }, - SourceNetwork: &armservicefabricmesh.NetworkRef{ - Name: to.Ptr("Open"), - }, - TCP: []*armservicefabricmesh.TCPConfig{ - { - Name: to.Ptr("web"), - Destination: &armservicefabricmesh.GatewayDestination{ - ApplicationName: to.Ptr("helloWorldApp"), - EndpointName: to.Ptr("helloWorldListener"), - ServiceName: to.Ptr("helloWorldService"), - }, - Port: to.Ptr[int32](80), - }}, - HTTP: []*armservicefabricmesh.HTTPConfig{ - { - Name: to.Ptr("contosoWebsite"), - Hosts: []*armservicefabricmesh.HTTPHostConfig{ - { - Name: to.Ptr("contoso.com"), - Routes: []*armservicefabricmesh.HTTPRouteConfig{ - { - Name: to.Ptr("index"), - Destination: &armservicefabricmesh.GatewayDestination{ - ApplicationName: to.Ptr("httpHelloWorldApp"), - EndpointName: to.Ptr("indexHttpEndpoint"), - ServiceName: to.Ptr("indexService"), - }, - Match: &armservicefabricmesh.HTTPRouteMatchRule{ - Path: &armservicefabricmesh.HTTPRouteMatchPath{ - Type: to.Ptr(armservicefabricmesh.PathMatchTypePrefix), - Rewrite: to.Ptr("/"), - Value: to.Ptr("/index"), - }, - Headers: []*armservicefabricmesh.HTTPRouteMatchHeader{ - { - Name: to.Ptr("accept"), - Type: to.Ptr(armservicefabricmesh.HeaderMatchTypeExact), - Value: to.Ptr("application/json"), - }}, - }, - }}, - }}, - Port: to.Ptr[int32](8081), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/get.json -func ExampleGatewayClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewGatewayClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "sampleGateway", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/delete.json -func ExampleGatewayClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewGatewayClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sbz_demo", - "sampleGateway", - 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/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/list_byResourceGroup.json -func ExampleGatewayClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewGatewayClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sbz_demo", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/gateways/list_bySubscriptionId.json -func ExampleGatewayClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewGatewayClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_network_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_network_client_test.go deleted file mode 100644 index 827c5716b6ec..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_network_client_test.go +++ /dev/null @@ -1,140 +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. - -package armservicefabricmesh_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/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/create_update.json -func ExampleNetworkClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewNetworkClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "sbz_demo", - "sampleNetwork", - armservicefabricmesh.NetworkResourceDescription{ - Location: to.Ptr("EastUS"), - Tags: map[string]*string{}, - Properties: &armservicefabricmesh.LocalNetworkResourceProperties{ - Kind: to.Ptr(armservicefabricmesh.NetworkKindLocal), - Description: to.Ptr("Service Fabric Mesh sample network."), - NetworkAddressPrefix: to.Ptr("2.0.0.0/16"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/get.json -func ExampleNetworkClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewNetworkClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "sampleNetwork", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/delete.json -func ExampleNetworkClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewNetworkClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sbz_demo", - "sampleNetwork", - 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/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/list_byResourceGroup.json -func ExampleNetworkClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewNetworkClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sbz_demo", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/networks/list_bySubscriptionId.json -func ExampleNetworkClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewNetworkClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secret_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secret_client_test.go deleted file mode 100644 index 2797fea3f6e5..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secret_client_test.go +++ /dev/null @@ -1,140 +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. - -package armservicefabricmesh_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/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/create_update.json -func ExampleSecretClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "sbz_demo", - "dbConnectionString", - armservicefabricmesh.SecretResourceDescription{ - Location: to.Ptr("EastUS"), - Tags: map[string]*string{}, - Properties: &armservicefabricmesh.InlinedValueSecretResourceProperties{ - Kind: to.Ptr(armservicefabricmesh.SecretKindInlinedValue), - Description: to.Ptr("Mongo DB connection string for backend database!"), - ContentType: to.Ptr("text/plain"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/get.json -func ExampleSecretClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "dbConnectionString", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/delete.json -func ExampleSecretClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sbz_demo", - "dbConnectionString", - 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/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/list_byResourceGroup.json -func ExampleSecretClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sbz_demo", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/list_bySubscriptionId.json -func ExampleSecretClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secretvalue_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secretvalue_client_test.go deleted file mode 100644 index 0d3ffc3d98c4..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_secretvalue_client_test.go +++ /dev/null @@ -1,140 +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. - -package armservicefabricmesh_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/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/create.json -func ExampleSecretValueClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretValueClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "sbz_demo", - "dbConnectionString", - "v1", - armservicefabricmesh.SecretValueResourceDescription{ - Name: to.Ptr("v1"), - Properties: &armservicefabricmesh.SecretValueResourceProperties{ - Value: to.Ptr("mongodb://contoso123:0Fc3IolnL12312asdfawejunASDF@asdfYXX2t8a97kghVcUzcDv98hawelufhawefafnoQRGwNj2nMPL1Y9qsIr9Srdw==@contoso123.documents.azure.com:10255/mydatabase?ssl=true"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/get.json -func ExampleSecretValueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretValueClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "dbConnectionString", - "v1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/delete.json -func ExampleSecretValueClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretValueClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sbz_demo", - "dbConnectionString", - "v1", - 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/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/list.json -func ExampleSecretValueClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretValueClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("sbz_demo", - "dbConnectionString", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/secrets/values/list_value.json -func ExampleSecretValueClient_ListValue() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewSecretValueClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListValue(ctx, - "sbz_demo", - "dbConnectionString", - "v1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_service_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_service_client_test.go deleted file mode 100644 index 48ad8a041630..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_service_client_test.go +++ /dev/null @@ -1,66 +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. - -package armservicefabricmesh_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/get.json -func ExampleServiceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "sampleApplication", - "helloWorldService", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/list.json -func ExampleServiceClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("sbz_demo", - "sampleApplication", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_servicereplica_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_servicereplica_client_test.go deleted file mode 100644 index 674c729c82c5..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_servicereplica_client_test.go +++ /dev/null @@ -1,68 +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. - -package armservicefabricmesh_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/get.json -func ExampleServiceReplicaClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewServiceReplicaClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "helloWorldApp", - "helloWorldService", - "0", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/applications/services/replicas/list.json -func ExampleServiceReplicaClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewServiceReplicaClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("sbz_demo", - "sampleApplication", - "helloWorldService", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_volume_client_test.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_volume_client_test.go deleted file mode 100644 index d6cb75606f6f..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/ze_generated_example_volume_client_test.go +++ /dev/null @@ -1,144 +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. - -package armservicefabricmesh_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/servicefabricmesh/armservicefabricmesh" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/create_update.json -func ExampleVolumeClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewVolumeClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "sbz_demo", - "sampleVolume", - armservicefabricmesh.VolumeResourceDescription{ - Location: to.Ptr("EastUS"), - Tags: map[string]*string{}, - Properties: &armservicefabricmesh.VolumeResourceProperties{ - Description: to.Ptr("Service Fabric Mesh sample volume."), - AzureFileParameters: &armservicefabricmesh.VolumeProviderParametersAzureFile{ - AccountKey: to.Ptr("provide-account-key-here"), - AccountName: to.Ptr("sbzdemoaccount"), - ShareName: to.Ptr("sharel"), - }, - Provider: to.Ptr(armservicefabricmesh.VolumeProviderSFAzureFile), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/get.json -func ExampleVolumeClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewVolumeClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sbz_demo", - "sampleVolume", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/delete.json -func ExampleVolumeClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewVolumeClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sbz_demo", - "sampleVolume", - 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/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/list_byResourceGroup.json -func ExampleVolumeClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewVolumeClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sbz_demo", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh/preview/2018-09-01-preview/examples/volumes/list_bySubscriptionId.json -func ExampleVolumeClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabricmesh.NewVolumeClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_models_serde.go b/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_models_serde.go deleted file mode 100644 index d7b6567473e6..000000000000 --- a/sdk/resourcemanager/servicefabricmesh/armservicefabricmesh/zz_generated_models_serde.go +++ /dev/null @@ -1,912 +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. - -package armservicefabricmesh - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AddRemoveReplicaScalingMechanism. -func (a AddRemoveReplicaScalingMechanism) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = AutoScalingMechanismKindAddRemoveReplica - populate(objectMap, "maxCount", a.MaxCount) - populate(objectMap, "minCount", a.MinCount) - populate(objectMap, "scaleIncrement", a.ScaleIncrement) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AddRemoveReplicaScalingMechanism. -func (a *AddRemoveReplicaScalingMechanism) UnmarshalJSON(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 "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "maxCount": - err = unpopulate(val, "MaxCount", &a.MaxCount) - delete(rawMsg, key) - case "minCount": - err = unpopulate(val, "MinCount", &a.MinCount) - delete(rawMsg, key) - case "scaleIncrement": - err = unpopulate(val, "ScaleIncrement", &a.ScaleIncrement) - 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 ApplicationProperties. -func (a ApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "debugParams", a.DebugParams) - populate(objectMap, "description", a.Description) - populate(objectMap, "diagnostics", a.Diagnostics) - populate(objectMap, "healthState", a.HealthState) - populate(objectMap, "serviceNames", a.ServiceNames) - populate(objectMap, "services", a.Services) - populate(objectMap, "status", a.Status) - populate(objectMap, "statusDetails", a.StatusDetails) - populate(objectMap, "unhealthyEvaluation", a.UnhealthyEvaluation) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceDescription. -func (a ApplicationResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceProperties. -func (a ApplicationResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "debugParams", a.DebugParams) - populate(objectMap, "description", a.Description) - populate(objectMap, "diagnostics", a.Diagnostics) - populate(objectMap, "healthState", a.HealthState) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "serviceNames", a.ServiceNames) - populate(objectMap, "services", a.Services) - populate(objectMap, "status", a.Status) - populate(objectMap, "statusDetails", a.StatusDetails) - populate(objectMap, "unhealthyEvaluation", a.UnhealthyEvaluation) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationScopedVolume. -func (a ApplicationScopedVolume) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "creationParameters", a.CreationParameters) - populate(objectMap, "destinationPath", a.DestinationPath) - populate(objectMap, "name", a.Name) - populate(objectMap, "readOnly", a.ReadOnly) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationScopedVolume. -func (a *ApplicationScopedVolume) UnmarshalJSON(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 "creationParameters": - a.CreationParameters, err = unmarshalApplicationScopedVolumeCreationParametersClassification(val) - delete(rawMsg, key) - case "destinationPath": - err = unpopulate(val, "DestinationPath", &a.DestinationPath) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "readOnly": - err = unpopulate(val, "ReadOnly", &a.ReadOnly) - 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 ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. -func (a ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", a.Description) - objectMap["kind"] = ApplicationScopedVolumeKindServiceFabricVolumeDisk - populate(objectMap, "sizeDisk", a.SizeDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. -func (a *ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "sizeDisk": - err = unpopulate(val, "SizeDisk", &a.SizeDisk) - 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 AutoScalingPolicy. -func (a AutoScalingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "mechanism", a.Mechanism) - populate(objectMap, "name", a.Name) - populate(objectMap, "trigger", a.Trigger) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScalingPolicy. -func (a *AutoScalingPolicy) UnmarshalJSON(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 "mechanism": - a.Mechanism, err = unmarshalAutoScalingMechanismClassification(val) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "trigger": - a.Trigger, err = unmarshalAutoScalingTriggerClassification(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutoScalingResourceMetric. -func (a AutoScalingResourceMetric) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = AutoScalingMetricKindResource - populate(objectMap, "name", a.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScalingResourceMetric. -func (a *AutoScalingResourceMetric) UnmarshalJSON(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 "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - 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 AverageLoadScalingTrigger. -func (a AverageLoadScalingTrigger) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = AutoScalingTriggerKindAverageLoad - populate(objectMap, "lowerLoadThreshold", a.LowerLoadThreshold) - populate(objectMap, "metric", a.Metric) - populate(objectMap, "scaleIntervalInSeconds", a.ScaleIntervalInSeconds) - populate(objectMap, "upperLoadThreshold", a.UpperLoadThreshold) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AverageLoadScalingTrigger. -func (a *AverageLoadScalingTrigger) UnmarshalJSON(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 "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "lowerLoadThreshold": - err = unpopulate(val, "LowerLoadThreshold", &a.LowerLoadThreshold) - delete(rawMsg, key) - case "metric": - a.Metric, err = unmarshalAutoScalingMetricClassification(val) - delete(rawMsg, key) - case "scaleIntervalInSeconds": - err = unpopulate(val, "ScaleIntervalInSeconds", &a.ScaleIntervalInSeconds) - delete(rawMsg, key) - case "upperLoadThreshold": - err = unpopulate(val, "UpperLoadThreshold", &a.UpperLoadThreshold) - 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 AzureInternalMonitoringPipelineSinkDescription. -func (a AzureInternalMonitoringPipelineSinkDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountName", a.AccountName) - populate(objectMap, "autoKeyConfigUrl", a.AutoKeyConfigURL) - populate(objectMap, "description", a.Description) - populate(objectMap, "fluentdConfigUrl", &a.FluentdConfigURL) - objectMap["kind"] = DiagnosticsSinkKindAzureInternalMonitoringPipeline - populate(objectMap, "maConfigUrl", a.MaConfigURL) - populate(objectMap, "name", a.Name) - populate(objectMap, "namespace", a.Namespace) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureInternalMonitoringPipelineSinkDescription. -func (a *AzureInternalMonitoringPipelineSinkDescription) UnmarshalJSON(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 "accountName": - err = unpopulate(val, "AccountName", &a.AccountName) - delete(rawMsg, key) - case "autoKeyConfigUrl": - err = unpopulate(val, "AutoKeyConfigURL", &a.AutoKeyConfigURL) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "fluentdConfigUrl": - err = unpopulate(val, "FluentdConfigURL", &a.FluentdConfigURL) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "maConfigUrl": - err = unpopulate(val, "MaConfigURL", &a.MaConfigURL) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &a.Namespace) - 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 ContainerCodePackageProperties. -func (c ContainerCodePackageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "commands", c.Commands) - populate(objectMap, "diagnostics", c.Diagnostics) - populate(objectMap, "endpoints", c.Endpoints) - populate(objectMap, "entrypoint", c.Entrypoint) - populate(objectMap, "environmentVariables", c.EnvironmentVariables) - populate(objectMap, "image", c.Image) - populate(objectMap, "imageRegistryCredential", c.ImageRegistryCredential) - populate(objectMap, "instanceView", c.InstanceView) - populate(objectMap, "labels", c.Labels) - populate(objectMap, "name", c.Name) - populate(objectMap, "reliableCollectionsRefs", c.ReliableCollectionsRefs) - populate(objectMap, "resources", c.Resources) - populate(objectMap, "settings", c.Settings) - populate(objectMap, "volumeRefs", c.VolumeRefs) - populate(objectMap, "volumes", c.Volumes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerInstanceView. -func (c ContainerInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentState", c.CurrentState) - populate(objectMap, "events", c.Events) - populate(objectMap, "previousState", c.PreviousState) - populate(objectMap, "restartCount", c.RestartCount) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerState. -func (c ContainerState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "detailStatus", c.DetailStatus) - populate(objectMap, "exitCode", c.ExitCode) - populateTimeRFC3339(objectMap, "finishTime", c.FinishTime) - populateTimeRFC3339(objectMap, "startTime", c.StartTime) - populate(objectMap, "state", c.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerState. -func (c *ContainerState) UnmarshalJSON(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 "detailStatus": - err = unpopulate(val, "DetailStatus", &c.DetailStatus) - delete(rawMsg, key) - case "exitCode": - err = unpopulate(val, "ExitCode", &c.ExitCode) - delete(rawMsg, key) - case "finishTime": - err = unpopulateTimeRFC3339(val, "FinishTime", &c.FinishTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - 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 DiagnosticsDescription. -func (d DiagnosticsDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultSinkRefs", d.DefaultSinkRefs) - populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "sinks", d.Sinks) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsDescription. -func (d *DiagnosticsDescription) UnmarshalJSON(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 "defaultSinkRefs": - err = unpopulate(val, "DefaultSinkRefs", &d.DefaultSinkRefs) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) - delete(rawMsg, key) - case "sinks": - d.Sinks, err = unmarshalDiagnosticsSinkPropertiesClassificationArray(val) - 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 DiagnosticsRef. -func (d DiagnosticsRef) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "sinkRefs", d.SinkRefs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayProperties. -func (g GatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", g.Description) - populate(objectMap, "destinationNetwork", g.DestinationNetwork) - populate(objectMap, "http", g.HTTP) - populate(objectMap, "ipAddress", g.IPAddress) - populate(objectMap, "sourceNetwork", g.SourceNetwork) - populate(objectMap, "status", g.Status) - populate(objectMap, "statusDetails", g.StatusDetails) - populate(objectMap, "tcp", g.TCP) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayResourceDescription. -func (g GatewayResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayResourceProperties. -func (g GatewayResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", g.Description) - populate(objectMap, "destinationNetwork", g.DestinationNetwork) - populate(objectMap, "http", g.HTTP) - populate(objectMap, "ipAddress", g.IPAddress) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "sourceNetwork", g.SourceNetwork) - populate(objectMap, "status", g.Status) - populate(objectMap, "statusDetails", g.StatusDetails) - populate(objectMap, "tcp", g.TCP) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPConfig. -func (h HTTPConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hosts", h.Hosts) - populate(objectMap, "name", h.Name) - populate(objectMap, "port", h.Port) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPHostConfig. -func (h HTTPHostConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", h.Name) - populate(objectMap, "routes", h.Routes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPRouteMatchRule. -func (h HTTPRouteMatchRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "headers", h.Headers) - populate(objectMap, "path", h.Path) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InlinedValueSecretResourceProperties. -func (i InlinedValueSecretResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentType", i.ContentType) - populate(objectMap, "description", i.Description) - objectMap["kind"] = SecretKindInlinedValue - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "status", i.Status) - populate(objectMap, "statusDetails", i.StatusDetails) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InlinedValueSecretResourceProperties. -func (i *InlinedValueSecretResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "contentType": - err = unpopulate(val, "ContentType", &i.ContentType) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &i.Description) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &i.Status) - delete(rawMsg, key) - case "statusDetails": - err = unpopulate(val, "StatusDetails", &i.StatusDetails) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LocalNetworkResourceProperties. -func (l LocalNetworkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", l.Description) - objectMap["kind"] = NetworkKindLocal - populate(objectMap, "networkAddressPrefix", l.NetworkAddressPrefix) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "status", l.Status) - populate(objectMap, "statusDetails", l.StatusDetails) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LocalNetworkResourceProperties. -func (l *LocalNetworkResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &l.Description) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &l.Kind) - delete(rawMsg, key) - case "networkAddressPrefix": - err = unpopulate(val, "NetworkAddressPrefix", &l.NetworkAddressPrefix) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) - delete(rawMsg, key) - case "statusDetails": - err = unpopulate(val, "StatusDetails", &l.StatusDetails) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkRef. -func (n NetworkRef) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "endpointRefs", n.EndpointRefs) - populate(objectMap, "name", n.Name) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkResourceDescription. -func (n NetworkResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkResourceDescription. -func (n *NetworkResourceDescription) UnmarshalJSON(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": - n.Properties, err = unmarshalNetworkResourcePropertiesClassification(val) - 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 NetworkResourceProperties. -func (n NetworkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", n.Description) - objectMap["kind"] = "NetworkResourceProperties" - populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "status", n.Status) - populate(objectMap, "statusDetails", n.StatusDetails) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkResourceProperties. -func (n *NetworkResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &n.Description) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &n.Kind) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &n.Status) - delete(rawMsg, key) - case "statusDetails": - err = unpopulate(val, "StatusDetails", &n.StatusDetails) - 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 SecretResourceDescription. -func (s SecretResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretResourceDescription. -func (s *SecretResourceDescription) UnmarshalJSON(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": - s.Properties, err = unmarshalSecretResourcePropertiesClassification(val) - 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 SecretResourceProperties. -func (s SecretResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentType", s.ContentType) - populate(objectMap, "description", s.Description) - objectMap["kind"] = "SecretResourceProperties" - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "status", s.Status) - populate(objectMap, "statusDetails", s.StatusDetails) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretResourceProperties. -func (s *SecretResourceProperties) UnmarshalJSON(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 "contentType": - err = unpopulate(val, "ContentType", &s.ContentType) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &s.Kind) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "statusDetails": - err = unpopulate(val, "StatusDetails", &s.StatusDetails) - 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 SecretValueResourceDescription. -func (s SecretValueResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceProperties. -func (s ServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoScalingPolicies", s.AutoScalingPolicies) - populate(objectMap, "description", s.Description) - populate(objectMap, "healthState", s.HealthState) - populate(objectMap, "replicaCount", s.ReplicaCount) - populate(objectMap, "status", s.Status) - populate(objectMap, "statusDetails", s.StatusDetails) - populate(objectMap, "unhealthyEvaluation", s.UnhealthyEvaluation) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceReplicaDescription. -func (s ServiceReplicaDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "codePackages", s.CodePackages) - populate(objectMap, "diagnostics", s.Diagnostics) - populate(objectMap, "networkRefs", s.NetworkRefs) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "replicaName", s.ReplicaName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceReplicaProperties. -func (s ServiceReplicaProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "codePackages", s.CodePackages) - populate(objectMap, "diagnostics", s.Diagnostics) - populate(objectMap, "networkRefs", s.NetworkRefs) - populate(objectMap, "osType", s.OSType) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceResourceProperties. -func (s ServiceResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoScalingPolicies", s.AutoScalingPolicies) - populate(objectMap, "codePackages", s.CodePackages) - populate(objectMap, "description", s.Description) - populate(objectMap, "diagnostics", s.Diagnostics) - populate(objectMap, "healthState", s.HealthState) - populate(objectMap, "networkRefs", s.NetworkRefs) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "replicaCount", s.ReplicaCount) - populate(objectMap, "status", s.Status) - populate(objectMap, "statusDetails", s.StatusDetails) - populate(objectMap, "unhealthyEvaluation", s.UnhealthyEvaluation) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VolumeResourceDescription. -func (v VolumeResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - 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 interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}