diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md b/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md index 88bd18f198df..006f81d85126 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md +++ b/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2023-03-13) +### Other Changes + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applications_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/applications_client.go similarity index 90% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applications_client.go rename to sdk/resourcemanager/servicefabric/armservicefabric/applications_client.go index 00eee424cf77..5d8f419b9cd5 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applications_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/applications_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 armservicefabric @@ -31,9 +32,9 @@ type ApplicationsClient struct { } // NewApplicationsClient creates a new instance of ApplicationsClient 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 NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or update a Service Fabric application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// parameters - The application resource. -// options - ApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - parameters - The application resource. +// - options - ApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdate +// method. func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource, options *ApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, applicationName, parameters, options) @@ -77,6 +79,7 @@ func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or update a Service Fabric application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource, options *ApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, parameters, options) @@ -125,12 +128,13 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete a Service Fabric application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// options - ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - options - ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete +// method. func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*runtime.Poller[ApplicationsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, applicationName, options) @@ -145,6 +149,7 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete a Service Fabric application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) @@ -194,11 +199,12 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster // resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// options - ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - options - ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. func (client *ApplicationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientGetOptions) (ApplicationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) if err != nil { @@ -255,10 +261,11 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // List - Gets all application resources created or in the process of being created in the Service Fabric cluster resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. func (client *ApplicationsClient) List(ctx context.Context, resourceGroupName string, clusterName string, options *ApplicationsClientListOptions) (ApplicationsClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -311,13 +318,14 @@ func (client *ApplicationsClient) listHandleResponse(resp *http.Response) (Appli // BeginUpdate - Update a Service Fabric application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// parameters - The application resource for patch operations. -// options - ApplicationsClientBeginUpdateOptions contains the optional parameters for the ApplicationsClient.BeginUpdate -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - parameters - The application resource for patch operations. +// - options - ApplicationsClientBeginUpdateOptions contains the optional parameters for the ApplicationsClient.BeginUpdate +// method. func (client *ApplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResourceUpdate, options *ApplicationsClientBeginUpdateOptions) (*runtime.Poller[ApplicationsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, applicationName, parameters, options) @@ -332,6 +340,7 @@ func (client *ApplicationsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Update a Service Fabric application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ApplicationsClient) update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResourceUpdate, options *ApplicationsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, parameters, options) diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applicationtypes_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client.go similarity index 89% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applicationtypes_client.go rename to sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client.go index a110ab0dbdf8..c77c5bc25c65 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applicationtypes_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_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 armservicefabric @@ -31,9 +32,9 @@ type ApplicationTypesClient struct { } // NewApplicationTypesClient creates a new instance of ApplicationTypesClient 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 NewApplicationTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationTypesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewApplicationTypesClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Create or update a Service Fabric application type name resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationTypeName - The name of the application type name resource. -// parameters - The application type name resource. -// options - ApplicationTypesClientCreateOrUpdateOptions contains the optional parameters for the ApplicationTypesClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationTypeName - The name of the application type name resource. +// - parameters - The application type name resource. +// - options - ApplicationTypesClientCreateOrUpdateOptions contains the optional parameters for the ApplicationTypesClient.CreateOrUpdate +// method. func (client *ApplicationTypesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource, options *ApplicationTypesClientCreateOrUpdateOptions) (ApplicationTypesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, parameters, options) if err != nil { @@ -119,12 +121,13 @@ func (client *ApplicationTypesClient) createOrUpdateHandleResponse(resp *http.Re // BeginDelete - Delete a Service Fabric application type name resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationTypeName - The name of the application type name resource. -// options - ApplicationTypesClientBeginDeleteOptions contains the optional parameters for the ApplicationTypesClient.BeginDelete -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationTypeName - The name of the application type name resource. +// - options - ApplicationTypesClientBeginDeleteOptions contains the optional parameters for the ApplicationTypesClient.BeginDelete +// method. func (client *ApplicationTypesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientBeginDeleteOptions) (*runtime.Poller[ApplicationTypesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, applicationTypeName, options) @@ -139,6 +142,7 @@ func (client *ApplicationTypesClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete a Service Fabric application type name resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ApplicationTypesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, options) @@ -188,11 +192,12 @@ func (client *ApplicationTypesClient) deleteCreateRequest(ctx context.Context, r // Get - Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric // cluster resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationTypeName - The name of the application type name resource. -// options - ApplicationTypesClientGetOptions contains the optional parameters for the ApplicationTypesClient.Get method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationTypeName - The name of the application type name resource. +// - options - ApplicationTypesClientGetOptions contains the optional parameters for the ApplicationTypesClient.Get method. func (client *ApplicationTypesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientGetOptions) (ApplicationTypesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, options) if err != nil { @@ -250,10 +255,11 @@ func (client *ApplicationTypesClient) getHandleResponse(resp *http.Response) (Ap // List - Gets all application type name resources created or in the process of being created in the Service Fabric cluster // resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// options - ApplicationTypesClientListOptions contains the optional parameters for the ApplicationTypesClient.List method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - options - ApplicationTypesClientListOptions contains the optional parameters for the ApplicationTypesClient.List method. func (client *ApplicationTypesClient) List(ctx context.Context, resourceGroupName string, clusterName string, options *ApplicationTypesClientListOptions) (ApplicationTypesClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applicationtypeversions_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client.go similarity index 89% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applicationtypeversions_client.go rename to sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client.go index 65bbe3defaa5..aaed2ae86e71 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_applicationtypeversions_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_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 armservicefabric @@ -31,9 +32,9 @@ type ApplicationTypeVersionsClient struct { } // NewApplicationTypeVersionsClient creates a new instance of ApplicationTypeVersionsClient 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 NewApplicationTypeVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationTypeVersionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewApplicationTypeVersionsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Create or update a Service Fabric application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationTypeName - The name of the application type name resource. -// version - The application type version. -// parameters - The application type version resource. -// options - ApplicationTypeVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginCreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationTypeName - The name of the application type name resource. +// - version - The application type version. +// - parameters - The application type version resource. +// - options - ApplicationTypeVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginCreateOrUpdate +// method. func (client *ApplicationTypeVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource, options *ApplicationTypeVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationTypeVersionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, applicationTypeName, version, parameters, options) @@ -78,6 +80,7 @@ func (client *ApplicationTypeVersionsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create or update a Service Fabric application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ApplicationTypeVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource, options *ApplicationTypeVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, version, parameters, options) @@ -130,13 +133,14 @@ func (client *ApplicationTypeVersionsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete a Service Fabric application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationTypeName - The name of the application type name resource. -// version - The application type version. -// options - ApplicationTypeVersionsClientBeginDeleteOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginDelete -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationTypeName - The name of the application type name resource. +// - version - The application type version. +// - options - ApplicationTypeVersionsClientBeginDeleteOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginDelete +// method. func (client *ApplicationTypeVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientBeginDeleteOptions) (*runtime.Poller[ApplicationTypeVersionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, applicationTypeName, version, options) @@ -151,6 +155,7 @@ func (client *ApplicationTypeVersionsClient) BeginDelete(ctx context.Context, re // Delete - Delete a Service Fabric application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ApplicationTypeVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, version, options) @@ -204,13 +209,14 @@ func (client *ApplicationTypeVersionsClient) deleteCreateRequest(ctx context.Con // Get - Get a Service Fabric application type version resource created or in the process of being created in the Service // Fabric application type name resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationTypeName - The name of the application type name resource. -// version - The application type version. -// options - ApplicationTypeVersionsClientGetOptions contains the optional parameters for the ApplicationTypeVersionsClient.Get -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationTypeName - The name of the application type name resource. +// - version - The application type version. +// - options - ApplicationTypeVersionsClientGetOptions contains the optional parameters for the ApplicationTypeVersionsClient.Get +// method. func (client *ApplicationTypeVersionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientGetOptions) (ApplicationTypeVersionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, version, options) if err != nil { @@ -272,12 +278,13 @@ func (client *ApplicationTypeVersionsClient) getHandleResponse(resp *http.Respon // List - Gets all application type version resources created or in the process of being created in the Service Fabric application // type name resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationTypeName - The name of the application type name resource. -// options - ApplicationTypeVersionsClientListOptions contains the optional parameters for the ApplicationTypeVersionsClient.List -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationTypeName - The name of the application type name resource. +// - options - ApplicationTypeVersionsClientListOptions contains the optional parameters for the ApplicationTypeVersionsClient.List +// method. func (client *ApplicationTypeVersionsClient) List(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypeVersionsClientListOptions) (ApplicationTypeVersionsClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, options) if err != nil { diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md b/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md index 3cea43117cc2..60fff8805519 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md +++ b/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicefabric/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicefabric/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_clusters_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client.go similarity index 90% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_clusters_client.go rename to sdk/resourcemanager/servicefabric/armservicefabric/clusters_client.go index 43a60017aaeb..8ef86d208227 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_clusters_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/clusters_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 armservicefabric @@ -31,9 +32,9 @@ type ClustersClient struct { } // NewClustersClient creates a new instance of ClustersClient 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 NewClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClustersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a Service Fabric cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// parameters - The cluster resource. -// options - ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - parameters - The cluster resource. +// - options - ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate +// method. func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClustersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, parameters, options) @@ -76,6 +78,7 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a Service Fabric cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) @@ -120,10 +123,11 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // Delete - Delete a Service Fabric cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// options - ClustersClientDeleteOptions contains the optional parameters for the ClustersClient.Delete method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - options - ClustersClientDeleteOptions contains the optional parameters for the ClustersClient.Delete method. func (client *ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientDeleteOptions) (ClustersClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -167,10 +171,11 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -223,8 +228,9 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // List - Gets all Service Fabric cluster resources created or in the process of being created in the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// options - ClustersClientListOptions contains the optional parameters for the ClustersClient.List method. +// - options - ClustersClientListOptions contains the optional parameters for the ClustersClient.List method. func (client *ClustersClient) List(ctx context.Context, options *ClustersClientListOptions) (ClustersClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) if err != nil { @@ -270,10 +276,11 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC // ListByResourceGroup - Gets all Service Fabric cluster resources created or in the process of being created in the resource // group. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group. +// - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup +// method. func (client *ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (ClustersClientListByResourceGroupResponse, error) { req, err := client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) if err != nil { @@ -324,11 +331,12 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // cluster version. If a target is given, it will provide the required path to get from the current // cluster version to the target version. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// options - ClustersClientListUpgradableVersionsOptions contains the optional parameters for the ClustersClient.ListUpgradableVersions -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - options - ClustersClientListUpgradableVersionsOptions contains the optional parameters for the ClustersClient.ListUpgradableVersions +// method. func (client *ClustersClient) ListUpgradableVersions(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientListUpgradableVersionsOptions) (ClustersClientListUpgradableVersionsResponse, error) { req, err := client.listUpgradableVersionsCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -384,11 +392,12 @@ func (client *ClustersClient) listUpgradableVersionsHandleResponse(resp *http.Re // BeginUpdate - Update the configuration of a Service Fabric cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// parameters - The parameters which contains the property value and property name which used to update the cluster configuration. -// options - ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - parameters - The parameters which contains the property value and property name which used to update the cluster configuration. +// - options - ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdateParameters, options *ClustersClientBeginUpdateOptions) (*runtime.Poller[ClustersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, parameters, options) @@ -403,6 +412,7 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update the configuration of a Service Fabric cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdateParameters, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_clusterversions_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client.go similarity index 89% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_clusterversions_client.go rename to sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client.go index e111bdf72558..1cd30bc102a6 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_clusterversions_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_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 armservicefabric @@ -31,9 +32,9 @@ type ClusterVersionsClient struct { } // NewClusterVersionsClient creates a new instance of ClusterVersionsClient 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 NewClusterVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterVersionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewClusterVersionsClient(subscriptionID string, credential azcore.TokenCred // Get - Gets information about an available Service Fabric cluster code version. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// location - The location for the cluster code versions. This is different from cluster location. -// clusterVersion - The cluster code version. -// options - ClusterVersionsClientGetOptions contains the optional parameters for the ClusterVersionsClient.Get method. +// - location - The location for the cluster code versions. This is different from cluster location. +// - clusterVersion - The cluster code version. +// - options - ClusterVersionsClientGetOptions contains the optional parameters for the ClusterVersionsClient.Get method. func (client *ClusterVersionsClient) Get(ctx context.Context, location string, clusterVersion string, options *ClusterVersionsClientGetOptions) (ClusterVersionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, location, clusterVersion, options) if err != nil { @@ -112,12 +114,13 @@ func (client *ClusterVersionsClient) getHandleResponse(resp *http.Response) (Clu // GetByEnvironment - Gets information about an available Service Fabric cluster code version by environment. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// location - The location for the cluster code versions. This is different from cluster location. -// environment - The operating system of the cluster. The default means all. -// clusterVersion - The cluster code version. -// options - ClusterVersionsClientGetByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.GetByEnvironment -// method. +// - location - The location for the cluster code versions. This is different from cluster location. +// - environment - The operating system of the cluster. The default means all. +// - clusterVersion - The cluster code version. +// - options - ClusterVersionsClientGetByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.GetByEnvironment +// method. func (client *ClusterVersionsClient) GetByEnvironment(ctx context.Context, location string, environment ClusterVersionsEnvironment, clusterVersion string, options *ClusterVersionsClientGetByEnvironmentOptions) (ClusterVersionsClientGetByEnvironmentResponse, error) { req, err := client.getByEnvironmentCreateRequest(ctx, location, environment, clusterVersion, options) if err != nil { @@ -174,9 +177,10 @@ func (client *ClusterVersionsClient) getByEnvironmentHandleResponse(resp *http.R // List - Gets all available code versions for Service Fabric cluster resources by location. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// location - The location for the cluster code versions. This is different from cluster location. -// options - ClusterVersionsClientListOptions contains the optional parameters for the ClusterVersionsClient.List method. +// - location - The location for the cluster code versions. This is different from cluster location. +// - options - ClusterVersionsClientListOptions contains the optional parameters for the ClusterVersionsClient.List method. func (client *ClusterVersionsClient) List(ctx context.Context, location string, options *ClusterVersionsClientListOptions) (ClusterVersionsClientListResponse, error) { req, err := client.listCreateRequest(ctx, location, options) if err != nil { @@ -225,11 +229,12 @@ func (client *ClusterVersionsClient) listHandleResponse(resp *http.Response) (Cl // ListByEnvironment - Gets all available code versions for Service Fabric cluster resources by environment. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// location - The location for the cluster code versions. This is different from cluster location. -// environment - The operating system of the cluster. The default means all. -// options - ClusterVersionsClientListByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.ListByEnvironment -// method. +// - location - The location for the cluster code versions. This is different from cluster location. +// - environment - The operating system of the cluster. The default means all. +// - options - ClusterVersionsClientListByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.ListByEnvironment +// method. func (client *ClusterVersionsClient) ListByEnvironment(ctx context.Context, location string, environment ClusterVersionsEnvironment, options *ClusterVersionsClientListByEnvironmentOptions) (ClusterVersionsClientListByEnvironmentResponse, error) { req, err := client.listByEnvironmentCreateRequest(ctx, location, environment, options) if err != nil { diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_constants.go b/sdk/resourcemanager/servicefabric/armservicefabric/constants.go similarity index 99% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_constants.go rename to sdk/resourcemanager/servicefabric/armservicefabric/constants.go index edaf420192cd..08bead9cb369 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_constants.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/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 armservicefabric const ( moduleName = "armservicefabric" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // AddOnFeatures - Available cluster add-on features diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/go.mod b/sdk/resourcemanager/servicefabric/armservicefabric/go.mod index f1684bb84585..6519a4b69e42 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/go.mod +++ b/sdk/resourcemanager/servicefabric/armservicefabric/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armse 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/servicefabric/armservicefabric/go.sum b/sdk/resourcemanager/servicefabric/armservicefabric/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/go.sum +++ b/sdk/resourcemanager/servicefabric/armservicefabric/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/servicefabric/armservicefabric/zz_generated_models.go b/sdk/resourcemanager/servicefabric/armservicefabric/models.go similarity index 99% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_models.go rename to sdk/resourcemanager/servicefabric/armservicefabric/models.go index 5bb84b303dc4..79d0e77a6da5 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_models.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/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 armservicefabric @@ -641,7 +642,8 @@ type ClusterProperties struct { // The Service Fabric runtime version of the cluster. This property can only by set the user when upgradeMode is set to 'Manual'. // To get list of available Service Fabric versions for new clusters use - // ClusterVersion API [./ClusterVersion.md]. To get the list of available version for existing clusters use availableClusterVersions. + // ClusterVersion API [https://learn.microsoft.com/rest/api/servicefabric/cluster-versions/list]. To get the list of available + // version for existing clusters use availableClusterVersions. ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` // The storage account information for storing Service Fabric diagnostic logs. @@ -763,7 +765,8 @@ type ClusterPropertiesUpdateParameters struct { // The Service Fabric runtime version of the cluster. This property can only by set the user when upgradeMode is set to 'Manual'. // To get list of available Service Fabric versions for new clusters use - // ClusterVersion API [./ClusterVersion.md]. To get the list of available version for existing clusters use availableClusterVersions. + // ClusterVersion API [https://learn.microsoft.com/rest/api/servicefabric/cluster-versions/list]. To get the list of available + // version for existing clusters use availableClusterVersions. ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` // Indicates if the event store service is enabled. @@ -1154,7 +1157,7 @@ type OperationResult struct { Origin *string `json:"origin,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 } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/models_serde.go b/sdk/resourcemanager/servicefabric/armservicefabric/models_serde.go new file mode 100644 index 000000000000..5d6102dede63 --- /dev/null +++ b/sdk/resourcemanager/servicefabric/armservicefabric/models_serde.go @@ -0,0 +1,3274 @@ +//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 armservicefabric + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type ApplicationDeltaHealthPolicy. +func (a ApplicationDeltaHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultServiceTypeDeltaHealthPolicy", a.DefaultServiceTypeDeltaHealthPolicy) + populate(objectMap, "serviceTypeDeltaHealthPolicies", a.ServiceTypeDeltaHealthPolicies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationDeltaHealthPolicy. +func (a *ApplicationDeltaHealthPolicy) 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 "defaultServiceTypeDeltaHealthPolicy": + err = unpopulate(val, "DefaultServiceTypeDeltaHealthPolicy", &a.DefaultServiceTypeDeltaHealthPolicy) + delete(rawMsg, key) + case "serviceTypeDeltaHealthPolicies": + err = unpopulate(val, "ServiceTypeDeltaHealthPolicies", &a.ServiceTypeDeltaHealthPolicies) + 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 ApplicationHealthPolicy. +func (a ApplicationHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultServiceTypeHealthPolicy", a.DefaultServiceTypeHealthPolicy) + populate(objectMap, "serviceTypeHealthPolicies", a.ServiceTypeHealthPolicies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationHealthPolicy. +func (a *ApplicationHealthPolicy) 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 "defaultServiceTypeHealthPolicy": + err = unpopulate(val, "DefaultServiceTypeHealthPolicy", &a.DefaultServiceTypeHealthPolicy) + delete(rawMsg, key) + case "serviceTypeHealthPolicies": + err = unpopulate(val, "ServiceTypeHealthPolicies", &a.ServiceTypeHealthPolicies) + 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 ApplicationMetricDescription. +func (a ApplicationMetricDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maximumCapacity", a.MaximumCapacity) + populate(objectMap, "name", a.Name) + populate(objectMap, "reservationCapacity", a.ReservationCapacity) + populate(objectMap, "totalApplicationCapacity", a.TotalApplicationCapacity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationMetricDescription. +func (a *ApplicationMetricDescription) 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 "maximumCapacity": + err = unpopulate(val, "MaximumCapacity", &a.MaximumCapacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "reservationCapacity": + err = unpopulate(val, "ReservationCapacity", &a.ReservationCapacity) + delete(rawMsg, key) + case "totalApplicationCapacity": + err = unpopulate(val, "TotalApplicationCapacity", &a.TotalApplicationCapacity) + 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 ApplicationResource. +func (a ApplicationResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResource. +func (a *ApplicationResource) 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 "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + 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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 ApplicationResourceList. +func (a ApplicationResourceList) 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 ApplicationResourceList. +func (a *ApplicationResourceList) 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, "managedIdentities", a.ManagedIdentities) + populate(objectMap, "maximumNodes", a.MaximumNodes) + populate(objectMap, "metrics", a.Metrics) + populate(objectMap, "minimumNodes", a.MinimumNodes) + populate(objectMap, "parameters", a.Parameters) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "removeApplicationCapacity", a.RemoveApplicationCapacity) + populate(objectMap, "typeName", a.TypeName) + populate(objectMap, "typeVersion", a.TypeVersion) + populate(objectMap, "upgradePolicy", a.UpgradePolicy) + 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 "managedIdentities": + err = unpopulate(val, "ManagedIdentities", &a.ManagedIdentities) + delete(rawMsg, key) + case "maximumNodes": + err = unpopulate(val, "MaximumNodes", &a.MaximumNodes) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &a.Metrics) + delete(rawMsg, key) + case "minimumNodes": + err = unpopulate(val, "MinimumNodes", &a.MinimumNodes) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "removeApplicationCapacity": + err = unpopulate(val, "RemoveApplicationCapacity", &a.RemoveApplicationCapacity) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &a.TypeName) + delete(rawMsg, key) + case "typeVersion": + err = unpopulate(val, "TypeVersion", &a.TypeVersion) + delete(rawMsg, key) + case "upgradePolicy": + err = unpopulate(val, "UpgradePolicy", &a.UpgradePolicy) + 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 ApplicationResourceUpdate. +func (a ApplicationResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceUpdate. +func (a *ApplicationResourceUpdate) 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 "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, 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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 ApplicationResourceUpdateProperties. +func (a ApplicationResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "managedIdentities", a.ManagedIdentities) + populate(objectMap, "maximumNodes", a.MaximumNodes) + populate(objectMap, "metrics", a.Metrics) + populate(objectMap, "minimumNodes", a.MinimumNodes) + populate(objectMap, "parameters", a.Parameters) + populate(objectMap, "removeApplicationCapacity", a.RemoveApplicationCapacity) + populate(objectMap, "typeVersion", a.TypeVersion) + populate(objectMap, "upgradePolicy", a.UpgradePolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceUpdateProperties. +func (a *ApplicationResourceUpdateProperties) 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 "managedIdentities": + err = unpopulate(val, "ManagedIdentities", &a.ManagedIdentities) + delete(rawMsg, key) + case "maximumNodes": + err = unpopulate(val, "MaximumNodes", &a.MaximumNodes) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &a.Metrics) + delete(rawMsg, key) + case "minimumNodes": + err = unpopulate(val, "MinimumNodes", &a.MinimumNodes) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) + delete(rawMsg, key) + case "removeApplicationCapacity": + err = unpopulate(val, "RemoveApplicationCapacity", &a.RemoveApplicationCapacity) + delete(rawMsg, key) + case "typeVersion": + err = unpopulate(val, "TypeVersion", &a.TypeVersion) + delete(rawMsg, key) + case "upgradePolicy": + err = unpopulate(val, "UpgradePolicy", &a.UpgradePolicy) + 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 ApplicationTypeResource. +func (a ApplicationTypeResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationTypeResource. +func (a *ApplicationTypeResource) 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 "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, 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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 ApplicationTypeResourceList. +func (a ApplicationTypeResourceList) 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 ApplicationTypeResourceList. +func (a *ApplicationTypeResourceList) 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 ApplicationTypeResourceProperties. +func (a ApplicationTypeResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationTypeResourceProperties. +func (a *ApplicationTypeResourceProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationTypeVersionResource. +func (a ApplicationTypeVersionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationTypeVersionResource. +func (a *ApplicationTypeVersionResource) 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 "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, 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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 ApplicationTypeVersionResourceList. +func (a ApplicationTypeVersionResourceList) 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 ApplicationTypeVersionResourceList. +func (a *ApplicationTypeVersionResourceList) 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 ApplicationTypeVersionResourceProperties. +func (a ApplicationTypeVersionResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appPackageUrl", a.AppPackageURL) + populate(objectMap, "defaultParameterList", a.DefaultParameterList) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationTypeVersionResourceProperties. +func (a *ApplicationTypeVersionResourceProperties) 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 "appPackageUrl": + err = unpopulate(val, "AppPackageURL", &a.AppPackageURL) + delete(rawMsg, key) + case "defaultParameterList": + err = unpopulate(val, "DefaultParameterList", &a.DefaultParameterList) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationTypeVersionsCleanupPolicy. +func (a ApplicationTypeVersionsCleanupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxUnusedVersionsToKeep", a.MaxUnusedVersionsToKeep) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationTypeVersionsCleanupPolicy. +func (a *ApplicationTypeVersionsCleanupPolicy) 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 "maxUnusedVersionsToKeep": + err = unpopulate(val, "MaxUnusedVersionsToKeep", &a.MaxUnusedVersionsToKeep) + 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 ApplicationUpgradePolicy. +func (a ApplicationUpgradePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationHealthPolicy", a.ApplicationHealthPolicy) + populate(objectMap, "forceRestart", a.ForceRestart) + populate(objectMap, "recreateApplication", a.RecreateApplication) + populate(objectMap, "rollingUpgradeMonitoringPolicy", a.RollingUpgradeMonitoringPolicy) + populate(objectMap, "upgradeMode", a.UpgradeMode) + populate(objectMap, "upgradeReplicaSetCheckTimeout", a.UpgradeReplicaSetCheckTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationUpgradePolicy. +func (a *ApplicationUpgradePolicy) 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 "applicationHealthPolicy": + err = unpopulate(val, "ApplicationHealthPolicy", &a.ApplicationHealthPolicy) + delete(rawMsg, key) + case "forceRestart": + err = unpopulate(val, "ForceRestart", &a.ForceRestart) + delete(rawMsg, key) + case "recreateApplication": + err = unpopulate(val, "RecreateApplication", &a.RecreateApplication) + delete(rawMsg, key) + case "rollingUpgradeMonitoringPolicy": + err = unpopulate(val, "RollingUpgradeMonitoringPolicy", &a.RollingUpgradeMonitoringPolicy) + delete(rawMsg, key) + case "upgradeMode": + err = unpopulate(val, "UpgradeMode", &a.UpgradeMode) + delete(rawMsg, key) + case "upgradeReplicaSetCheckTimeout": + err = unpopulate(val, "UpgradeReplicaSetCheckTimeout", &a.UpgradeReplicaSetCheckTimeout) + 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 ApplicationUserAssignedIdentity. +func (a ApplicationUserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", a.Name) + populate(objectMap, "principalId", a.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationUserAssignedIdentity. +func (a *ApplicationUserAssignedIdentity) 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 "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &a.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmApplicationHealthPolicy. +func (a ArmApplicationHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "considerWarningAsError", a.ConsiderWarningAsError) + populate(objectMap, "defaultServiceTypeHealthPolicy", a.DefaultServiceTypeHealthPolicy) + populate(objectMap, "maxPercentUnhealthyDeployedApplications", a.MaxPercentUnhealthyDeployedApplications) + populate(objectMap, "serviceTypeHealthPolicyMap", a.ServiceTypeHealthPolicyMap) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmApplicationHealthPolicy. +func (a *ArmApplicationHealthPolicy) 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 "considerWarningAsError": + err = unpopulate(val, "ConsiderWarningAsError", &a.ConsiderWarningAsError) + delete(rawMsg, key) + case "defaultServiceTypeHealthPolicy": + err = unpopulate(val, "DefaultServiceTypeHealthPolicy", &a.DefaultServiceTypeHealthPolicy) + delete(rawMsg, key) + case "maxPercentUnhealthyDeployedApplications": + err = unpopulate(val, "MaxPercentUnhealthyDeployedApplications", &a.MaxPercentUnhealthyDeployedApplications) + delete(rawMsg, key) + case "serviceTypeHealthPolicyMap": + err = unpopulate(val, "ServiceTypeHealthPolicyMap", &a.ServiceTypeHealthPolicyMap) + 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 ArmRollingUpgradeMonitoringPolicy. +func (a ArmRollingUpgradeMonitoringPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failureAction", a.FailureAction) + populate(objectMap, "healthCheckRetryTimeout", a.HealthCheckRetryTimeout) + populate(objectMap, "healthCheckStableDuration", a.HealthCheckStableDuration) + populate(objectMap, "healthCheckWaitDuration", a.HealthCheckWaitDuration) + populate(objectMap, "upgradeDomainTimeout", a.UpgradeDomainTimeout) + populate(objectMap, "upgradeTimeout", a.UpgradeTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmRollingUpgradeMonitoringPolicy. +func (a *ArmRollingUpgradeMonitoringPolicy) 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 "failureAction": + err = unpopulate(val, "FailureAction", &a.FailureAction) + delete(rawMsg, key) + case "healthCheckRetryTimeout": + err = unpopulate(val, "HealthCheckRetryTimeout", &a.HealthCheckRetryTimeout) + delete(rawMsg, key) + case "healthCheckStableDuration": + err = unpopulate(val, "HealthCheckStableDuration", &a.HealthCheckStableDuration) + delete(rawMsg, key) + case "healthCheckWaitDuration": + err = unpopulate(val, "HealthCheckWaitDuration", &a.HealthCheckWaitDuration) + delete(rawMsg, key) + case "upgradeDomainTimeout": + err = unpopulate(val, "UpgradeDomainTimeout", &a.UpgradeDomainTimeout) + delete(rawMsg, key) + case "upgradeTimeout": + err = unpopulate(val, "UpgradeTimeout", &a.UpgradeTimeout) + 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 ArmServiceTypeHealthPolicy. +func (a ArmServiceTypeHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxPercentUnhealthyPartitionsPerService", a.MaxPercentUnhealthyPartitionsPerService) + populate(objectMap, "maxPercentUnhealthyReplicasPerPartition", a.MaxPercentUnhealthyReplicasPerPartition) + populate(objectMap, "maxPercentUnhealthyServices", a.MaxPercentUnhealthyServices) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmServiceTypeHealthPolicy. +func (a *ArmServiceTypeHealthPolicy) 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 "maxPercentUnhealthyPartitionsPerService": + err = unpopulate(val, "MaxPercentUnhealthyPartitionsPerService", &a.MaxPercentUnhealthyPartitionsPerService) + delete(rawMsg, key) + case "maxPercentUnhealthyReplicasPerPartition": + err = unpopulate(val, "MaxPercentUnhealthyReplicasPerPartition", &a.MaxPercentUnhealthyReplicasPerPartition) + delete(rawMsg, key) + case "maxPercentUnhealthyServices": + err = unpopulate(val, "MaxPercentUnhealthyServices", &a.MaxPercentUnhealthyServices) + 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 AzureActiveDirectory. +func (a AzureActiveDirectory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientApplication", a.ClientApplication) + populate(objectMap, "clusterApplication", a.ClusterApplication) + populate(objectMap, "tenantId", a.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureActiveDirectory. +func (a *AzureActiveDirectory) 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 "clientApplication": + err = unpopulate(val, "ClientApplication", &a.ClientApplication) + delete(rawMsg, key) + case "clusterApplication": + err = unpopulate(val, "ClusterApplication", &a.ClusterApplication) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) + 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 CertificateDescription. +func (c CertificateDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "thumbprintSecondary", c.ThumbprintSecondary) + populate(objectMap, "x509StoreName", c.X509StoreName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDescription. +func (c *CertificateDescription) 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 "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + case "thumbprintSecondary": + err = unpopulate(val, "ThumbprintSecondary", &c.ThumbprintSecondary) + delete(rawMsg, key) + case "x509StoreName": + err = unpopulate(val, "X509StoreName", &c.X509StoreName) + 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 ClientCertificateCommonName. +func (c ClientCertificateCommonName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateCommonName", c.CertificateCommonName) + populate(objectMap, "certificateIssuerThumbprint", c.CertificateIssuerThumbprint) + populate(objectMap, "isAdmin", c.IsAdmin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientCertificateCommonName. +func (c *ClientCertificateCommonName) 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 "certificateCommonName": + err = unpopulate(val, "CertificateCommonName", &c.CertificateCommonName) + delete(rawMsg, key) + case "certificateIssuerThumbprint": + err = unpopulate(val, "CertificateIssuerThumbprint", &c.CertificateIssuerThumbprint) + delete(rawMsg, key) + case "isAdmin": + err = unpopulate(val, "IsAdmin", &c.IsAdmin) + 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 ClientCertificateThumbprint. +func (c ClientCertificateThumbprint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateThumbprint", c.CertificateThumbprint) + populate(objectMap, "isAdmin", c.IsAdmin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientCertificateThumbprint. +func (c *ClientCertificateThumbprint) 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 "certificateThumbprint": + err = unpopulate(val, "CertificateThumbprint", &c.CertificateThumbprint) + delete(rawMsg, key) + case "isAdmin": + err = unpopulate(val, "IsAdmin", &c.IsAdmin) + 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 Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. +func (c *Cluster) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 ClusterCodeVersionsListResult. +func (c ClusterCodeVersionsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCodeVersionsListResult. +func (c *ClusterCodeVersionsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterCodeVersionsResult. +func (c ClusterCodeVersionsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCodeVersionsResult. +func (c *ClusterCodeVersionsResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "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 ClusterHealthPolicy. +func (c ClusterHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationHealthPolicies", c.ApplicationHealthPolicies) + populate(objectMap, "maxPercentUnhealthyApplications", c.MaxPercentUnhealthyApplications) + populate(objectMap, "maxPercentUnhealthyNodes", c.MaxPercentUnhealthyNodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterHealthPolicy. +func (c *ClusterHealthPolicy) 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 "applicationHealthPolicies": + err = unpopulate(val, "ApplicationHealthPolicies", &c.ApplicationHealthPolicies) + delete(rawMsg, key) + case "maxPercentUnhealthyApplications": + err = unpopulate(val, "MaxPercentUnhealthyApplications", &c.MaxPercentUnhealthyApplications) + delete(rawMsg, key) + case "maxPercentUnhealthyNodes": + err = unpopulate(val, "MaxPercentUnhealthyNodes", &c.MaxPercentUnhealthyNodes) + 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 ClusterListResult. +func (c ClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. +func (c *ClusterListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterProperties. +func (c ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addOnFeatures", c.AddOnFeatures) + populate(objectMap, "applicationTypeVersionsCleanupPolicy", c.ApplicationTypeVersionsCleanupPolicy) + populate(objectMap, "availableClusterVersions", c.AvailableClusterVersions) + populate(objectMap, "azureActiveDirectory", c.AzureActiveDirectory) + populate(objectMap, "certificate", c.Certificate) + populate(objectMap, "certificateCommonNames", c.CertificateCommonNames) + populate(objectMap, "clientCertificateCommonNames", c.ClientCertificateCommonNames) + populate(objectMap, "clientCertificateThumbprints", c.ClientCertificateThumbprints) + populate(objectMap, "clusterCodeVersion", c.ClusterCodeVersion) + populate(objectMap, "clusterEndpoint", c.ClusterEndpoint) + populate(objectMap, "clusterId", c.ClusterID) + populate(objectMap, "clusterState", c.ClusterState) + populate(objectMap, "diagnosticsStorageAccountConfig", c.DiagnosticsStorageAccountConfig) + populate(objectMap, "eventStoreServiceEnabled", c.EventStoreServiceEnabled) + populate(objectMap, "fabricSettings", c.FabricSettings) + populate(objectMap, "infrastructureServiceManager", c.InfrastructureServiceManager) + populate(objectMap, "managementEndpoint", c.ManagementEndpoint) + populate(objectMap, "nodeTypes", c.NodeTypes) + populate(objectMap, "notifications", c.Notifications) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "reliabilityLevel", c.ReliabilityLevel) + populate(objectMap, "reverseProxyCertificate", c.ReverseProxyCertificate) + populate(objectMap, "reverseProxyCertificateCommonNames", c.ReverseProxyCertificateCommonNames) + populate(objectMap, "sfZonalUpgradeMode", c.SfZonalUpgradeMode) + populate(objectMap, "upgradeDescription", c.UpgradeDescription) + populate(objectMap, "upgradeMode", c.UpgradeMode) + populateTimeRFC3339(objectMap, "upgradePauseEndTimestampUtc", c.UpgradePauseEndTimestampUTC) + populateTimeRFC3339(objectMap, "upgradePauseStartTimestampUtc", c.UpgradePauseStartTimestampUTC) + populate(objectMap, "upgradeWave", c.UpgradeWave) + populate(objectMap, "vmImage", c.VMImage) + populate(objectMap, "vmssZonalUpgradeMode", c.VmssZonalUpgradeMode) + populate(objectMap, "waveUpgradePaused", c.WaveUpgradePaused) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. +func (c *ClusterProperties) 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 "addOnFeatures": + err = unpopulate(val, "AddOnFeatures", &c.AddOnFeatures) + delete(rawMsg, key) + case "applicationTypeVersionsCleanupPolicy": + err = unpopulate(val, "ApplicationTypeVersionsCleanupPolicy", &c.ApplicationTypeVersionsCleanupPolicy) + delete(rawMsg, key) + case "availableClusterVersions": + err = unpopulate(val, "AvailableClusterVersions", &c.AvailableClusterVersions) + delete(rawMsg, key) + case "azureActiveDirectory": + err = unpopulate(val, "AzureActiveDirectory", &c.AzureActiveDirectory) + delete(rawMsg, key) + case "certificate": + err = unpopulate(val, "Certificate", &c.Certificate) + delete(rawMsg, key) + case "certificateCommonNames": + err = unpopulate(val, "CertificateCommonNames", &c.CertificateCommonNames) + delete(rawMsg, key) + case "clientCertificateCommonNames": + err = unpopulate(val, "ClientCertificateCommonNames", &c.ClientCertificateCommonNames) + delete(rawMsg, key) + case "clientCertificateThumbprints": + err = unpopulate(val, "ClientCertificateThumbprints", &c.ClientCertificateThumbprints) + delete(rawMsg, key) + case "clusterCodeVersion": + err = unpopulate(val, "ClusterCodeVersion", &c.ClusterCodeVersion) + delete(rawMsg, key) + case "clusterEndpoint": + err = unpopulate(val, "ClusterEndpoint", &c.ClusterEndpoint) + delete(rawMsg, key) + case "clusterId": + err = unpopulate(val, "ClusterID", &c.ClusterID) + delete(rawMsg, key) + case "clusterState": + err = unpopulate(val, "ClusterState", &c.ClusterState) + delete(rawMsg, key) + case "diagnosticsStorageAccountConfig": + err = unpopulate(val, "DiagnosticsStorageAccountConfig", &c.DiagnosticsStorageAccountConfig) + delete(rawMsg, key) + case "eventStoreServiceEnabled": + err = unpopulate(val, "EventStoreServiceEnabled", &c.EventStoreServiceEnabled) + delete(rawMsg, key) + case "fabricSettings": + err = unpopulate(val, "FabricSettings", &c.FabricSettings) + delete(rawMsg, key) + case "infrastructureServiceManager": + err = unpopulate(val, "InfrastructureServiceManager", &c.InfrastructureServiceManager) + delete(rawMsg, key) + case "managementEndpoint": + err = unpopulate(val, "ManagementEndpoint", &c.ManagementEndpoint) + delete(rawMsg, key) + case "nodeTypes": + err = unpopulate(val, "NodeTypes", &c.NodeTypes) + delete(rawMsg, key) + case "notifications": + err = unpopulate(val, "Notifications", &c.Notifications) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "reliabilityLevel": + err = unpopulate(val, "ReliabilityLevel", &c.ReliabilityLevel) + delete(rawMsg, key) + case "reverseProxyCertificate": + err = unpopulate(val, "ReverseProxyCertificate", &c.ReverseProxyCertificate) + delete(rawMsg, key) + case "reverseProxyCertificateCommonNames": + err = unpopulate(val, "ReverseProxyCertificateCommonNames", &c.ReverseProxyCertificateCommonNames) + delete(rawMsg, key) + case "sfZonalUpgradeMode": + err = unpopulate(val, "SfZonalUpgradeMode", &c.SfZonalUpgradeMode) + delete(rawMsg, key) + case "upgradeDescription": + err = unpopulate(val, "UpgradeDescription", &c.UpgradeDescription) + delete(rawMsg, key) + case "upgradeMode": + err = unpopulate(val, "UpgradeMode", &c.UpgradeMode) + delete(rawMsg, key) + case "upgradePauseEndTimestampUtc": + err = unpopulateTimeRFC3339(val, "UpgradePauseEndTimestampUTC", &c.UpgradePauseEndTimestampUTC) + delete(rawMsg, key) + case "upgradePauseStartTimestampUtc": + err = unpopulateTimeRFC3339(val, "UpgradePauseStartTimestampUTC", &c.UpgradePauseStartTimestampUTC) + delete(rawMsg, key) + case "upgradeWave": + err = unpopulate(val, "UpgradeWave", &c.UpgradeWave) + delete(rawMsg, key) + case "vmImage": + err = unpopulate(val, "VMImage", &c.VMImage) + delete(rawMsg, key) + case "vmssZonalUpgradeMode": + err = unpopulate(val, "VmssZonalUpgradeMode", &c.VmssZonalUpgradeMode) + delete(rawMsg, key) + case "waveUpgradePaused": + err = unpopulate(val, "WaveUpgradePaused", &c.WaveUpgradePaused) + 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 ClusterPropertiesUpdateParameters. +func (c ClusterPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addOnFeatures", c.AddOnFeatures) + populate(objectMap, "applicationTypeVersionsCleanupPolicy", c.ApplicationTypeVersionsCleanupPolicy) + populate(objectMap, "certificate", c.Certificate) + populate(objectMap, "certificateCommonNames", c.CertificateCommonNames) + populate(objectMap, "clientCertificateCommonNames", c.ClientCertificateCommonNames) + populate(objectMap, "clientCertificateThumbprints", c.ClientCertificateThumbprints) + populate(objectMap, "clusterCodeVersion", c.ClusterCodeVersion) + populate(objectMap, "eventStoreServiceEnabled", c.EventStoreServiceEnabled) + populate(objectMap, "fabricSettings", c.FabricSettings) + populate(objectMap, "infrastructureServiceManager", c.InfrastructureServiceManager) + populate(objectMap, "nodeTypes", c.NodeTypes) + populate(objectMap, "notifications", c.Notifications) + populate(objectMap, "reliabilityLevel", c.ReliabilityLevel) + populate(objectMap, "reverseProxyCertificate", c.ReverseProxyCertificate) + populate(objectMap, "sfZonalUpgradeMode", c.SfZonalUpgradeMode) + populate(objectMap, "upgradeDescription", c.UpgradeDescription) + populate(objectMap, "upgradeMode", c.UpgradeMode) + populateTimeRFC3339(objectMap, "upgradePauseEndTimestampUtc", c.UpgradePauseEndTimestampUTC) + populateTimeRFC3339(objectMap, "upgradePauseStartTimestampUtc", c.UpgradePauseStartTimestampUTC) + populate(objectMap, "upgradeWave", c.UpgradeWave) + populate(objectMap, "vmssZonalUpgradeMode", c.VmssZonalUpgradeMode) + populate(objectMap, "waveUpgradePaused", c.WaveUpgradePaused) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPropertiesUpdateParameters. +func (c *ClusterPropertiesUpdateParameters) 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 "addOnFeatures": + err = unpopulate(val, "AddOnFeatures", &c.AddOnFeatures) + delete(rawMsg, key) + case "applicationTypeVersionsCleanupPolicy": + err = unpopulate(val, "ApplicationTypeVersionsCleanupPolicy", &c.ApplicationTypeVersionsCleanupPolicy) + delete(rawMsg, key) + case "certificate": + err = unpopulate(val, "Certificate", &c.Certificate) + delete(rawMsg, key) + case "certificateCommonNames": + err = unpopulate(val, "CertificateCommonNames", &c.CertificateCommonNames) + delete(rawMsg, key) + case "clientCertificateCommonNames": + err = unpopulate(val, "ClientCertificateCommonNames", &c.ClientCertificateCommonNames) + delete(rawMsg, key) + case "clientCertificateThumbprints": + err = unpopulate(val, "ClientCertificateThumbprints", &c.ClientCertificateThumbprints) + delete(rawMsg, key) + case "clusterCodeVersion": + err = unpopulate(val, "ClusterCodeVersion", &c.ClusterCodeVersion) + delete(rawMsg, key) + case "eventStoreServiceEnabled": + err = unpopulate(val, "EventStoreServiceEnabled", &c.EventStoreServiceEnabled) + delete(rawMsg, key) + case "fabricSettings": + err = unpopulate(val, "FabricSettings", &c.FabricSettings) + delete(rawMsg, key) + case "infrastructureServiceManager": + err = unpopulate(val, "InfrastructureServiceManager", &c.InfrastructureServiceManager) + delete(rawMsg, key) + case "nodeTypes": + err = unpopulate(val, "NodeTypes", &c.NodeTypes) + delete(rawMsg, key) + case "notifications": + err = unpopulate(val, "Notifications", &c.Notifications) + delete(rawMsg, key) + case "reliabilityLevel": + err = unpopulate(val, "ReliabilityLevel", &c.ReliabilityLevel) + delete(rawMsg, key) + case "reverseProxyCertificate": + err = unpopulate(val, "ReverseProxyCertificate", &c.ReverseProxyCertificate) + delete(rawMsg, key) + case "sfZonalUpgradeMode": + err = unpopulate(val, "SfZonalUpgradeMode", &c.SfZonalUpgradeMode) + delete(rawMsg, key) + case "upgradeDescription": + err = unpopulate(val, "UpgradeDescription", &c.UpgradeDescription) + delete(rawMsg, key) + case "upgradeMode": + err = unpopulate(val, "UpgradeMode", &c.UpgradeMode) + delete(rawMsg, key) + case "upgradePauseEndTimestampUtc": + err = unpopulateTimeRFC3339(val, "UpgradePauseEndTimestampUTC", &c.UpgradePauseEndTimestampUTC) + delete(rawMsg, key) + case "upgradePauseStartTimestampUtc": + err = unpopulateTimeRFC3339(val, "UpgradePauseStartTimestampUTC", &c.UpgradePauseStartTimestampUTC) + delete(rawMsg, key) + case "upgradeWave": + err = unpopulate(val, "UpgradeWave", &c.UpgradeWave) + delete(rawMsg, key) + case "vmssZonalUpgradeMode": + err = unpopulate(val, "VmssZonalUpgradeMode", &c.VmssZonalUpgradeMode) + delete(rawMsg, key) + case "waveUpgradePaused": + err = unpopulate(val, "WaveUpgradePaused", &c.WaveUpgradePaused) + 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 ClusterUpdateParameters. +func (c ClusterUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpdateParameters. +func (c *ClusterUpdateParameters) 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 "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 ClusterUpgradeDeltaHealthPolicy. +func (c ClusterUpgradeDeltaHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationDeltaHealthPolicies", c.ApplicationDeltaHealthPolicies) + populate(objectMap, "maxPercentDeltaUnhealthyApplications", c.MaxPercentDeltaUnhealthyApplications) + populate(objectMap, "maxPercentDeltaUnhealthyNodes", c.MaxPercentDeltaUnhealthyNodes) + populate(objectMap, "maxPercentUpgradeDomainDeltaUnhealthyNodes", c.MaxPercentUpgradeDomainDeltaUnhealthyNodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradeDeltaHealthPolicy. +func (c *ClusterUpgradeDeltaHealthPolicy) 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 "applicationDeltaHealthPolicies": + err = unpopulate(val, "ApplicationDeltaHealthPolicies", &c.ApplicationDeltaHealthPolicies) + delete(rawMsg, key) + case "maxPercentDeltaUnhealthyApplications": + err = unpopulate(val, "MaxPercentDeltaUnhealthyApplications", &c.MaxPercentDeltaUnhealthyApplications) + delete(rawMsg, key) + case "maxPercentDeltaUnhealthyNodes": + err = unpopulate(val, "MaxPercentDeltaUnhealthyNodes", &c.MaxPercentDeltaUnhealthyNodes) + delete(rawMsg, key) + case "maxPercentUpgradeDomainDeltaUnhealthyNodes": + err = unpopulate(val, "MaxPercentUpgradeDomainDeltaUnhealthyNodes", &c.MaxPercentUpgradeDomainDeltaUnhealthyNodes) + 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 ClusterUpgradePolicy. +func (c ClusterUpgradePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deltaHealthPolicy", c.DeltaHealthPolicy) + populate(objectMap, "forceRestart", c.ForceRestart) + populate(objectMap, "healthCheckRetryTimeout", c.HealthCheckRetryTimeout) + populate(objectMap, "healthCheckStableDuration", c.HealthCheckStableDuration) + populate(objectMap, "healthCheckWaitDuration", c.HealthCheckWaitDuration) + populate(objectMap, "healthPolicy", c.HealthPolicy) + populate(objectMap, "upgradeDomainTimeout", c.UpgradeDomainTimeout) + populate(objectMap, "upgradeReplicaSetCheckTimeout", c.UpgradeReplicaSetCheckTimeout) + populate(objectMap, "upgradeTimeout", c.UpgradeTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradePolicy. +func (c *ClusterUpgradePolicy) 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 "deltaHealthPolicy": + err = unpopulate(val, "DeltaHealthPolicy", &c.DeltaHealthPolicy) + delete(rawMsg, key) + case "forceRestart": + err = unpopulate(val, "ForceRestart", &c.ForceRestart) + delete(rawMsg, key) + case "healthCheckRetryTimeout": + err = unpopulate(val, "HealthCheckRetryTimeout", &c.HealthCheckRetryTimeout) + delete(rawMsg, key) + case "healthCheckStableDuration": + err = unpopulate(val, "HealthCheckStableDuration", &c.HealthCheckStableDuration) + delete(rawMsg, key) + case "healthCheckWaitDuration": + err = unpopulate(val, "HealthCheckWaitDuration", &c.HealthCheckWaitDuration) + delete(rawMsg, key) + case "healthPolicy": + err = unpopulate(val, "HealthPolicy", &c.HealthPolicy) + delete(rawMsg, key) + case "upgradeDomainTimeout": + err = unpopulate(val, "UpgradeDomainTimeout", &c.UpgradeDomainTimeout) + delete(rawMsg, key) + case "upgradeReplicaSetCheckTimeout": + err = unpopulate(val, "UpgradeReplicaSetCheckTimeout", &c.UpgradeReplicaSetCheckTimeout) + delete(rawMsg, key) + case "upgradeTimeout": + err = unpopulate(val, "UpgradeTimeout", &c.UpgradeTimeout) + 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 ClusterVersionDetails. +func (c ClusterVersionDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "codeVersion", c.CodeVersion) + populate(objectMap, "environment", c.Environment) + populate(objectMap, "supportExpiryUtc", c.SupportExpiryUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterVersionDetails. +func (c *ClusterVersionDetails) 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 "codeVersion": + err = unpopulate(val, "CodeVersion", &c.CodeVersion) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &c.Environment) + delete(rawMsg, key) + case "supportExpiryUtc": + err = unpopulate(val, "SupportExpiryUTC", &c.SupportExpiryUTC) + 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 DiagnosticsStorageAccountConfig. +func (d DiagnosticsStorageAccountConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobEndpoint", d.BlobEndpoint) + populate(objectMap, "protectedAccountKeyName", d.ProtectedAccountKeyName) + populate(objectMap, "protectedAccountKeyName2", d.ProtectedAccountKeyName2) + populate(objectMap, "queueEndpoint", d.QueueEndpoint) + populate(objectMap, "storageAccountName", d.StorageAccountName) + populate(objectMap, "tableEndpoint", d.TableEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsStorageAccountConfig. +func (d *DiagnosticsStorageAccountConfig) 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 "blobEndpoint": + err = unpopulate(val, "BlobEndpoint", &d.BlobEndpoint) + delete(rawMsg, key) + case "protectedAccountKeyName": + err = unpopulate(val, "ProtectedAccountKeyName", &d.ProtectedAccountKeyName) + delete(rawMsg, key) + case "protectedAccountKeyName2": + err = unpopulate(val, "ProtectedAccountKeyName2", &d.ProtectedAccountKeyName2) + delete(rawMsg, key) + case "queueEndpoint": + err = unpopulate(val, "QueueEndpoint", &d.QueueEndpoint) + delete(rawMsg, key) + case "storageAccountName": + err = unpopulate(val, "StorageAccountName", &d.StorageAccountName) + delete(rawMsg, key) + case "tableEndpoint": + err = unpopulate(val, "TableEndpoint", &d.TableEndpoint) + 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 EndpointRangeDescription. +func (e EndpointRangeDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endPort", e.EndPort) + populate(objectMap, "startPort", e.StartPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointRangeDescription. +func (e *EndpointRangeDescription) 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 "endPort": + err = unpopulate(val, "EndPort", &e.EndPort) + delete(rawMsg, key) + case "startPort": + err = unpopulate(val, "StartPort", &e.StartPort) + 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 ErrorModelError. +func (e ErrorModelError) 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 ErrorModelError. +func (e *ErrorModelError) 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 ManagedIdentity. +func (m ManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentity. +func (m *ManagedIdentity) 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 "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + 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 NamedPartitionSchemeDescription. +func (n NamedPartitionSchemeDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", n.Count) + populate(objectMap, "names", n.Names) + objectMap["partitionScheme"] = PartitionSchemeNamed + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedPartitionSchemeDescription. +func (n *NamedPartitionSchemeDescription) 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 "count": + err = unpopulate(val, "Count", &n.Count) + delete(rawMsg, key) + case "names": + err = unpopulate(val, "Names", &n.Names) + delete(rawMsg, key) + case "partitionScheme": + err = unpopulate(val, "PartitionScheme", &n.PartitionScheme) + 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 NodeTypeDescription. +func (n NodeTypeDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationPorts", n.ApplicationPorts) + populate(objectMap, "capacities", n.Capacities) + populate(objectMap, "clientConnectionEndpointPort", n.ClientConnectionEndpointPort) + populate(objectMap, "durabilityLevel", n.DurabilityLevel) + populate(objectMap, "ephemeralPorts", n.EphemeralPorts) + populate(objectMap, "httpGatewayEndpointPort", n.HTTPGatewayEndpointPort) + populate(objectMap, "isPrimary", n.IsPrimary) + populate(objectMap, "isStateless", n.IsStateless) + populate(objectMap, "multipleAvailabilityZones", n.MultipleAvailabilityZones) + populate(objectMap, "name", n.Name) + populate(objectMap, "placementProperties", n.PlacementProperties) + populate(objectMap, "reverseProxyEndpointPort", n.ReverseProxyEndpointPort) + populate(objectMap, "vmInstanceCount", n.VMInstanceCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NodeTypeDescription. +func (n *NodeTypeDescription) 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 "applicationPorts": + err = unpopulate(val, "ApplicationPorts", &n.ApplicationPorts) + delete(rawMsg, key) + case "capacities": + err = unpopulate(val, "Capacities", &n.Capacities) + delete(rawMsg, key) + case "clientConnectionEndpointPort": + err = unpopulate(val, "ClientConnectionEndpointPort", &n.ClientConnectionEndpointPort) + delete(rawMsg, key) + case "durabilityLevel": + err = unpopulate(val, "DurabilityLevel", &n.DurabilityLevel) + delete(rawMsg, key) + case "ephemeralPorts": + err = unpopulate(val, "EphemeralPorts", &n.EphemeralPorts) + delete(rawMsg, key) + case "httpGatewayEndpointPort": + err = unpopulate(val, "HTTPGatewayEndpointPort", &n.HTTPGatewayEndpointPort) + delete(rawMsg, key) + case "isPrimary": + err = unpopulate(val, "IsPrimary", &n.IsPrimary) + delete(rawMsg, key) + case "isStateless": + err = unpopulate(val, "IsStateless", &n.IsStateless) + delete(rawMsg, key) + case "multipleAvailabilityZones": + err = unpopulate(val, "MultipleAvailabilityZones", &n.MultipleAvailabilityZones) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "placementProperties": + err = unpopulate(val, "PlacementProperties", &n.PlacementProperties) + delete(rawMsg, key) + case "reverseProxyEndpointPort": + err = unpopulate(val, "ReverseProxyEndpointPort", &n.ReverseProxyEndpointPort) + delete(rawMsg, key) + case "vmInstanceCount": + err = unpopulate(val, "VMInstanceCount", &n.VMInstanceCount) + 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 Notification. +func (n Notification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isEnabled", n.IsEnabled) + populate(objectMap, "notificationCategory", n.NotificationCategory) + populate(objectMap, "notificationLevel", n.NotificationLevel) + populate(objectMap, "notificationTargets", n.NotificationTargets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Notification. +func (n *Notification) 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 "isEnabled": + err = unpopulate(val, "IsEnabled", &n.IsEnabled) + delete(rawMsg, key) + case "notificationCategory": + err = unpopulate(val, "NotificationCategory", &n.NotificationCategory) + delete(rawMsg, key) + case "notificationLevel": + err = unpopulate(val, "NotificationLevel", &n.NotificationLevel) + delete(rawMsg, key) + case "notificationTargets": + err = unpopulate(val, "NotificationTargets", &n.NotificationTargets) + 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 NotificationTarget. +func (n NotificationTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "notificationChannel", n.NotificationChannel) + populate(objectMap, "receivers", n.Receivers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationTarget. +func (n *NotificationTarget) 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 "notificationChannel": + err = unpopulate(val, "NotificationChannel", &n.NotificationChannel) + delete(rawMsg, key) + case "receivers": + err = unpopulate(val, "Receivers", &n.Receivers) + 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, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "origin", o.Origin) + 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 "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartitionSchemeDescription. +func (p PartitionSchemeDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["partitionScheme"] = p.PartitionScheme + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionSchemeDescription. +func (p *PartitionSchemeDescription) 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 "partitionScheme": + err = unpopulate(val, "PartitionScheme", &p.PartitionScheme) + 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, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) + 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 ServerCertificateCommonName. +func (s ServerCertificateCommonName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateCommonName", s.CertificateCommonName) + populate(objectMap, "certificateIssuerThumbprint", s.CertificateIssuerThumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCertificateCommonName. +func (s *ServerCertificateCommonName) 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 "certificateCommonName": + err = unpopulate(val, "CertificateCommonName", &s.CertificateCommonName) + delete(rawMsg, key) + case "certificateIssuerThumbprint": + err = unpopulate(val, "CertificateIssuerThumbprint", &s.CertificateIssuerThumbprint) + 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 ServerCertificateCommonNames. +func (s ServerCertificateCommonNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "commonNames", s.CommonNames) + populate(objectMap, "x509StoreName", s.X509StoreName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerCertificateCommonNames. +func (s *ServerCertificateCommonNames) 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 "commonNames": + err = unpopulate(val, "CommonNames", &s.CommonNames) + delete(rawMsg, key) + case "x509StoreName": + err = unpopulate(val, "X509StoreName", &s.X509StoreName) + 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 ServiceCorrelationDescription. +func (s ServiceCorrelationDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scheme", s.Scheme) + populate(objectMap, "serviceName", s.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCorrelationDescription. +func (s *ServiceCorrelationDescription) 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 "scheme": + err = unpopulate(val, "Scheme", &s.Scheme) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &s.ServiceName) + 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 ServiceLoadMetricDescription. +func (s ServiceLoadMetricDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultLoad", s.DefaultLoad) + populate(objectMap, "name", s.Name) + populate(objectMap, "primaryDefaultLoad", s.PrimaryDefaultLoad) + populate(objectMap, "secondaryDefaultLoad", s.SecondaryDefaultLoad) + populate(objectMap, "weight", s.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLoadMetricDescription. +func (s *ServiceLoadMetricDescription) 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 "defaultLoad": + err = unpopulate(val, "DefaultLoad", &s.DefaultLoad) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "primaryDefaultLoad": + err = unpopulate(val, "PrimaryDefaultLoad", &s.PrimaryDefaultLoad) + delete(rawMsg, key) + case "secondaryDefaultLoad": + err = unpopulate(val, "SecondaryDefaultLoad", &s.SecondaryDefaultLoad) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &s.Weight) + 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 ServicePlacementPolicyDescription. +func (s ServicePlacementPolicyDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["type"] = s.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePlacementPolicyDescription. +func (s *ServicePlacementPolicyDescription) 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 "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 ServiceResource. +func (s ServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResource. +func (s *ServiceResource) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, 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 = unmarshalServiceResourcePropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceResourceList. +func (s ServiceResourceList) 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 ServiceResourceList. +func (s *ServiceResourceList) 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, "correlationScheme", s.CorrelationScheme) + populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) + populate(objectMap, "partitionDescription", s.PartitionDescription) + populate(objectMap, "placementConstraints", s.PlacementConstraints) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serviceDnsName", s.ServiceDNSName) + objectMap["serviceKind"] = s.ServiceKind + populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) + populate(objectMap, "servicePackageActivationMode", s.ServicePackageActivationMode) + populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) + populate(objectMap, "serviceTypeName", s.ServiceTypeName) + 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 "correlationScheme": + err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) + delete(rawMsg, key) + case "defaultMoveCost": + err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) + delete(rawMsg, key) + case "partitionDescription": + s.PartitionDescription, err = unmarshalPartitionSchemeDescriptionClassification(val) + delete(rawMsg, key) + case "placementConstraints": + err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &s.ServiceDNSName) + delete(rawMsg, key) + case "serviceKind": + err = unpopulate(val, "ServiceKind", &s.ServiceKind) + delete(rawMsg, key) + case "serviceLoadMetrics": + err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) + delete(rawMsg, key) + case "servicePackageActivationMode": + err = unpopulate(val, "ServicePackageActivationMode", &s.ServicePackageActivationMode) + delete(rawMsg, key) + case "servicePlacementPolicies": + s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) + delete(rawMsg, key) + case "serviceTypeName": + err = unpopulate(val, "ServiceTypeName", &s.ServiceTypeName) + 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 ServiceResourcePropertiesBase. +func (s ServiceResourcePropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationScheme", s.CorrelationScheme) + populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) + populate(objectMap, "placementConstraints", s.PlacementConstraints) + populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) + populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourcePropertiesBase. +func (s *ServiceResourcePropertiesBase) 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 "correlationScheme": + err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) + delete(rawMsg, key) + case "defaultMoveCost": + err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) + delete(rawMsg, key) + case "placementConstraints": + err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) + delete(rawMsg, key) + case "serviceLoadMetrics": + err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) + delete(rawMsg, key) + case "servicePlacementPolicies": + s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) + 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 ServiceResourceUpdate. +func (s ServiceResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceUpdate. +func (s *ServiceResourceUpdate) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, 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 = unmarshalServiceResourceUpdatePropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceResourceUpdateProperties. +func (s ServiceResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationScheme", s.CorrelationScheme) + populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) + populate(objectMap, "placementConstraints", s.PlacementConstraints) + objectMap["serviceKind"] = s.ServiceKind + populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) + populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceUpdateProperties. +func (s *ServiceResourceUpdateProperties) 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 "correlationScheme": + err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) + delete(rawMsg, key) + case "defaultMoveCost": + err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) + delete(rawMsg, key) + case "placementConstraints": + err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) + delete(rawMsg, key) + case "serviceKind": + err = unpopulate(val, "ServiceKind", &s.ServiceKind) + delete(rawMsg, key) + case "serviceLoadMetrics": + err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) + delete(rawMsg, key) + case "servicePlacementPolicies": + s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) + 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 ServiceTypeDeltaHealthPolicy. +func (s ServiceTypeDeltaHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxPercentDeltaUnhealthyServices", s.MaxPercentDeltaUnhealthyServices) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTypeDeltaHealthPolicy. +func (s *ServiceTypeDeltaHealthPolicy) 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 "maxPercentDeltaUnhealthyServices": + err = unpopulate(val, "MaxPercentDeltaUnhealthyServices", &s.MaxPercentDeltaUnhealthyServices) + 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 ServiceTypeHealthPolicy. +func (s ServiceTypeHealthPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxPercentUnhealthyServices", s.MaxPercentUnhealthyServices) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTypeHealthPolicy. +func (s *ServiceTypeHealthPolicy) 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 "maxPercentUnhealthyServices": + err = unpopulate(val, "MaxPercentUnhealthyServices", &s.MaxPercentUnhealthyServices) + 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 SettingsParameterDescription. +func (s SettingsParameterDescription) 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 SettingsParameterDescription. +func (s *SettingsParameterDescription) 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 SettingsSectionDescription. +func (s SettingsSectionDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "parameters", s.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SettingsSectionDescription. +func (s *SettingsSectionDescription) 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 "parameters": + err = unpopulate(val, "Parameters", &s.Parameters) + 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 SingletonPartitionSchemeDescription. +func (s SingletonPartitionSchemeDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["partitionScheme"] = PartitionSchemeSingleton + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingletonPartitionSchemeDescription. +func (s *SingletonPartitionSchemeDescription) 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 "partitionScheme": + err = unpopulate(val, "PartitionScheme", &s.PartitionScheme) + 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 StatefulServiceProperties. +func (s StatefulServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationScheme", s.CorrelationScheme) + populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) + populate(objectMap, "hasPersistedState", s.HasPersistedState) + populate(objectMap, "minReplicaSetSize", s.MinReplicaSetSize) + populate(objectMap, "partitionDescription", s.PartitionDescription) + populate(objectMap, "placementConstraints", s.PlacementConstraints) + populate(objectMap, "provisioningState", s.ProvisioningState) + populateTimeRFC3339(objectMap, "quorumLossWaitDuration", s.QuorumLossWaitDuration) + populateTimeRFC3339(objectMap, "replicaRestartWaitDuration", s.ReplicaRestartWaitDuration) + populate(objectMap, "serviceDnsName", s.ServiceDNSName) + objectMap["serviceKind"] = ServiceKindStateful + populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) + populate(objectMap, "servicePackageActivationMode", s.ServicePackageActivationMode) + populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) + populate(objectMap, "serviceTypeName", s.ServiceTypeName) + populateTimeRFC3339(objectMap, "standByReplicaKeepDuration", s.StandByReplicaKeepDuration) + populate(objectMap, "targetReplicaSetSize", s.TargetReplicaSetSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StatefulServiceProperties. +func (s *StatefulServiceProperties) 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 "correlationScheme": + err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) + delete(rawMsg, key) + case "defaultMoveCost": + err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) + delete(rawMsg, key) + case "hasPersistedState": + err = unpopulate(val, "HasPersistedState", &s.HasPersistedState) + delete(rawMsg, key) + case "minReplicaSetSize": + err = unpopulate(val, "MinReplicaSetSize", &s.MinReplicaSetSize) + delete(rawMsg, key) + case "partitionDescription": + s.PartitionDescription, err = unmarshalPartitionSchemeDescriptionClassification(val) + delete(rawMsg, key) + case "placementConstraints": + err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "quorumLossWaitDuration": + err = unpopulateTimeRFC3339(val, "QuorumLossWaitDuration", &s.QuorumLossWaitDuration) + delete(rawMsg, key) + case "replicaRestartWaitDuration": + err = unpopulateTimeRFC3339(val, "ReplicaRestartWaitDuration", &s.ReplicaRestartWaitDuration) + delete(rawMsg, key) + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &s.ServiceDNSName) + delete(rawMsg, key) + case "serviceKind": + err = unpopulate(val, "ServiceKind", &s.ServiceKind) + delete(rawMsg, key) + case "serviceLoadMetrics": + err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) + delete(rawMsg, key) + case "servicePackageActivationMode": + err = unpopulate(val, "ServicePackageActivationMode", &s.ServicePackageActivationMode) + delete(rawMsg, key) + case "servicePlacementPolicies": + s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) + delete(rawMsg, key) + case "serviceTypeName": + err = unpopulate(val, "ServiceTypeName", &s.ServiceTypeName) + delete(rawMsg, key) + case "standByReplicaKeepDuration": + err = unpopulateTimeRFC3339(val, "StandByReplicaKeepDuration", &s.StandByReplicaKeepDuration) + delete(rawMsg, key) + case "targetReplicaSetSize": + err = unpopulate(val, "TargetReplicaSetSize", &s.TargetReplicaSetSize) + 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 StatefulServiceUpdateProperties. +func (s StatefulServiceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationScheme", s.CorrelationScheme) + populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) + populate(objectMap, "minReplicaSetSize", s.MinReplicaSetSize) + populate(objectMap, "placementConstraints", s.PlacementConstraints) + populateTimeRFC3339(objectMap, "quorumLossWaitDuration", s.QuorumLossWaitDuration) + populateTimeRFC3339(objectMap, "replicaRestartWaitDuration", s.ReplicaRestartWaitDuration) + objectMap["serviceKind"] = ServiceKindStateful + populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) + populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) + populateTimeRFC3339(objectMap, "standByReplicaKeepDuration", s.StandByReplicaKeepDuration) + populate(objectMap, "targetReplicaSetSize", s.TargetReplicaSetSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StatefulServiceUpdateProperties. +func (s *StatefulServiceUpdateProperties) 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 "correlationScheme": + err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) + delete(rawMsg, key) + case "defaultMoveCost": + err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) + delete(rawMsg, key) + case "minReplicaSetSize": + err = unpopulate(val, "MinReplicaSetSize", &s.MinReplicaSetSize) + delete(rawMsg, key) + case "placementConstraints": + err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) + delete(rawMsg, key) + case "quorumLossWaitDuration": + err = unpopulateTimeRFC3339(val, "QuorumLossWaitDuration", &s.QuorumLossWaitDuration) + delete(rawMsg, key) + case "replicaRestartWaitDuration": + err = unpopulateTimeRFC3339(val, "ReplicaRestartWaitDuration", &s.ReplicaRestartWaitDuration) + delete(rawMsg, key) + case "serviceKind": + err = unpopulate(val, "ServiceKind", &s.ServiceKind) + delete(rawMsg, key) + case "serviceLoadMetrics": + err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) + delete(rawMsg, key) + case "servicePlacementPolicies": + s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) + delete(rawMsg, key) + case "standByReplicaKeepDuration": + err = unpopulateTimeRFC3339(val, "StandByReplicaKeepDuration", &s.StandByReplicaKeepDuration) + delete(rawMsg, key) + case "targetReplicaSetSize": + err = unpopulate(val, "TargetReplicaSetSize", &s.TargetReplicaSetSize) + 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 StatelessServiceProperties. +func (s StatelessServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationScheme", s.CorrelationScheme) + populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) + populate(objectMap, "instanceCloseDelayDuration", s.InstanceCloseDelayDuration) + populate(objectMap, "instanceCount", s.InstanceCount) + populate(objectMap, "partitionDescription", s.PartitionDescription) + populate(objectMap, "placementConstraints", s.PlacementConstraints) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serviceDnsName", s.ServiceDNSName) + objectMap["serviceKind"] = ServiceKindStateless + populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) + populate(objectMap, "servicePackageActivationMode", s.ServicePackageActivationMode) + populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) + populate(objectMap, "serviceTypeName", s.ServiceTypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StatelessServiceProperties. +func (s *StatelessServiceProperties) 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 "correlationScheme": + err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) + delete(rawMsg, key) + case "defaultMoveCost": + err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) + delete(rawMsg, key) + case "instanceCloseDelayDuration": + err = unpopulate(val, "InstanceCloseDelayDuration", &s.InstanceCloseDelayDuration) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &s.InstanceCount) + delete(rawMsg, key) + case "partitionDescription": + s.PartitionDescription, err = unmarshalPartitionSchemeDescriptionClassification(val) + delete(rawMsg, key) + case "placementConstraints": + err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serviceDnsName": + err = unpopulate(val, "ServiceDNSName", &s.ServiceDNSName) + delete(rawMsg, key) + case "serviceKind": + err = unpopulate(val, "ServiceKind", &s.ServiceKind) + delete(rawMsg, key) + case "serviceLoadMetrics": + err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) + delete(rawMsg, key) + case "servicePackageActivationMode": + err = unpopulate(val, "ServicePackageActivationMode", &s.ServicePackageActivationMode) + delete(rawMsg, key) + case "servicePlacementPolicies": + s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) + delete(rawMsg, key) + case "serviceTypeName": + err = unpopulate(val, "ServiceTypeName", &s.ServiceTypeName) + 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 StatelessServiceUpdateProperties. +func (s StatelessServiceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationScheme", s.CorrelationScheme) + populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) + populate(objectMap, "instanceCloseDelayDuration", s.InstanceCloseDelayDuration) + populate(objectMap, "instanceCount", s.InstanceCount) + populate(objectMap, "placementConstraints", s.PlacementConstraints) + objectMap["serviceKind"] = ServiceKindStateless + populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) + populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StatelessServiceUpdateProperties. +func (s *StatelessServiceUpdateProperties) 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 "correlationScheme": + err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) + delete(rawMsg, key) + case "defaultMoveCost": + err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) + delete(rawMsg, key) + case "instanceCloseDelayDuration": + err = unpopulate(val, "InstanceCloseDelayDuration", &s.InstanceCloseDelayDuration) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &s.InstanceCount) + delete(rawMsg, key) + case "placementConstraints": + err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) + delete(rawMsg, key) + case "serviceKind": + err = unpopulate(val, "ServiceKind", &s.ServiceKind) + delete(rawMsg, key) + case "serviceLoadMetrics": + err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) + delete(rawMsg, key) + case "servicePlacementPolicies": + s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UniformInt64RangePartitionSchemeDescription. +func (u UniformInt64RangePartitionSchemeDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", u.Count) + populate(objectMap, "highKey", u.HighKey) + populate(objectMap, "lowKey", u.LowKey) + objectMap["partitionScheme"] = PartitionSchemeUniformInt64Range + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UniformInt64RangePartitionSchemeDescription. +func (u *UniformInt64RangePartitionSchemeDescription) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &u.Count) + delete(rawMsg, key) + case "highKey": + err = unpopulate(val, "HighKey", &u.HighKey) + delete(rawMsg, key) + case "lowKey": + err = unpopulate(val, "LowKey", &u.LowKey) + delete(rawMsg, key) + case "partitionScheme": + err = unpopulate(val, "PartitionScheme", &u.PartitionScheme) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpgradableVersionPathResult. +func (u UpgradableVersionPathResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "supportedPath", u.SupportedPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradableVersionPathResult. +func (u *UpgradableVersionPathResult) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "supportedPath": + err = unpopulate(val, "SupportedPath", &u.SupportedPath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpgradableVersionsDescription. +func (u UpgradableVersionsDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetVersion", u.TargetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradableVersionsDescription. +func (u *UpgradableVersionsDescription) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "targetVersion": + err = unpopulate(val, "TargetVersion", &u.TargetVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, 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/servicefabric/armservicefabric/zz_generated_operations_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/operations_client.go similarity index 92% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_operations_client.go rename to sdk/resourcemanager/servicefabric/armservicefabric/operations_client.go index 2c18676252dd..922fc4b0f3e8 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_operations_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/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 armservicefabric @@ -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 - Get the list of available Service Fabric resource provider API operations. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// 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/servicefabric/armservicefabric/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/servicefabric/armservicefabric/polymorphic_helpers.go similarity index 96% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/servicefabric/armservicefabric/polymorphic_helpers.go index 2abc520a184b..e3ff132b7b4b 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/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 armservicefabric @@ -14,7 +15,7 @@ func unmarshalPartitionSchemeDescriptionClassification(rawMsg json.RawMessage) ( 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 } @@ -36,7 +37,7 @@ func unmarshalServicePlacementPolicyDescriptionClassification(rawMsg json.RawMes 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 } @@ -71,7 +72,7 @@ func unmarshalServiceResourcePropertiesClassification(rawMsg json.RawMessage) (S 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 } @@ -91,7 +92,7 @@ func unmarshalServiceResourceUpdatePropertiesClassification(rawMsg json.RawMessa 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/servicefabric/armservicefabric/zz_generated_response_types.go b/sdk/resourcemanager/servicefabric/armservicefabric/response_types.go similarity index 90% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_response_types.go rename to sdk/resourcemanager/servicefabric/armservicefabric/response_types.go index 09fd3ec260e1..d2bf2fe2eb9d 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_response_types.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/response_types.go @@ -5,15 +5,16 @@ // 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 armservicefabric -// ApplicationTypeVersionsClientCreateOrUpdateResponse contains the response from method ApplicationTypeVersionsClient.CreateOrUpdate. +// ApplicationTypeVersionsClientCreateOrUpdateResponse contains the response from method ApplicationTypeVersionsClient.BeginCreateOrUpdate. type ApplicationTypeVersionsClientCreateOrUpdateResponse struct { ApplicationTypeVersionResource } -// ApplicationTypeVersionsClientDeleteResponse contains the response from method ApplicationTypeVersionsClient.Delete. +// ApplicationTypeVersionsClientDeleteResponse contains the response from method ApplicationTypeVersionsClient.BeginDelete. type ApplicationTypeVersionsClientDeleteResponse struct { // placeholder for future response values } @@ -33,7 +34,7 @@ type ApplicationTypesClientCreateOrUpdateResponse struct { ApplicationTypeResource } -// ApplicationTypesClientDeleteResponse contains the response from method ApplicationTypesClient.Delete. +// ApplicationTypesClientDeleteResponse contains the response from method ApplicationTypesClient.BeginDelete. type ApplicationTypesClientDeleteResponse struct { // placeholder for future response values } @@ -48,12 +49,12 @@ type ApplicationTypesClientListResponse struct { ApplicationTypeResourceList } -// ApplicationsClientCreateOrUpdateResponse contains the response from method ApplicationsClient.CreateOrUpdate. +// ApplicationsClientCreateOrUpdateResponse contains the response from method ApplicationsClient.BeginCreateOrUpdate. type ApplicationsClientCreateOrUpdateResponse struct { ApplicationResource } -// ApplicationsClientDeleteResponse contains the response from method ApplicationsClient.Delete. +// ApplicationsClientDeleteResponse contains the response from method ApplicationsClient.BeginDelete. type ApplicationsClientDeleteResponse struct { // placeholder for future response values } @@ -68,7 +69,7 @@ type ApplicationsClientListResponse struct { ApplicationResourceList } -// ApplicationsClientUpdateResponse contains the response from method ApplicationsClient.Update. +// ApplicationsClientUpdateResponse contains the response from method ApplicationsClient.BeginUpdate. type ApplicationsClientUpdateResponse struct { ApplicationResource } @@ -93,7 +94,7 @@ type ClusterVersionsClientListResponse struct { ClusterCodeVersionsListResult } -// ClustersClientCreateOrUpdateResponse contains the response from method ClustersClient.CreateOrUpdate. +// ClustersClientCreateOrUpdateResponse contains the response from method ClustersClient.BeginCreateOrUpdate. type ClustersClientCreateOrUpdateResponse struct { Cluster } @@ -123,22 +124,22 @@ type ClustersClientListUpgradableVersionsResponse struct { UpgradableVersionPathResult } -// ClustersClientUpdateResponse contains the response from method ClustersClient.Update. +// ClustersClientUpdateResponse contains the response from method ClustersClient.BeginUpdate. type ClustersClientUpdateResponse struct { Cluster } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } -// ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.CreateOrUpdate. +// ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { ServiceResource } -// ServicesClientDeleteResponse contains the response from method ServicesClient.Delete. +// ServicesClientDeleteResponse contains the response from method ServicesClient.BeginDelete. type ServicesClientDeleteResponse struct { // placeholder for future response values } @@ -153,7 +154,7 @@ type ServicesClientListResponse struct { ServiceResourceList } -// ServicesClientUpdateResponse contains the response from method ServicesClient.Update. +// ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. type ServicesClientUpdateResponse struct { ServiceResource } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_services_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/services_client.go similarity index 88% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_services_client.go rename to sdk/resourcemanager/servicefabric/armservicefabric/services_client.go index f6ff824093ed..742c006a294e 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_services_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/services_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 armservicefabric @@ -31,9 +32,9 @@ type ServicesClient struct { } // NewServicesClient creates a new instance of ServicesClient 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 NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a Service Fabric service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. -// parameters - The service resource. -// options - ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. +// - parameters - The service resource. +// - options - ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate +// method. func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServicesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters, options) @@ -78,6 +80,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a Service Fabric service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters, options) @@ -130,12 +133,13 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a Service Fabric service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. -// options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. +// - options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*runtime.Poller[ServicesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, applicationName, serviceName, options) @@ -150,6 +154,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a Service Fabric service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, options) @@ -203,12 +208,13 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a Service Fabric service resource created or in the process of being created in the Service Fabric application // resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. -// options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. +// - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, options) if err != nil { @@ -269,11 +275,12 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // List - Gets all service resources created or in the process of being created in the Service Fabric application resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// options - ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - options - ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. func (client *ServicesClient) List(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ServicesClientListOptions) (ServicesClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) if err != nil { @@ -330,13 +337,14 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC // BeginUpdate - Update a Service Fabric service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceGroupName - The name of the resource group. -// clusterName - The name of the cluster resource. -// applicationName - The name of the application resource. -// serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. -// parameters - The service resource for patch operations. -// options - ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. +// - resourceGroupName - The name of the resource group. +// - clusterName - The name of the cluster resource. +// - applicationName - The name of the application resource. +// - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. +// - parameters - The service resource for patch operations. +// - options - ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResourceUpdate, options *ServicesClientBeginUpdateOptions) (*runtime.Poller[ServicesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters, options) @@ -351,6 +359,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update a Service Fabric service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResourceUpdate, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters, options) diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_time_rfc3339.go b/sdk/resourcemanager/servicefabric/armservicefabric/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/servicefabric/armservicefabric/time_rfc3339.go index 84fc848b9437..1f3ad56ee4ae 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/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 armservicefabric @@ -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/servicefabric/armservicefabric/ze_generated_example_applications_client_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applications_client_test.go deleted file mode 100644 index a7890287bb44..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applications_client_test.go +++ /dev/null @@ -1,195 +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 armservicefabric_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/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationGetOperation_example.json -func ExampleApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resRg", - "myCluster", - "myApp", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationPutOperation_example_max.json -func ExampleApplicationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resRg", - "myCluster", - "myApp", - armservicefabric.ApplicationResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationResourceProperties{ - MaximumNodes: to.Ptr[int64](3), - Metrics: []*armservicefabric.ApplicationMetricDescription{ - { - Name: to.Ptr("metric1"), - MaximumCapacity: to.Ptr[int64](3), - ReservationCapacity: to.Ptr[int64](1), - TotalApplicationCapacity: to.Ptr[int64](5), - }}, - MinimumNodes: to.Ptr[int64](1), - Parameters: map[string]*string{ - "param1": to.Ptr("value1"), - }, - RemoveApplicationCapacity: to.Ptr(false), - TypeVersion: to.Ptr("1.0"), - UpgradePolicy: &armservicefabric.ApplicationUpgradePolicy{ - ApplicationHealthPolicy: &armservicefabric.ArmApplicationHealthPolicy{ - ConsiderWarningAsError: to.Ptr(true), - DefaultServiceTypeHealthPolicy: &armservicefabric.ArmServiceTypeHealthPolicy{ - MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), - MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), - MaxPercentUnhealthyServices: to.Ptr[int32](0), - }, - MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), - }, - ForceRestart: to.Ptr(false), - RollingUpgradeMonitoringPolicy: &armservicefabric.ArmRollingUpgradeMonitoringPolicy{ - FailureAction: to.Ptr(armservicefabric.ArmUpgradeFailureActionRollback), - HealthCheckRetryTimeout: to.Ptr("00:10:00"), - HealthCheckStableDuration: to.Ptr("00:05:00"), - HealthCheckWaitDuration: to.Ptr("00:02:00"), - UpgradeDomainTimeout: to.Ptr("1.06:00:00"), - UpgradeTimeout: to.Ptr("01:00:00"), - }, - UpgradeMode: to.Ptr(armservicefabric.RollingUpgradeModeMonitored), - UpgradeReplicaSetCheckTimeout: to.Ptr("01:00:00"), - }, - TypeName: to.Ptr("myAppType"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationPatchOperation_example.json -func ExampleApplicationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resRg", - "myCluster", - "myApp", - armservicefabric.ApplicationResourceUpdate{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationResourceUpdateProperties{ - Metrics: []*armservicefabric.ApplicationMetricDescription{ - { - Name: to.Ptr("metric1"), - MaximumCapacity: to.Ptr[int64](3), - ReservationCapacity: to.Ptr[int64](1), - TotalApplicationCapacity: to.Ptr[int64](5), - }}, - RemoveApplicationCapacity: to.Ptr(false), - TypeVersion: to.Ptr("1.0"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationDeleteOperation_example.json -func ExampleApplicationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resRg", - "myCluster", - "myApp", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationListOperation_example.json -func ExampleApplicationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "resRg", - "myCluster", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applicationtypes_client_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applicationtypes_client_test.go deleted file mode 100644 index 6f92e038a653..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applicationtypes_client_test.go +++ /dev/null @@ -1,113 +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 armservicefabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNameGetOperation_example.json -func ExampleApplicationTypesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resRg", - "myCluster", - "myAppType", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNamePutOperation_example.json -func ExampleApplicationTypesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "resRg", - "myCluster", - "myAppType", - armservicefabric.ApplicationTypeResource{ - Tags: map[string]*string{}, - }, - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNameDeleteOperation_example.json -func ExampleApplicationTypesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resRg", - "myCluster", - "myAppType", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNameListOperation_example.json -func ExampleApplicationTypesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "resRg", - "myCluster", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applicationtypeversions_client_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applicationtypeversions_client_test.go deleted file mode 100644 index d82495d89211..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_applicationtypeversions_client_test.go +++ /dev/null @@ -1,123 +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 armservicefabric_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/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionGetOperation_example.json -func ExampleApplicationTypeVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypeVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resRg", - "myCluster", - "myAppType", - "1.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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionPutOperation_example.json -func ExampleApplicationTypeVersionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypeVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resRg", - "myCluster", - "myAppType", - "1.0", - armservicefabric.ApplicationTypeVersionResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationTypeVersionResourceProperties{ - AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionDeleteOperation_example.json -func ExampleApplicationTypeVersionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypeVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resRg", - "myCluster", - "myAppType", - "1.0", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionListOperation_example.json -func ExampleApplicationTypeVersionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewApplicationTypeVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "resRg", - "myCluster", - "myAppType", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_clusters_client_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_clusters_client_test.go deleted file mode 100644 index 9e9b92c948a8..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_clusters_client_test.go +++ /dev/null @@ -1,395 +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 armservicefabric_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterGetOperation_example.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resRg", - "myCluster", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterPutOperation_example_max.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resRg", - "myCluster", - armservicefabric.Cluster{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{}, - Properties: &armservicefabric.ClusterProperties{ - AddOnFeatures: []*armservicefabric.AddOnFeatures{ - to.Ptr(armservicefabric.AddOnFeaturesRepairManager), - to.Ptr(armservicefabric.AddOnFeaturesDNSService), - to.Ptr(armservicefabric.AddOnFeaturesBackupRestoreService), - to.Ptr(armservicefabric.AddOnFeaturesResourceMonitorService)}, - ApplicationTypeVersionsCleanupPolicy: &armservicefabric.ApplicationTypeVersionsCleanupPolicy{ - MaxUnusedVersionsToKeep: to.Ptr[int64](2), - }, - AzureActiveDirectory: &armservicefabric.AzureActiveDirectory{ - ClientApplication: to.Ptr("d151ad89-4bce-4ae8-b3d1-1dc79679fa75"), - ClusterApplication: to.Ptr("5886372e-7bf4-4878-a497-8098aba608ae"), - TenantID: to.Ptr("6abcc6a0-8666-43f1-87b8-172cf86a9f9c"), - }, - CertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - CommonNames: []*armservicefabric.ServerCertificateCommonName{ - { - CertificateCommonName: to.Ptr("abc.com"), - CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - }}, - X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - }, - ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - { - CertificateCommonName: to.Ptr("abc.com"), - CertificateIssuerThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - IsAdmin: to.Ptr(true), - }}, - ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - { - CertificateThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - IsAdmin: to.Ptr(true), - }}, - ClusterCodeVersion: to.Ptr("7.0.470.9590"), - DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - StorageAccountName: to.Ptr("diag"), - TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - }, - EventStoreServiceEnabled: to.Ptr(true), - FabricSettings: []*armservicefabric.SettingsSectionDescription{ - { - Name: to.Ptr("UpgradeService"), - Parameters: []*armservicefabric.SettingsParameterDescription{ - { - Name: to.Ptr("AppPollIntervalInSeconds"), - Value: to.Ptr("60"), - }}, - }}, - InfrastructureServiceManager: to.Ptr(true), - ManagementEndpoint: to.Ptr("https://myCluster.eastus.cloudapp.azure.com:19080"), - NodeTypes: []*armservicefabric.NodeTypeDescription{ - { - Name: to.Ptr("nt1vm"), - ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](30000), - StartPort: to.Ptr[int32](20000), - }, - ClientConnectionEndpointPort: to.Ptr[int32](19000), - DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelSilver), - EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](64000), - StartPort: to.Ptr[int32](49000), - }, - HTTPGatewayEndpointPort: to.Ptr[int32](19007), - IsPrimary: to.Ptr(true), - IsStateless: to.Ptr(false), - MultipleAvailabilityZones: to.Ptr(true), - VMInstanceCount: to.Ptr[int32](5), - }}, - Notifications: []*armservicefabric.Notification{ - { - IsEnabled: to.Ptr(true), - NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - NotificationLevel: to.Ptr(armservicefabric.NotificationLevelCritical), - NotificationTargets: []*armservicefabric.NotificationTarget{ - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - Receivers: []*string{ - to.Ptr("****@microsoft.com"), - to.Ptr("****@microsoft.com")}, - }, - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - Receivers: []*string{ - to.Ptr("Owner"), - to.Ptr("AccountAdmin")}, - }}, - }, - { - IsEnabled: to.Ptr(true), - NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - NotificationLevel: to.Ptr(armservicefabric.NotificationLevelAll), - NotificationTargets: []*armservicefabric.NotificationTarget{ - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - Receivers: []*string{ - to.Ptr("****@microsoft.com"), - to.Ptr("****@microsoft.com")}, - }, - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - Receivers: []*string{ - to.Ptr("Owner"), - to.Ptr("AccountAdmin")}, - }}, - }}, - ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelPlatinum), - ReverseProxyCertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - CommonNames: []*armservicefabric.ServerCertificateCommonName{ - { - CertificateCommonName: to.Ptr("abc.com"), - CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - }}, - X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - }, - SfZonalUpgradeMode: to.Ptr(armservicefabric.SfZonalUpgradeModeHierarchical), - UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - ApplicationDeltaHealthPolicies: map[string]*armservicefabric.ApplicationDeltaHealthPolicy{ - "fabric:/myApp1": { - DefaultServiceTypeDeltaHealthPolicy: &armservicefabric.ServiceTypeDeltaHealthPolicy{ - MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - }, - ServiceTypeDeltaHealthPolicies: map[string]*armservicefabric.ServiceTypeDeltaHealthPolicy{ - "myServiceType1": { - MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - }, - }, - }, - }, - MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - }, - ForceRestart: to.Ptr(false), - HealthCheckRetryTimeout: to.Ptr("00:05:00"), - HealthCheckStableDuration: to.Ptr("00:00:30"), - HealthCheckWaitDuration: to.Ptr("00:00:30"), - HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - ApplicationHealthPolicies: map[string]*armservicefabric.ApplicationHealthPolicy{ - "fabric:/myApp1": { - DefaultServiceTypeHealthPolicy: &armservicefabric.ServiceTypeHealthPolicy{ - MaxPercentUnhealthyServices: to.Ptr[int32](0), - }, - ServiceTypeHealthPolicies: map[string]*armservicefabric.ServiceTypeHealthPolicy{ - "myServiceType1": { - MaxPercentUnhealthyServices: to.Ptr[int32](100), - }, - }, - }, - }, - MaxPercentUnhealthyApplications: to.Ptr[int32](0), - MaxPercentUnhealthyNodes: to.Ptr[int32](0), - }, - UpgradeDomainTimeout: to.Ptr("00:15:00"), - UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - UpgradeTimeout: to.Ptr("01:00:00"), - }, - UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - UpgradePauseEndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-25T22:00:00Z"); return t }()), - UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00Z"); return t }()), - UpgradeWave: to.Ptr(armservicefabric.ClusterUpgradeCadenceWave1), - VMImage: to.Ptr("Windows"), - VmssZonalUpgradeMode: to.Ptr(armservicefabric.VmssZonalUpgradeModeParallel), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterPatchOperation_example.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resRg", - "myCluster", - armservicefabric.ClusterUpdateParameters{ - Properties: &armservicefabric.ClusterPropertiesUpdateParameters{ - EventStoreServiceEnabled: to.Ptr(true), - NodeTypes: []*armservicefabric.NodeTypeDescription{ - { - Name: to.Ptr("nt1vm"), - ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](30000), - StartPort: to.Ptr[int32](20000), - }, - ClientConnectionEndpointPort: to.Ptr[int32](19000), - DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](64000), - StartPort: to.Ptr[int32](49000), - }, - HTTPGatewayEndpointPort: to.Ptr[int32](19007), - IsPrimary: to.Ptr(true), - VMInstanceCount: to.Ptr[int32](5), - }, - { - Name: to.Ptr("testnt1"), - ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](2000), - StartPort: to.Ptr[int32](1000), - }, - ClientConnectionEndpointPort: to.Ptr[int32](0), - DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](4000), - StartPort: to.Ptr[int32](3000), - }, - HTTPGatewayEndpointPort: to.Ptr[int32](0), - IsPrimary: to.Ptr(false), - VMInstanceCount: to.Ptr[int32](3), - }}, - ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelBronze), - UpgradeMode: to.Ptr(armservicefabric.UpgradeModeAutomatic), - UpgradePauseEndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-25T22:00:00Z"); return t }()), - UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00Z"); return t }()), - UpgradeWave: to.Ptr(armservicefabric.ClusterUpgradeCadence("Wave")), - }, - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterDeleteOperation_example.json -func ExampleClustersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "resRg", - "myCluster", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterListByResourceGroupOperation_example.json -func ExampleClustersClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByResourceGroup(ctx, - "resRg", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterListOperation_example.json -func ExampleClustersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ListUpgradableVersionsMinMax_example.json -func ExampleClustersClient_ListUpgradableVersions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListUpgradableVersions(ctx, - "resRg", - "myCluster", - &armservicefabric.ClustersClientListUpgradableVersionsOptions{VersionsDescription: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_clusterversions_client_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_clusterversions_client_test.go deleted file mode 100644 index 393412ba5573..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_clusterversions_client_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armservicefabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsGet_example.json -func ExampleClusterVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClusterVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "eastus", - "6.1.480.9494", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsGetByEnvironment_example.json -func ExampleClusterVersionsClient_GetByEnvironment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClusterVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByEnvironment(ctx, - "eastus", - armservicefabric.ClusterVersionsEnvironmentWindows, - "6.1.480.9494", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsList_example.json -func ExampleClusterVersionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClusterVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "eastus", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsListByEnvironment.json -func ExampleClusterVersionsClient_ListByEnvironment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewClusterVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByEnvironment(ctx, - "eastus", - armservicefabric.ClusterVersionsEnvironmentWindows, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_operations_client_test.go deleted file mode 100644 index 708de59f2934..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +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 armservicefabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(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/servicefabric/armservicefabric/ze_generated_example_services_client_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_services_client_test.go deleted file mode 100644 index c16010fc57d9..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/ze_generated_example_services_client_test.go +++ /dev/null @@ -1,180 +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 armservicefabric_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/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServiceGetOperation_example.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resRg", - "myCluster", - "myApp", - "myService", - 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/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServicePutOperation_example_max.json -func ExampleServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resRg", - "myCluster", - "myApp", - "myService", - armservicefabric.ServiceResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.StatelessServiceProperties{ - CorrelationScheme: []*armservicefabric.ServiceCorrelationDescription{ - { - Scheme: to.Ptr(armservicefabric.ServiceCorrelationSchemeAffinity), - ServiceName: to.Ptr("fabric:/app1/app1~svc1"), - }}, - DefaultMoveCost: to.Ptr(armservicefabric.MoveCostMedium), - PlacementConstraints: to.Ptr("NodeType==frontend"), - ServiceLoadMetrics: []*armservicefabric.ServiceLoadMetricDescription{ - { - Name: to.Ptr("metric1"), - Weight: to.Ptr(armservicefabric.ServiceLoadMetricWeightLow), - }}, - ServicePlacementPolicies: []armservicefabric.ServicePlacementPolicyDescriptionClassification{}, - PartitionDescription: &armservicefabric.SingletonPartitionSchemeDescription{ - PartitionScheme: to.Ptr(armservicefabric.PartitionSchemeSingleton), - }, - ServiceDNSName: to.Ptr("my.service.dns"), - ServiceKind: to.Ptr(armservicefabric.ServiceKindStateless), - ServicePackageActivationMode: to.Ptr(armservicefabric.ArmServicePackageActivationModeSharedProcess), - ServiceTypeName: to.Ptr("myServiceType"), - InstanceCount: to.Ptr[int32](5), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServicePatchOperation_example.json -func ExampleServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resRg", - "myCluster", - "myApp", - "myService", - armservicefabric.ServiceResourceUpdate{ - Tags: map[string]*string{}, - Properties: &armservicefabric.StatelessServiceUpdateProperties{ - ServiceLoadMetrics: []*armservicefabric.ServiceLoadMetricDescription{ - { - Name: to.Ptr("metric1"), - Weight: to.Ptr(armservicefabric.ServiceLoadMetricWeightLow), - }}, - ServiceKind: to.Ptr(armservicefabric.ServiceKindStateless), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServiceDeleteOperation_example.json -func ExampleServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "resRg", - "myCluster", - "myApp", - "myService", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServiceListOperation_example.json -func ExampleServicesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicefabric.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "resRg", - "myCluster", - "myApp", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_models_serde.go b/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_models_serde.go deleted file mode 100644 index 1869f9a0b2dd..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/zz_generated_models_serde.go +++ /dev/null @@ -1,1253 +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 armservicefabric - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ApplicationDeltaHealthPolicy. -func (a ApplicationDeltaHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultServiceTypeDeltaHealthPolicy", a.DefaultServiceTypeDeltaHealthPolicy) - populate(objectMap, "serviceTypeDeltaHealthPolicies", a.ServiceTypeDeltaHealthPolicies) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationHealthPolicy. -func (a ApplicationHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultServiceTypeHealthPolicy", a.DefaultServiceTypeHealthPolicy) - populate(objectMap, "serviceTypeHealthPolicies", a.ServiceTypeHealthPolicies) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationResource. -func (a ApplicationResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - 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, "managedIdentities", a.ManagedIdentities) - populate(objectMap, "maximumNodes", a.MaximumNodes) - populate(objectMap, "metrics", a.Metrics) - populate(objectMap, "minimumNodes", a.MinimumNodes) - populate(objectMap, "parameters", a.Parameters) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "removeApplicationCapacity", a.RemoveApplicationCapacity) - populate(objectMap, "typeName", a.TypeName) - populate(objectMap, "typeVersion", a.TypeVersion) - populate(objectMap, "upgradePolicy", a.UpgradePolicy) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceUpdate. -func (a ApplicationResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceUpdateProperties. -func (a ApplicationResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "managedIdentities", a.ManagedIdentities) - populate(objectMap, "maximumNodes", a.MaximumNodes) - populate(objectMap, "metrics", a.Metrics) - populate(objectMap, "minimumNodes", a.MinimumNodes) - populate(objectMap, "parameters", a.Parameters) - populate(objectMap, "removeApplicationCapacity", a.RemoveApplicationCapacity) - populate(objectMap, "typeVersion", a.TypeVersion) - populate(objectMap, "upgradePolicy", a.UpgradePolicy) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationTypeResource. -func (a ApplicationTypeResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationTypeVersionResource. -func (a ApplicationTypeVersionResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationTypeVersionResourceProperties. -func (a ApplicationTypeVersionResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appPackageUrl", a.AppPackageURL) - populate(objectMap, "defaultParameterList", a.DefaultParameterList) - populate(objectMap, "provisioningState", a.ProvisioningState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ArmApplicationHealthPolicy. -func (a ArmApplicationHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "considerWarningAsError", a.ConsiderWarningAsError) - populate(objectMap, "defaultServiceTypeHealthPolicy", a.DefaultServiceTypeHealthPolicy) - populate(objectMap, "maxPercentUnhealthyDeployedApplications", a.MaxPercentUnhealthyDeployedApplications) - populate(objectMap, "serviceTypeHealthPolicyMap", a.ServiceTypeHealthPolicyMap) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterHealthPolicy. -func (c ClusterHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationHealthPolicies", c.ApplicationHealthPolicies) - populate(objectMap, "maxPercentUnhealthyApplications", c.MaxPercentUnhealthyApplications) - populate(objectMap, "maxPercentUnhealthyNodes", c.MaxPercentUnhealthyNodes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterProperties. -func (c ClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addOnFeatures", c.AddOnFeatures) - populate(objectMap, "applicationTypeVersionsCleanupPolicy", c.ApplicationTypeVersionsCleanupPolicy) - populate(objectMap, "availableClusterVersions", c.AvailableClusterVersions) - populate(objectMap, "azureActiveDirectory", c.AzureActiveDirectory) - populate(objectMap, "certificate", c.Certificate) - populate(objectMap, "certificateCommonNames", c.CertificateCommonNames) - populate(objectMap, "clientCertificateCommonNames", c.ClientCertificateCommonNames) - populate(objectMap, "clientCertificateThumbprints", c.ClientCertificateThumbprints) - populate(objectMap, "clusterCodeVersion", c.ClusterCodeVersion) - populate(objectMap, "clusterEndpoint", c.ClusterEndpoint) - populate(objectMap, "clusterId", c.ClusterID) - populate(objectMap, "clusterState", c.ClusterState) - populate(objectMap, "diagnosticsStorageAccountConfig", c.DiagnosticsStorageAccountConfig) - populate(objectMap, "eventStoreServiceEnabled", c.EventStoreServiceEnabled) - populate(objectMap, "fabricSettings", c.FabricSettings) - populate(objectMap, "infrastructureServiceManager", c.InfrastructureServiceManager) - populate(objectMap, "managementEndpoint", c.ManagementEndpoint) - populate(objectMap, "nodeTypes", c.NodeTypes) - populate(objectMap, "notifications", c.Notifications) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "reliabilityLevel", c.ReliabilityLevel) - populate(objectMap, "reverseProxyCertificate", c.ReverseProxyCertificate) - populate(objectMap, "reverseProxyCertificateCommonNames", c.ReverseProxyCertificateCommonNames) - populate(objectMap, "sfZonalUpgradeMode", c.SfZonalUpgradeMode) - populate(objectMap, "upgradeDescription", c.UpgradeDescription) - populate(objectMap, "upgradeMode", c.UpgradeMode) - populateTimeRFC3339(objectMap, "upgradePauseEndTimestampUtc", c.UpgradePauseEndTimestampUTC) - populateTimeRFC3339(objectMap, "upgradePauseStartTimestampUtc", c.UpgradePauseStartTimestampUTC) - populate(objectMap, "upgradeWave", c.UpgradeWave) - populate(objectMap, "vmImage", c.VMImage) - populate(objectMap, "vmssZonalUpgradeMode", c.VmssZonalUpgradeMode) - populate(objectMap, "waveUpgradePaused", c.WaveUpgradePaused) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. -func (c *ClusterProperties) 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 "addOnFeatures": - err = unpopulate(val, "AddOnFeatures", &c.AddOnFeatures) - delete(rawMsg, key) - case "applicationTypeVersionsCleanupPolicy": - err = unpopulate(val, "ApplicationTypeVersionsCleanupPolicy", &c.ApplicationTypeVersionsCleanupPolicy) - delete(rawMsg, key) - case "availableClusterVersions": - err = unpopulate(val, "AvailableClusterVersions", &c.AvailableClusterVersions) - delete(rawMsg, key) - case "azureActiveDirectory": - err = unpopulate(val, "AzureActiveDirectory", &c.AzureActiveDirectory) - delete(rawMsg, key) - case "certificate": - err = unpopulate(val, "Certificate", &c.Certificate) - delete(rawMsg, key) - case "certificateCommonNames": - err = unpopulate(val, "CertificateCommonNames", &c.CertificateCommonNames) - delete(rawMsg, key) - case "clientCertificateCommonNames": - err = unpopulate(val, "ClientCertificateCommonNames", &c.ClientCertificateCommonNames) - delete(rawMsg, key) - case "clientCertificateThumbprints": - err = unpopulate(val, "ClientCertificateThumbprints", &c.ClientCertificateThumbprints) - delete(rawMsg, key) - case "clusterCodeVersion": - err = unpopulate(val, "ClusterCodeVersion", &c.ClusterCodeVersion) - delete(rawMsg, key) - case "clusterEndpoint": - err = unpopulate(val, "ClusterEndpoint", &c.ClusterEndpoint) - delete(rawMsg, key) - case "clusterId": - err = unpopulate(val, "ClusterID", &c.ClusterID) - delete(rawMsg, key) - case "clusterState": - err = unpopulate(val, "ClusterState", &c.ClusterState) - delete(rawMsg, key) - case "diagnosticsStorageAccountConfig": - err = unpopulate(val, "DiagnosticsStorageAccountConfig", &c.DiagnosticsStorageAccountConfig) - delete(rawMsg, key) - case "eventStoreServiceEnabled": - err = unpopulate(val, "EventStoreServiceEnabled", &c.EventStoreServiceEnabled) - delete(rawMsg, key) - case "fabricSettings": - err = unpopulate(val, "FabricSettings", &c.FabricSettings) - delete(rawMsg, key) - case "infrastructureServiceManager": - err = unpopulate(val, "InfrastructureServiceManager", &c.InfrastructureServiceManager) - delete(rawMsg, key) - case "managementEndpoint": - err = unpopulate(val, "ManagementEndpoint", &c.ManagementEndpoint) - delete(rawMsg, key) - case "nodeTypes": - err = unpopulate(val, "NodeTypes", &c.NodeTypes) - delete(rawMsg, key) - case "notifications": - err = unpopulate(val, "Notifications", &c.Notifications) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "reliabilityLevel": - err = unpopulate(val, "ReliabilityLevel", &c.ReliabilityLevel) - delete(rawMsg, key) - case "reverseProxyCertificate": - err = unpopulate(val, "ReverseProxyCertificate", &c.ReverseProxyCertificate) - delete(rawMsg, key) - case "reverseProxyCertificateCommonNames": - err = unpopulate(val, "ReverseProxyCertificateCommonNames", &c.ReverseProxyCertificateCommonNames) - delete(rawMsg, key) - case "sfZonalUpgradeMode": - err = unpopulate(val, "SfZonalUpgradeMode", &c.SfZonalUpgradeMode) - delete(rawMsg, key) - case "upgradeDescription": - err = unpopulate(val, "UpgradeDescription", &c.UpgradeDescription) - delete(rawMsg, key) - case "upgradeMode": - err = unpopulate(val, "UpgradeMode", &c.UpgradeMode) - delete(rawMsg, key) - case "upgradePauseEndTimestampUtc": - err = unpopulateTimeRFC3339(val, "UpgradePauseEndTimestampUTC", &c.UpgradePauseEndTimestampUTC) - delete(rawMsg, key) - case "upgradePauseStartTimestampUtc": - err = unpopulateTimeRFC3339(val, "UpgradePauseStartTimestampUTC", &c.UpgradePauseStartTimestampUTC) - delete(rawMsg, key) - case "upgradeWave": - err = unpopulate(val, "UpgradeWave", &c.UpgradeWave) - delete(rawMsg, key) - case "vmImage": - err = unpopulate(val, "VMImage", &c.VMImage) - delete(rawMsg, key) - case "vmssZonalUpgradeMode": - err = unpopulate(val, "VmssZonalUpgradeMode", &c.VmssZonalUpgradeMode) - delete(rawMsg, key) - case "waveUpgradePaused": - err = unpopulate(val, "WaveUpgradePaused", &c.WaveUpgradePaused) - 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 ClusterPropertiesUpdateParameters. -func (c ClusterPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addOnFeatures", c.AddOnFeatures) - populate(objectMap, "applicationTypeVersionsCleanupPolicy", c.ApplicationTypeVersionsCleanupPolicy) - populate(objectMap, "certificate", c.Certificate) - populate(objectMap, "certificateCommonNames", c.CertificateCommonNames) - populate(objectMap, "clientCertificateCommonNames", c.ClientCertificateCommonNames) - populate(objectMap, "clientCertificateThumbprints", c.ClientCertificateThumbprints) - populate(objectMap, "clusterCodeVersion", c.ClusterCodeVersion) - populate(objectMap, "eventStoreServiceEnabled", c.EventStoreServiceEnabled) - populate(objectMap, "fabricSettings", c.FabricSettings) - populate(objectMap, "infrastructureServiceManager", c.InfrastructureServiceManager) - populate(objectMap, "nodeTypes", c.NodeTypes) - populate(objectMap, "notifications", c.Notifications) - populate(objectMap, "reliabilityLevel", c.ReliabilityLevel) - populate(objectMap, "reverseProxyCertificate", c.ReverseProxyCertificate) - populate(objectMap, "sfZonalUpgradeMode", c.SfZonalUpgradeMode) - populate(objectMap, "upgradeDescription", c.UpgradeDescription) - populate(objectMap, "upgradeMode", c.UpgradeMode) - populateTimeRFC3339(objectMap, "upgradePauseEndTimestampUtc", c.UpgradePauseEndTimestampUTC) - populateTimeRFC3339(objectMap, "upgradePauseStartTimestampUtc", c.UpgradePauseStartTimestampUTC) - populate(objectMap, "upgradeWave", c.UpgradeWave) - populate(objectMap, "vmssZonalUpgradeMode", c.VmssZonalUpgradeMode) - populate(objectMap, "waveUpgradePaused", c.WaveUpgradePaused) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPropertiesUpdateParameters. -func (c *ClusterPropertiesUpdateParameters) 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 "addOnFeatures": - err = unpopulate(val, "AddOnFeatures", &c.AddOnFeatures) - delete(rawMsg, key) - case "applicationTypeVersionsCleanupPolicy": - err = unpopulate(val, "ApplicationTypeVersionsCleanupPolicy", &c.ApplicationTypeVersionsCleanupPolicy) - delete(rawMsg, key) - case "certificate": - err = unpopulate(val, "Certificate", &c.Certificate) - delete(rawMsg, key) - case "certificateCommonNames": - err = unpopulate(val, "CertificateCommonNames", &c.CertificateCommonNames) - delete(rawMsg, key) - case "clientCertificateCommonNames": - err = unpopulate(val, "ClientCertificateCommonNames", &c.ClientCertificateCommonNames) - delete(rawMsg, key) - case "clientCertificateThumbprints": - err = unpopulate(val, "ClientCertificateThumbprints", &c.ClientCertificateThumbprints) - delete(rawMsg, key) - case "clusterCodeVersion": - err = unpopulate(val, "ClusterCodeVersion", &c.ClusterCodeVersion) - delete(rawMsg, key) - case "eventStoreServiceEnabled": - err = unpopulate(val, "EventStoreServiceEnabled", &c.EventStoreServiceEnabled) - delete(rawMsg, key) - case "fabricSettings": - err = unpopulate(val, "FabricSettings", &c.FabricSettings) - delete(rawMsg, key) - case "infrastructureServiceManager": - err = unpopulate(val, "InfrastructureServiceManager", &c.InfrastructureServiceManager) - delete(rawMsg, key) - case "nodeTypes": - err = unpopulate(val, "NodeTypes", &c.NodeTypes) - delete(rawMsg, key) - case "notifications": - err = unpopulate(val, "Notifications", &c.Notifications) - delete(rawMsg, key) - case "reliabilityLevel": - err = unpopulate(val, "ReliabilityLevel", &c.ReliabilityLevel) - delete(rawMsg, key) - case "reverseProxyCertificate": - err = unpopulate(val, "ReverseProxyCertificate", &c.ReverseProxyCertificate) - delete(rawMsg, key) - case "sfZonalUpgradeMode": - err = unpopulate(val, "SfZonalUpgradeMode", &c.SfZonalUpgradeMode) - delete(rawMsg, key) - case "upgradeDescription": - err = unpopulate(val, "UpgradeDescription", &c.UpgradeDescription) - delete(rawMsg, key) - case "upgradeMode": - err = unpopulate(val, "UpgradeMode", &c.UpgradeMode) - delete(rawMsg, key) - case "upgradePauseEndTimestampUtc": - err = unpopulateTimeRFC3339(val, "UpgradePauseEndTimestampUTC", &c.UpgradePauseEndTimestampUTC) - delete(rawMsg, key) - case "upgradePauseStartTimestampUtc": - err = unpopulateTimeRFC3339(val, "UpgradePauseStartTimestampUTC", &c.UpgradePauseStartTimestampUTC) - delete(rawMsg, key) - case "upgradeWave": - err = unpopulate(val, "UpgradeWave", &c.UpgradeWave) - delete(rawMsg, key) - case "vmssZonalUpgradeMode": - err = unpopulate(val, "VmssZonalUpgradeMode", &c.VmssZonalUpgradeMode) - delete(rawMsg, key) - case "waveUpgradePaused": - err = unpopulate(val, "WaveUpgradePaused", &c.WaveUpgradePaused) - 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 ClusterUpdateParameters. -func (c ClusterUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterUpgradeDeltaHealthPolicy. -func (c ClusterUpgradeDeltaHealthPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationDeltaHealthPolicies", c.ApplicationDeltaHealthPolicies) - populate(objectMap, "maxPercentDeltaUnhealthyApplications", c.MaxPercentDeltaUnhealthyApplications) - populate(objectMap, "maxPercentDeltaUnhealthyNodes", c.MaxPercentDeltaUnhealthyNodes) - populate(objectMap, "maxPercentUpgradeDomainDeltaUnhealthyNodes", c.MaxPercentUpgradeDomainDeltaUnhealthyNodes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedIdentity. -func (m ManagedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NamedPartitionSchemeDescription. -func (n NamedPartitionSchemeDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "count", n.Count) - populate(objectMap, "names", n.Names) - objectMap["partitionScheme"] = PartitionSchemeNamed - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedPartitionSchemeDescription. -func (n *NamedPartitionSchemeDescription) 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 "count": - err = unpopulate(val, "Count", &n.Count) - delete(rawMsg, key) - case "names": - err = unpopulate(val, "Names", &n.Names) - delete(rawMsg, key) - case "partitionScheme": - err = unpopulate(val, "PartitionScheme", &n.PartitionScheme) - 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 NodeTypeDescription. -func (n NodeTypeDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationPorts", n.ApplicationPorts) - populate(objectMap, "capacities", n.Capacities) - populate(objectMap, "clientConnectionEndpointPort", n.ClientConnectionEndpointPort) - populate(objectMap, "durabilityLevel", n.DurabilityLevel) - populate(objectMap, "ephemeralPorts", n.EphemeralPorts) - populate(objectMap, "httpGatewayEndpointPort", n.HTTPGatewayEndpointPort) - populate(objectMap, "isPrimary", n.IsPrimary) - populate(objectMap, "isStateless", n.IsStateless) - populate(objectMap, "multipleAvailabilityZones", n.MultipleAvailabilityZones) - populate(objectMap, "name", n.Name) - populate(objectMap, "placementProperties", n.PlacementProperties) - populate(objectMap, "reverseProxyEndpointPort", n.ReverseProxyEndpointPort) - populate(objectMap, "vmInstanceCount", n.VMInstanceCount) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Notification. -func (n Notification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isEnabled", n.IsEnabled) - populate(objectMap, "notificationCategory", n.NotificationCategory) - populate(objectMap, "notificationLevel", n.NotificationLevel) - populate(objectMap, "notificationTargets", n.NotificationTargets) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NotificationTarget. -func (n NotificationTarget) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "notificationChannel", n.NotificationChannel) - populate(objectMap, "receivers", n.Receivers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", p.Etag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerCertificateCommonNames. -func (s ServerCertificateCommonNames) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "commonNames", s.CommonNames) - populate(objectMap, "x509StoreName", s.X509StoreName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceResource. -func (s ServiceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResource. -func (s *ServiceResource) 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 "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, 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 = unmarshalServiceResourcePropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceResourceProperties. -func (s ServiceResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationScheme", s.CorrelationScheme) - populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) - populate(objectMap, "partitionDescription", s.PartitionDescription) - populate(objectMap, "placementConstraints", s.PlacementConstraints) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "serviceDnsName", s.ServiceDNSName) - objectMap["serviceKind"] = s.ServiceKind - populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) - populate(objectMap, "servicePackageActivationMode", s.ServicePackageActivationMode) - populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) - populate(objectMap, "serviceTypeName", s.ServiceTypeName) - 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 "correlationScheme": - err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) - delete(rawMsg, key) - case "defaultMoveCost": - err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) - delete(rawMsg, key) - case "partitionDescription": - s.PartitionDescription, err = unmarshalPartitionSchemeDescriptionClassification(val) - delete(rawMsg, key) - case "placementConstraints": - err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "serviceDnsName": - err = unpopulate(val, "ServiceDNSName", &s.ServiceDNSName) - delete(rawMsg, key) - case "serviceKind": - err = unpopulate(val, "ServiceKind", &s.ServiceKind) - delete(rawMsg, key) - case "serviceLoadMetrics": - err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) - delete(rawMsg, key) - case "servicePackageActivationMode": - err = unpopulate(val, "ServicePackageActivationMode", &s.ServicePackageActivationMode) - delete(rawMsg, key) - case "servicePlacementPolicies": - s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) - delete(rawMsg, key) - case "serviceTypeName": - err = unpopulate(val, "ServiceTypeName", &s.ServiceTypeName) - 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 ServiceResourcePropertiesBase. -func (s ServiceResourcePropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationScheme", s.CorrelationScheme) - populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) - populate(objectMap, "placementConstraints", s.PlacementConstraints) - populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) - populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourcePropertiesBase. -func (s *ServiceResourcePropertiesBase) 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 "correlationScheme": - err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) - delete(rawMsg, key) - case "defaultMoveCost": - err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) - delete(rawMsg, key) - case "placementConstraints": - err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) - delete(rawMsg, key) - case "serviceLoadMetrics": - err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) - delete(rawMsg, key) - case "servicePlacementPolicies": - s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) - 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 ServiceResourceUpdate. -func (s ServiceResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceUpdate. -func (s *ServiceResourceUpdate) 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 "etag": - err = unpopulate(val, "Etag", &s.Etag) - delete(rawMsg, 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 = unmarshalServiceResourceUpdatePropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceResourceUpdateProperties. -func (s ServiceResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationScheme", s.CorrelationScheme) - populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) - populate(objectMap, "placementConstraints", s.PlacementConstraints) - objectMap["serviceKind"] = s.ServiceKind - populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) - populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceUpdateProperties. -func (s *ServiceResourceUpdateProperties) 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 "correlationScheme": - err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) - delete(rawMsg, key) - case "defaultMoveCost": - err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) - delete(rawMsg, key) - case "placementConstraints": - err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) - delete(rawMsg, key) - case "serviceKind": - err = unpopulate(val, "ServiceKind", &s.ServiceKind) - delete(rawMsg, key) - case "serviceLoadMetrics": - err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) - delete(rawMsg, key) - case "servicePlacementPolicies": - s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) - 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 SettingsSectionDescription. -func (s SettingsSectionDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", s.Name) - populate(objectMap, "parameters", s.Parameters) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SingletonPartitionSchemeDescription. -func (s SingletonPartitionSchemeDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["partitionScheme"] = PartitionSchemeSingleton - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SingletonPartitionSchemeDescription. -func (s *SingletonPartitionSchemeDescription) 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 "partitionScheme": - err = unpopulate(val, "PartitionScheme", &s.PartitionScheme) - 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 StatefulServiceProperties. -func (s StatefulServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationScheme", s.CorrelationScheme) - populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) - populate(objectMap, "hasPersistedState", s.HasPersistedState) - populate(objectMap, "minReplicaSetSize", s.MinReplicaSetSize) - populate(objectMap, "partitionDescription", s.PartitionDescription) - populate(objectMap, "placementConstraints", s.PlacementConstraints) - populate(objectMap, "provisioningState", s.ProvisioningState) - populateTimeRFC3339(objectMap, "quorumLossWaitDuration", s.QuorumLossWaitDuration) - populateTimeRFC3339(objectMap, "replicaRestartWaitDuration", s.ReplicaRestartWaitDuration) - populate(objectMap, "serviceDnsName", s.ServiceDNSName) - objectMap["serviceKind"] = ServiceKindStateful - populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) - populate(objectMap, "servicePackageActivationMode", s.ServicePackageActivationMode) - populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) - populate(objectMap, "serviceTypeName", s.ServiceTypeName) - populateTimeRFC3339(objectMap, "standByReplicaKeepDuration", s.StandByReplicaKeepDuration) - populate(objectMap, "targetReplicaSetSize", s.TargetReplicaSetSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StatefulServiceProperties. -func (s *StatefulServiceProperties) 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 "correlationScheme": - err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) - delete(rawMsg, key) - case "defaultMoveCost": - err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) - delete(rawMsg, key) - case "hasPersistedState": - err = unpopulate(val, "HasPersistedState", &s.HasPersistedState) - delete(rawMsg, key) - case "minReplicaSetSize": - err = unpopulate(val, "MinReplicaSetSize", &s.MinReplicaSetSize) - delete(rawMsg, key) - case "partitionDescription": - s.PartitionDescription, err = unmarshalPartitionSchemeDescriptionClassification(val) - delete(rawMsg, key) - case "placementConstraints": - err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "quorumLossWaitDuration": - err = unpopulateTimeRFC3339(val, "QuorumLossWaitDuration", &s.QuorumLossWaitDuration) - delete(rawMsg, key) - case "replicaRestartWaitDuration": - err = unpopulateTimeRFC3339(val, "ReplicaRestartWaitDuration", &s.ReplicaRestartWaitDuration) - delete(rawMsg, key) - case "serviceDnsName": - err = unpopulate(val, "ServiceDNSName", &s.ServiceDNSName) - delete(rawMsg, key) - case "serviceKind": - err = unpopulate(val, "ServiceKind", &s.ServiceKind) - delete(rawMsg, key) - case "serviceLoadMetrics": - err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) - delete(rawMsg, key) - case "servicePackageActivationMode": - err = unpopulate(val, "ServicePackageActivationMode", &s.ServicePackageActivationMode) - delete(rawMsg, key) - case "servicePlacementPolicies": - s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) - delete(rawMsg, key) - case "serviceTypeName": - err = unpopulate(val, "ServiceTypeName", &s.ServiceTypeName) - delete(rawMsg, key) - case "standByReplicaKeepDuration": - err = unpopulateTimeRFC3339(val, "StandByReplicaKeepDuration", &s.StandByReplicaKeepDuration) - delete(rawMsg, key) - case "targetReplicaSetSize": - err = unpopulate(val, "TargetReplicaSetSize", &s.TargetReplicaSetSize) - 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 StatefulServiceUpdateProperties. -func (s StatefulServiceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationScheme", s.CorrelationScheme) - populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) - populate(objectMap, "minReplicaSetSize", s.MinReplicaSetSize) - populate(objectMap, "placementConstraints", s.PlacementConstraints) - populateTimeRFC3339(objectMap, "quorumLossWaitDuration", s.QuorumLossWaitDuration) - populateTimeRFC3339(objectMap, "replicaRestartWaitDuration", s.ReplicaRestartWaitDuration) - objectMap["serviceKind"] = ServiceKindStateful - populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) - populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) - populateTimeRFC3339(objectMap, "standByReplicaKeepDuration", s.StandByReplicaKeepDuration) - populate(objectMap, "targetReplicaSetSize", s.TargetReplicaSetSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StatefulServiceUpdateProperties. -func (s *StatefulServiceUpdateProperties) 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 "correlationScheme": - err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) - delete(rawMsg, key) - case "defaultMoveCost": - err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) - delete(rawMsg, key) - case "minReplicaSetSize": - err = unpopulate(val, "MinReplicaSetSize", &s.MinReplicaSetSize) - delete(rawMsg, key) - case "placementConstraints": - err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) - delete(rawMsg, key) - case "quorumLossWaitDuration": - err = unpopulateTimeRFC3339(val, "QuorumLossWaitDuration", &s.QuorumLossWaitDuration) - delete(rawMsg, key) - case "replicaRestartWaitDuration": - err = unpopulateTimeRFC3339(val, "ReplicaRestartWaitDuration", &s.ReplicaRestartWaitDuration) - delete(rawMsg, key) - case "serviceKind": - err = unpopulate(val, "ServiceKind", &s.ServiceKind) - delete(rawMsg, key) - case "serviceLoadMetrics": - err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) - delete(rawMsg, key) - case "servicePlacementPolicies": - s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) - delete(rawMsg, key) - case "standByReplicaKeepDuration": - err = unpopulateTimeRFC3339(val, "StandByReplicaKeepDuration", &s.StandByReplicaKeepDuration) - delete(rawMsg, key) - case "targetReplicaSetSize": - err = unpopulate(val, "TargetReplicaSetSize", &s.TargetReplicaSetSize) - 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 StatelessServiceProperties. -func (s StatelessServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationScheme", s.CorrelationScheme) - populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) - populate(objectMap, "instanceCloseDelayDuration", s.InstanceCloseDelayDuration) - populate(objectMap, "instanceCount", s.InstanceCount) - populate(objectMap, "partitionDescription", s.PartitionDescription) - populate(objectMap, "placementConstraints", s.PlacementConstraints) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "serviceDnsName", s.ServiceDNSName) - objectMap["serviceKind"] = ServiceKindStateless - populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) - populate(objectMap, "servicePackageActivationMode", s.ServicePackageActivationMode) - populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) - populate(objectMap, "serviceTypeName", s.ServiceTypeName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StatelessServiceProperties. -func (s *StatelessServiceProperties) 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 "correlationScheme": - err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) - delete(rawMsg, key) - case "defaultMoveCost": - err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) - delete(rawMsg, key) - case "instanceCloseDelayDuration": - err = unpopulate(val, "InstanceCloseDelayDuration", &s.InstanceCloseDelayDuration) - delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &s.InstanceCount) - delete(rawMsg, key) - case "partitionDescription": - s.PartitionDescription, err = unmarshalPartitionSchemeDescriptionClassification(val) - delete(rawMsg, key) - case "placementConstraints": - err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "serviceDnsName": - err = unpopulate(val, "ServiceDNSName", &s.ServiceDNSName) - delete(rawMsg, key) - case "serviceKind": - err = unpopulate(val, "ServiceKind", &s.ServiceKind) - delete(rawMsg, key) - case "serviceLoadMetrics": - err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) - delete(rawMsg, key) - case "servicePackageActivationMode": - err = unpopulate(val, "ServicePackageActivationMode", &s.ServicePackageActivationMode) - delete(rawMsg, key) - case "servicePlacementPolicies": - s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) - delete(rawMsg, key) - case "serviceTypeName": - err = unpopulate(val, "ServiceTypeName", &s.ServiceTypeName) - 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 StatelessServiceUpdateProperties. -func (s StatelessServiceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationScheme", s.CorrelationScheme) - populate(objectMap, "defaultMoveCost", s.DefaultMoveCost) - populate(objectMap, "instanceCloseDelayDuration", s.InstanceCloseDelayDuration) - populate(objectMap, "instanceCount", s.InstanceCount) - populate(objectMap, "placementConstraints", s.PlacementConstraints) - objectMap["serviceKind"] = ServiceKindStateless - populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) - populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StatelessServiceUpdateProperties. -func (s *StatelessServiceUpdateProperties) 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 "correlationScheme": - err = unpopulate(val, "CorrelationScheme", &s.CorrelationScheme) - delete(rawMsg, key) - case "defaultMoveCost": - err = unpopulate(val, "DefaultMoveCost", &s.DefaultMoveCost) - delete(rawMsg, key) - case "instanceCloseDelayDuration": - err = unpopulate(val, "InstanceCloseDelayDuration", &s.InstanceCloseDelayDuration) - delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &s.InstanceCount) - delete(rawMsg, key) - case "placementConstraints": - err = unpopulate(val, "PlacementConstraints", &s.PlacementConstraints) - delete(rawMsg, key) - case "serviceKind": - err = unpopulate(val, "ServiceKind", &s.ServiceKind) - delete(rawMsg, key) - case "serviceLoadMetrics": - err = unpopulate(val, "ServiceLoadMetrics", &s.ServiceLoadMetrics) - delete(rawMsg, key) - case "servicePlacementPolicies": - s.ServicePlacementPolicies, err = unmarshalServicePlacementPolicyDescriptionClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UniformInt64RangePartitionSchemeDescription. -func (u UniformInt64RangePartitionSchemeDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "count", u.Count) - populate(objectMap, "highKey", u.HighKey) - populate(objectMap, "lowKey", u.LowKey) - objectMap["partitionScheme"] = PartitionSchemeUniformInt64Range - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UniformInt64RangePartitionSchemeDescription. -func (u *UniformInt64RangePartitionSchemeDescription) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "count": - err = unpopulate(val, "Count", &u.Count) - delete(rawMsg, key) - case "highKey": - err = unpopulate(val, "HighKey", &u.HighKey) - delete(rawMsg, key) - case "lowKey": - err = unpopulate(val, "LowKey", &u.LowKey) - delete(rawMsg, key) - case "partitionScheme": - err = unpopulate(val, "PartitionScheme", &u.PartitionScheme) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -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 -}