diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md index edd20a4a8cd7..063795402457 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/CHANGELOG.md @@ -1,5 +1,27 @@ # Release History +## 2.0.0 (2023-02-13) +### Breaking Changes + +- Field `InstalledVersion` of struct `ExtensionProperties` has been removed + +### Features Added + +- New value `SourceKindTypeAzureBlob` added to type alias `SourceKindType` +- New struct `AzureBlobDefinition` +- New struct `AzureBlobPatchDefinition` +- New struct `ManagedIdentityDefinition` +- New struct `ManagedIdentityPatchDefinition` +- New struct `Plan` +- New struct `ServicePrincipalDefinition` +- New struct `ServicePrincipalPatchDefinition` +- New field `Plan` in struct `Extension` +- New field `CurrentVersion` in struct `ExtensionProperties` +- New field `IsSystemExtension` in struct `ExtensionProperties` +- New field `AzureBlob` in struct `FluxConfigurationPatchProperties` +- New field `AzureBlob` in struct `FluxConfigurationProperties` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration` 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/kubernetesconfiguration/armkubernetesconfiguration/autorest.md b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/autorest.md index 45c93d10b1ff..d1f28bbf253a 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/autorest.md +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/kubernetesconfiguration/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/kubernetesconfiguration/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_constants.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/constants.go similarity index 98% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_constants.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/constants.go index fd16e29edfe0..8410dde33c7c 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_constants.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/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 armkubernetesconfiguration const ( moduleName = "armkubernetesconfiguration" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // AKSIdentityType - The identity type. @@ -244,6 +245,7 @@ func PossibleScopeTypeValues() []ScopeType { type SourceKindType string const ( + SourceKindTypeAzureBlob SourceKindType = "AzureBlob" SourceKindTypeBucket SourceKindType = "Bucket" SourceKindTypeGitRepository SourceKindType = "GitRepository" ) @@ -251,6 +253,7 @@ const ( // PossibleSourceKindTypeValues returns the possible values for the SourceKindType const type. func PossibleSourceKindTypeValues() []SourceKindType { return []SourceKindType{ + SourceKindTypeAzureBlob, SourceKindTypeBucket, SourceKindTypeGitRepository, } diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_extensions_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client.go similarity index 83% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_extensions_client.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_client.go index 2133531736b0..131c5987e926 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_extensions_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/extensions_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 armkubernetesconfiguration @@ -32,9 +33,9 @@ type ExtensionsClient struct { } // NewExtensionsClient creates a new instance of ExtensionsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtensionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewExtensionsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Create a new Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// extensionName - Name of the Extension. -// extension - Properties necessary to Create an Extension. -// options - ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - extensionName - Name of the Extension. +// - extension - Properties necessary to Create an Extension. +// - options - ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, extension Extension, options *ExtensionsClientBeginCreateOptions) (*runtime.Poller[ExtensionsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, extension, options) @@ -81,7 +83,8 @@ func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Create a new Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *ExtensionsClient) create(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, extension Extension, options *ExtensionsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, extension, options) if err != nil { @@ -129,7 +132,7 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extension) @@ -137,13 +140,14 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// extensionName - Name of the Extension. -// options - ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - extensionName - Name of the Extension. +// - options - ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, options *ExtensionsClientBeginDeleteOptions) (*runtime.Poller[ExtensionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, options) @@ -160,7 +164,8 @@ func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *ExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, options *ExtensionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, options) if err != nil { @@ -208,7 +213,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.ForceDelete != nil { reqQP.Set("forceDelete", strconv.FormatBool(*options.ForceDelete)) } @@ -219,13 +224,14 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// extensionName - Name of the Extension. -// options - ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - extensionName - Name of the Extension. +// - options - ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. func (client *ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, options *ExtensionsClientGetOptions) (ExtensionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, options) if err != nil { @@ -273,7 +279,7 @@ func (client *ExtensionsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -289,13 +295,13 @@ func (client *ExtensionsClient) getHandleResponse(resp *http.Response) (Extensio } // NewListPager - List all Extensions in the cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// options - ExtensionsClientListOptions contains the optional parameters for the ExtensionsClient.List method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - options - ExtensionsClientListOptions contains the optional parameters for the ExtensionsClient.NewListPager method. func (client *ExtensionsClient) NewListPager(resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, options *ExtensionsClientListOptions) *runtime.Pager[ExtensionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ExtensionsClientListResponse]{ More: func(page ExtensionsClientListResponse) bool { @@ -352,7 +358,7 @@ func (client *ExtensionsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,14 +375,15 @@ func (client *ExtensionsClient) listHandleResponse(resp *http.Response) (Extensi // BeginUpdate - Patch an existing Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// extensionName - Name of the Extension. -// patchExtension - Properties to Patch in an existing Extension. -// options - ExtensionsClientBeginUpdateOptions contains the optional parameters for the ExtensionsClient.BeginUpdate method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - extensionName - Name of the Extension. +// - patchExtension - Properties to Patch in an existing Extension. +// - options - ExtensionsClientBeginUpdateOptions contains the optional parameters for the ExtensionsClient.BeginUpdate method. func (client *ExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, patchExtension PatchExtension, options *ExtensionsClientBeginUpdateOptions) (*runtime.Poller[ExtensionsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, patchExtension, options) @@ -393,7 +400,8 @@ func (client *ExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Patch an existing Kubernetes Cluster Extension. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *ExtensionsClient) update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, patchExtension PatchExtension, options *ExtensionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, patchExtension, options) if err != nil { @@ -441,7 +449,7 @@ func (client *ExtensionsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, patchExtension) diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_fluxconfigoperationstatus_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client.go similarity index 85% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_fluxconfigoperationstatus_client.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_client.go index cefb56811c1f..d6c8d4ab906e 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_fluxconfigoperationstatus_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigoperationstatus_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 armkubernetesconfiguration @@ -31,9 +32,9 @@ type FluxConfigOperationStatusClient struct { } // NewFluxConfigOperationStatusClient creates a new instance of FluxConfigOperationStatusClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewFluxConfigOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FluxConfigOperationStatusClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewFluxConfigOperationStatusClient(subscriptionID string, credential azcore // Get - Get Async Operation status // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// fluxConfigurationName - Name of the Flux Configuration. -// operationID - operation Id -// options - FluxConfigOperationStatusClientGetOptions contains the optional parameters for the FluxConfigOperationStatusClient.Get -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - fluxConfigurationName - Name of the Flux Configuration. +// - operationID - operation Id +// - options - FluxConfigOperationStatusClientGetOptions contains the optional parameters for the FluxConfigOperationStatusClient.Get +// method. func (client *FluxConfigOperationStatusClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, operationID string, options *FluxConfigOperationStatusClientGetOptions) (FluxConfigOperationStatusClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, operationID, options) if err != nil { @@ -116,7 +118,7 @@ func (client *FluxConfigOperationStatusClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_fluxconfigurations_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client.go similarity index 83% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_fluxconfigurations_client.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_client.go index 14684d586f42..97315aca4b98 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_fluxconfigurations_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/fluxconfigurations_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 armkubernetesconfiguration @@ -32,9 +33,9 @@ type FluxConfigurationsClient struct { } // NewFluxConfigurationsClient creates a new instance of FluxConfigurationsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewFluxConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FluxConfigurationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,15 +58,16 @@ func NewFluxConfigurationsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Create a new Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// fluxConfigurationName - Name of the Flux Configuration. -// fluxConfiguration - Properties necessary to Create a FluxConfiguration. -// options - FluxConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - fluxConfigurationName - Name of the Flux Configuration. +// - fluxConfiguration - Properties necessary to Create a FluxConfiguration. +// - options - FluxConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginCreateOrUpdate +// method. func (client *FluxConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfiguration FluxConfiguration, options *FluxConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FluxConfigurationsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfiguration, options) @@ -82,7 +84,8 @@ func (client *FluxConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create a new Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *FluxConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfiguration FluxConfiguration, options *FluxConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfiguration, options) if err != nil { @@ -130,7 +133,7 @@ func (client *FluxConfigurationsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, fluxConfiguration) @@ -139,14 +142,15 @@ func (client *FluxConfigurationsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the // source repo. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// fluxConfigurationName - Name of the Flux Configuration. -// options - FluxConfigurationsClientBeginDeleteOptions contains the optional parameters for the FluxConfigurationsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - fluxConfigurationName - Name of the Flux Configuration. +// - options - FluxConfigurationsClientBeginDeleteOptions contains the optional parameters for the FluxConfigurationsClient.BeginDelete +// method. func (client *FluxConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, options *FluxConfigurationsClientBeginDeleteOptions) (*runtime.Poller[FluxConfigurationsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, options) @@ -164,7 +168,8 @@ func (client *FluxConfigurationsClient) BeginDelete(ctx context.Context, resourc // Delete - This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source // repo. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *FluxConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, options *FluxConfigurationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, options) if err != nil { @@ -212,7 +217,7 @@ func (client *FluxConfigurationsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.ForceDelete != nil { reqQP.Set("forceDelete", strconv.FormatBool(*options.ForceDelete)) } @@ -223,13 +228,14 @@ func (client *FluxConfigurationsClient) deleteCreateRequest(ctx context.Context, // Get - Gets details of the Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// fluxConfigurationName - Name of the Flux Configuration. -// options - FluxConfigurationsClientGetOptions contains the optional parameters for the FluxConfigurationsClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - fluxConfigurationName - Name of the Flux Configuration. +// - options - FluxConfigurationsClientGetOptions contains the optional parameters for the FluxConfigurationsClient.Get method. func (client *FluxConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, options *FluxConfigurationsClientGetOptions) (FluxConfigurationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, options) if err != nil { @@ -277,7 +283,7 @@ func (client *FluxConfigurationsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,13 +299,14 @@ func (client *FluxConfigurationsClient) getHandleResponse(resp *http.Response) ( } // NewListPager - List all Flux Configurations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// options - FluxConfigurationsClientListOptions contains the optional parameters for the FluxConfigurationsClient.List method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - options - FluxConfigurationsClientListOptions contains the optional parameters for the FluxConfigurationsClient.NewListPager +// method. func (client *FluxConfigurationsClient) NewListPager(resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, options *FluxConfigurationsClientListOptions) *runtime.Pager[FluxConfigurationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[FluxConfigurationsClientListResponse]{ More: func(page FluxConfigurationsClientListResponse) bool { @@ -356,7 +363,7 @@ func (client *FluxConfigurationsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,15 +380,16 @@ func (client *FluxConfigurationsClient) listHandleResponse(resp *http.Response) // BeginUpdate - Update an existing Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// fluxConfigurationName - Name of the Flux Configuration. -// fluxConfigurationPatch - Properties to Patch in an existing Flux Configuration. -// options - FluxConfigurationsClientBeginUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - fluxConfigurationName - Name of the Flux Configuration. +// - fluxConfigurationPatch - Properties to Patch in an existing Flux Configuration. +// - options - FluxConfigurationsClientBeginUpdateOptions contains the optional parameters for the FluxConfigurationsClient.BeginUpdate +// method. func (client *FluxConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfigurationPatch FluxConfigurationPatch, options *FluxConfigurationsClientBeginUpdateOptions) (*runtime.Poller[FluxConfigurationsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfigurationPatch, options) @@ -398,7 +406,8 @@ func (client *FluxConfigurationsClient) BeginUpdate(ctx context.Context, resourc // Update - Update an existing Kubernetes Flux Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *FluxConfigurationsClient) update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfigurationPatch FluxConfigurationPatch, options *FluxConfigurationsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfigurationPatch, options) if err != nil { @@ -446,7 +455,7 @@ func (client *FluxConfigurationsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, fluxConfigurationPatch) diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod index 2ddfffb0639f..b2d44979d5be 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/v2 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/kubernetesconfiguration/armkubernetesconfiguration/go.sum b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/go.sum +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/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/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_models.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models.go similarity index 83% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_models.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models.go index b23fd2563d97..fdc9e956c1cc 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_models.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models.go @@ -5,12 +5,75 @@ // 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 armkubernetesconfiguration import "time" -// BucketDefinition - Parameters to reconcile to the GitRepository source kind type. +// AzureBlobDefinition - Parameters to reconcile to the AzureBlob source kind type. +type AzureBlobDefinition struct { + // The account key (shared key) to access the storage account + AccountKey *string `json:"accountKey,omitempty"` + + // The Azure Blob container name to sync from the url endpoint for the flux configuration. + ContainerName *string `json:"containerName,omitempty"` + + // Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided + // configuration secrets. + LocalAuthRef *string `json:"localAuthRef,omitempty"` + + // Parameters to authenticate using a Managed Identity. + ManagedIdentity *ManagedIdentityDefinition `json:"managedIdentity,omitempty"` + + // The Shared Access token to access the storage container + SasToken *string `json:"sasToken,omitempty"` + + // Parameters to authenticate using Service Principal. + ServicePrincipal *ServicePrincipalDefinition `json:"servicePrincipal,omitempty"` + + // The interval at which to re-reconcile the cluster Azure Blob source with the remote. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + + // The maximum time to attempt to reconcile the cluster Azure Blob source with the remote. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + + // The URL to sync for the flux configuration Azure Blob storage account. + URL *string `json:"url,omitempty"` +} + +// AzureBlobPatchDefinition - Parameters to reconcile to the AzureBlob source kind type. +type AzureBlobPatchDefinition struct { + // The account key (shared key) to access the storage account + AccountKey *string `json:"accountKey,omitempty"` + + // The Azure Blob container name to sync from the url endpoint for the flux configuration. + ContainerName *string `json:"containerName,omitempty"` + + // Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided + // configuration secrets. + LocalAuthRef *string `json:"localAuthRef,omitempty"` + + // Parameters to authenticate using a Managed Identity. + ManagedIdentity *ManagedIdentityPatchDefinition `json:"managedIdentity,omitempty"` + + // The Shared Access token to access the storage container + SasToken *string `json:"sasToken,omitempty"` + + // Parameters to authenticate using Service Principal. + ServicePrincipal *ServicePrincipalPatchDefinition `json:"servicePrincipal,omitempty"` + + // The interval at which to re-reconcile the cluster Azure Blob source with the remote. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + + // The maximum time to attempt to reconcile the cluster Azure Blob source with the remote. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + + // The URL to sync for the flux configuration Azure Blob storage account. + URL *string `json:"url,omitempty"` +} + +// BucketDefinition - Parameters to reconcile to the Bucket source kind type. type BucketDefinition struct { // Plaintext access key used to securely access the S3 bucket AccessKey *string `json:"accessKey,omitempty"` @@ -25,17 +88,17 @@ type BucketDefinition struct { // configuration secrets. LocalAuthRef *string `json:"localAuthRef,omitempty"` - // The interval at which to re-reconcile the cluster git repository source with the remote. + // The interval at which to re-reconcile the cluster bucket source with the remote. SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - // The maximum time to attempt to reconcile the cluster git repository source with the remote. + // The maximum time to attempt to reconcile the cluster bucket source with the remote. TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` // The URL to sync for the flux configuration S3 bucket. URL *string `json:"url,omitempty"` } -// BucketPatchDefinition - Parameters to reconcile to the GitRepository source kind type. +// BucketPatchDefinition - Parameters to reconcile to the Bucket source kind type. type BucketPatchDefinition struct { // Plaintext access key used to securely access the S3 bucket AccessKey *string `json:"accessKey,omitempty"` @@ -50,10 +113,10 @@ type BucketPatchDefinition struct { // configuration secrets. LocalAuthRef *string `json:"localAuthRef,omitempty"` - // The interval at which to re-reconcile the cluster git repository source with the remote. + // The interval at which to re-reconcile the cluster bucket source with the remote. SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - // The maximum time to attempt to reconcile the cluster git repository source with the remote. + // The maximum time to attempt to reconcile the cluster bucket source with the remote. TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` // The URL to sync for the flux configuration S3 bucket. @@ -78,7 +141,7 @@ type ComplianceStatus struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -114,6 +177,9 @@ type Extension struct { // Identity of the Extension resource Identity *Identity `json:"identity,omitempty"` + // The plan information. + Plan *Plan `json:"plan,omitempty"` + // Properties of an Extension resource Properties *ExtensionProperties `json:"properties,omitempty"` @@ -162,14 +228,17 @@ type ExtensionProperties struct { // 'false'. Version *string `json:"version,omitempty"` + // READ-ONLY; Currently installed version of the extension. + CurrentVersion *string `json:"currentVersion,omitempty" azure:"ro"` + // READ-ONLY; Custom Location settings properties. CustomLocationSettings map[string]*string `json:"customLocationSettings,omitempty" azure:"ro"` // READ-ONLY; Error information from the Agent - e.g. errors during installation. ErrorInfo *ErrorDetail `json:"errorInfo,omitempty" azure:"ro"` - // READ-ONLY; Installed version of the extension. - InstalledVersion *string `json:"installedVersion,omitempty" azure:"ro"` + // READ-ONLY; Flag to note if this extension is a system extension + IsSystemExtension *bool `json:"isSystemExtension,omitempty" azure:"ro"` // READ-ONLY; Uri of the Helm package PackageURI *string `json:"packageUri,omitempty" azure:"ro"` @@ -233,7 +302,7 @@ type ExtensionsClientGetOptions struct { // placeholder for future optional parameters } -// ExtensionsClientListOptions contains the optional parameters for the ExtensionsClient.List method. +// ExtensionsClientListOptions contains the optional parameters for the ExtensionsClient.NewListPager method. type ExtensionsClientListOptions struct { // placeholder for future optional parameters } @@ -280,6 +349,9 @@ type FluxConfigurationPatch struct { // FluxConfigurationPatchProperties - Updatable properties of an Flux Configuration Patch Request type FluxConfigurationPatchProperties struct { + // Parameters to reconcile to the AzureBlob source kind type. + AzureBlob *AzureBlobPatchDefinition `json:"azureBlob,omitempty"` + // Parameters to reconcile to the Bucket source kind type. Bucket *BucketPatchDefinition `json:"bucket,omitempty"` @@ -301,6 +373,9 @@ type FluxConfigurationPatchProperties struct { // FluxConfigurationProperties - Properties to create a Flux Configuration resource type FluxConfigurationProperties struct { + // Parameters to reconcile to the AzureBlob source kind type. + AzureBlob *AzureBlobDefinition `json:"azureBlob,omitempty"` + // Parameters to reconcile to the Bucket source kind type. Bucket *BucketDefinition `json:"bucket,omitempty"` @@ -381,7 +456,7 @@ type FluxConfigurationsClientGetOptions struct { // placeholder for future optional parameters } -// FluxConfigurationsClientListOptions contains the optional parameters for the FluxConfigurationsClient.List method. +// FluxConfigurationsClientListOptions contains the optional parameters for the FluxConfigurationsClient.NewListPager method. type FluxConfigurationsClientListOptions struct { // placeholder for future optional parameters } @@ -545,6 +620,18 @@ type KustomizationPatchDefinition struct { TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` } +// ManagedIdentityDefinition - Parameters to authenticate using a Managed Identity. +type ManagedIdentityDefinition struct { + // The client Id for authenticating a Managed Identity. + ClientID *string `json:"clientId,omitempty"` +} + +// ManagedIdentityPatchDefinition - Parameters to authenticate using a Managed Identity. +type ManagedIdentityPatchDefinition struct { + // The client Id for authenticating a Managed Identity. + ClientID *string `json:"clientId,omitempty"` +} + // ObjectReferenceDefinition - Object reference to a Kubernetes object on a cluster type ObjectReferenceDefinition struct { // Name of the object @@ -601,7 +688,7 @@ type OperationStatusClientGetOptions struct { // placeholder for future optional parameters } -// OperationStatusClientListOptions contains the optional parameters for the OperationStatusClient.List method. +// OperationStatusClientListOptions contains the optional parameters for the OperationStatusClient.NewListPager method. type OperationStatusClientListOptions struct { // placeholder for future optional parameters } @@ -633,7 +720,7 @@ type OperationStatusResult struct { Error *ErrorDetail `json:"error,omitempty" azure:"ro"` } -// 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 } @@ -663,6 +750,25 @@ type PatchExtensionProperties struct { Version *string `json:"version,omitempty"` } +// Plan for the resource. +type Plan struct { + // REQUIRED; A user defined name of the 3rd Party Artifact that is being procured. + Name *string `json:"name,omitempty"` + + // REQUIRED; The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact + // at the time of Data Market onboarding. + Product *string `json:"product,omitempty"` + + // REQUIRED; The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string `json:"publisher,omitempty"` + + // A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string `json:"promotionCode,omitempty"` + + // The version of the desired product/artifact. + Version *string `json:"version,omitempty"` +} + // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -765,6 +871,50 @@ type ScopeNamespace struct { TargetNamespace *string `json:"targetNamespace,omitempty"` } +// ServicePrincipalDefinition - Parameters to authenticate using Service Principal. +type ServicePrincipalDefinition struct { + // Base64-encoded certificate used to authenticate a Service Principal + ClientCertificate *string `json:"clientCertificate,omitempty"` + + // The password for the certificate used to authenticate a Service Principal + ClientCertificatePassword *string `json:"clientCertificatePassword,omitempty"` + + // Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication + // for the Client Certificate + ClientCertificateSendChain *bool `json:"clientCertificateSendChain,omitempty"` + + // The client Id for authenticating a Service Principal. + ClientID *string `json:"clientId,omitempty"` + + // The client secret for authenticating a Service Principal + ClientSecret *string `json:"clientSecret,omitempty"` + + // The tenant Id for authenticating a Service Principal + TenantID *string `json:"tenantId,omitempty"` +} + +// ServicePrincipalPatchDefinition - Parameters to authenticate using Service Principal. +type ServicePrincipalPatchDefinition struct { + // Base64-encoded certificate used to authenticate a Service Principal + ClientCertificate *string `json:"clientCertificate,omitempty"` + + // The password for the certificate used to authenticate a Service Principal + ClientCertificatePassword *string `json:"clientCertificatePassword,omitempty"` + + // Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication + // for the Client Certificate + ClientCertificateSendChain *bool `json:"clientCertificateSendChain,omitempty"` + + // The client Id for authenticating a Service Principal. + ClientID *string `json:"clientId,omitempty"` + + // The client secret for authenticating a Service Principal + ClientSecret *string `json:"clientSecret,omitempty"` + + // The tenant Id for authenticating a Service Principal + TenantID *string `json:"tenantId,omitempty"` +} + // SourceControlConfiguration - The SourceControl Configuration object returned in Get & Put response. type SourceControlConfiguration struct { // Properties to create a Source Control Configuration resource @@ -856,7 +1006,7 @@ type SourceControlConfigurationsClientGetOptions struct { // placeholder for future optional parameters } -// SourceControlConfigurationsClientListOptions contains the optional parameters for the SourceControlConfigurationsClient.List +// SourceControlConfigurationsClientListOptions contains the optional parameters for the SourceControlConfigurationsClient.NewListPager // method. type SourceControlConfigurationsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models_serde.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models_serde.go new file mode 100644 index 000000000000..33aca7b017a1 --- /dev/null +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/models_serde.go @@ -0,0 +1,2167 @@ +//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 armkubernetesconfiguration + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AzureBlobDefinition. +func (a AzureBlobDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountKey", a.AccountKey) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "localAuthRef", a.LocalAuthRef) + populate(objectMap, "managedIdentity", a.ManagedIdentity) + populate(objectMap, "sasToken", a.SasToken) + populate(objectMap, "servicePrincipal", a.ServicePrincipal) + populate(objectMap, "syncIntervalInSeconds", a.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", a.TimeoutInSeconds) + populate(objectMap, "url", a.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDefinition. +func (a *AzureBlobDefinition) 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 "accountKey": + err = unpopulate(val, "AccountKey", &a.AccountKey) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "localAuthRef": + err = unpopulate(val, "LocalAuthRef", &a.LocalAuthRef) + delete(rawMsg, key) + case "managedIdentity": + err = unpopulate(val, "ManagedIdentity", &a.ManagedIdentity) + delete(rawMsg, key) + case "sasToken": + err = unpopulate(val, "SasToken", &a.SasToken) + delete(rawMsg, key) + case "servicePrincipal": + err = unpopulate(val, "ServicePrincipal", &a.ServicePrincipal) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &a.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &a.TimeoutInSeconds) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &a.URL) + 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 AzureBlobPatchDefinition. +func (a AzureBlobPatchDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountKey", a.AccountKey) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "localAuthRef", a.LocalAuthRef) + populate(objectMap, "managedIdentity", a.ManagedIdentity) + populate(objectMap, "sasToken", a.SasToken) + populate(objectMap, "servicePrincipal", a.ServicePrincipal) + populate(objectMap, "syncIntervalInSeconds", a.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", a.TimeoutInSeconds) + populate(objectMap, "url", a.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobPatchDefinition. +func (a *AzureBlobPatchDefinition) 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 "accountKey": + err = unpopulate(val, "AccountKey", &a.AccountKey) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "localAuthRef": + err = unpopulate(val, "LocalAuthRef", &a.LocalAuthRef) + delete(rawMsg, key) + case "managedIdentity": + err = unpopulate(val, "ManagedIdentity", &a.ManagedIdentity) + delete(rawMsg, key) + case "sasToken": + err = unpopulate(val, "SasToken", &a.SasToken) + delete(rawMsg, key) + case "servicePrincipal": + err = unpopulate(val, "ServicePrincipal", &a.ServicePrincipal) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &a.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &a.TimeoutInSeconds) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &a.URL) + 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 BucketDefinition. +func (b BucketDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessKey", b.AccessKey) + populate(objectMap, "bucketName", b.BucketName) + populate(objectMap, "insecure", b.Insecure) + populate(objectMap, "localAuthRef", b.LocalAuthRef) + populate(objectMap, "syncIntervalInSeconds", b.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", b.TimeoutInSeconds) + populate(objectMap, "url", b.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BucketDefinition. +func (b *BucketDefinition) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessKey": + err = unpopulate(val, "AccessKey", &b.AccessKey) + delete(rawMsg, key) + case "bucketName": + err = unpopulate(val, "BucketName", &b.BucketName) + delete(rawMsg, key) + case "insecure": + err = unpopulate(val, "Insecure", &b.Insecure) + delete(rawMsg, key) + case "localAuthRef": + err = unpopulate(val, "LocalAuthRef", &b.LocalAuthRef) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &b.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &b.TimeoutInSeconds) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BucketPatchDefinition. +func (b BucketPatchDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessKey", b.AccessKey) + populate(objectMap, "bucketName", b.BucketName) + populate(objectMap, "insecure", b.Insecure) + populate(objectMap, "localAuthRef", b.LocalAuthRef) + populate(objectMap, "syncIntervalInSeconds", b.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", b.TimeoutInSeconds) + populate(objectMap, "url", b.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BucketPatchDefinition. +func (b *BucketPatchDefinition) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessKey": + err = unpopulate(val, "AccessKey", &b.AccessKey) + delete(rawMsg, key) + case "bucketName": + err = unpopulate(val, "BucketName", &b.BucketName) + delete(rawMsg, key) + case "insecure": + err = unpopulate(val, "Insecure", &b.Insecure) + delete(rawMsg, key) + case "localAuthRef": + err = unpopulate(val, "LocalAuthRef", &b.LocalAuthRef) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &b.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &b.TimeoutInSeconds) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComplianceStatus. +func (c ComplianceStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "complianceState", c.ComplianceState) + populateTimeRFC3339(objectMap, "lastConfigApplied", c.LastConfigApplied) + populate(objectMap, "message", c.Message) + populate(objectMap, "messageLevel", c.MessageLevel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceStatus. +func (c *ComplianceStatus) 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 "complianceState": + err = unpopulate(val, "ComplianceState", &c.ComplianceState) + delete(rawMsg, key) + case "lastConfigApplied": + err = unpopulateTimeRFC3339(val, "LastConfigApplied", &c.LastConfigApplied) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "messageLevel": + err = unpopulate(val, "MessageLevel", &c.MessageLevel) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) 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 ErrorResponse. +func (e *ErrorResponse) 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 Extension. +func (e Extension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "identity", e.Identity) + populate(objectMap, "name", e.Name) + populate(objectMap, "plan", e.Plan) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. +func (e *Extension) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &e.Plan) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtensionProperties. +func (e ExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aksAssignedIdentity", e.AksAssignedIdentity) + populate(objectMap, "autoUpgradeMinorVersion", e.AutoUpgradeMinorVersion) + populate(objectMap, "configurationProtectedSettings", e.ConfigurationProtectedSettings) + populate(objectMap, "configurationSettings", e.ConfigurationSettings) + populate(objectMap, "currentVersion", e.CurrentVersion) + populate(objectMap, "customLocationSettings", e.CustomLocationSettings) + populate(objectMap, "errorInfo", e.ErrorInfo) + populate(objectMap, "extensionType", e.ExtensionType) + populate(objectMap, "isSystemExtension", e.IsSystemExtension) + populate(objectMap, "packageUri", e.PackageURI) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "releaseTrain", e.ReleaseTrain) + populate(objectMap, "scope", e.Scope) + populate(objectMap, "statuses", e.Statuses) + populate(objectMap, "version", e.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionProperties. +func (e *ExtensionProperties) 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 "aksAssignedIdentity": + err = unpopulate(val, "AksAssignedIdentity", &e.AksAssignedIdentity) + delete(rawMsg, key) + case "autoUpgradeMinorVersion": + err = unpopulate(val, "AutoUpgradeMinorVersion", &e.AutoUpgradeMinorVersion) + delete(rawMsg, key) + case "configurationProtectedSettings": + err = unpopulate(val, "ConfigurationProtectedSettings", &e.ConfigurationProtectedSettings) + delete(rawMsg, key) + case "configurationSettings": + err = unpopulate(val, "ConfigurationSettings", &e.ConfigurationSettings) + delete(rawMsg, key) + case "currentVersion": + err = unpopulate(val, "CurrentVersion", &e.CurrentVersion) + delete(rawMsg, key) + case "customLocationSettings": + err = unpopulate(val, "CustomLocationSettings", &e.CustomLocationSettings) + delete(rawMsg, key) + case "errorInfo": + err = unpopulate(val, "ErrorInfo", &e.ErrorInfo) + delete(rawMsg, key) + case "extensionType": + err = unpopulate(val, "ExtensionType", &e.ExtensionType) + delete(rawMsg, key) + case "isSystemExtension": + err = unpopulate(val, "IsSystemExtension", &e.IsSystemExtension) + delete(rawMsg, key) + case "packageUri": + err = unpopulate(val, "PackageURI", &e.PackageURI) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "releaseTrain": + err = unpopulate(val, "ReleaseTrain", &e.ReleaseTrain) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &e.Scope) + delete(rawMsg, key) + case "statuses": + err = unpopulate(val, "Statuses", &e.Statuses) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &e.Version) + 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 ExtensionPropertiesAksAssignedIdentity. +func (e ExtensionPropertiesAksAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", e.PrincipalID) + populate(objectMap, "tenantId", e.TenantID) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionPropertiesAksAssignedIdentity. +func (e *ExtensionPropertiesAksAssignedIdentity) 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 "principalId": + err = unpopulate(val, "PrincipalID", &e.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &e.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtensionStatus. +func (e ExtensionStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "displayStatus", e.DisplayStatus) + populate(objectMap, "level", e.Level) + populate(objectMap, "message", e.Message) + populate(objectMap, "time", e.Time) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionStatus. +func (e *ExtensionStatus) 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 "displayStatus": + err = unpopulate(val, "DisplayStatus", &e.DisplayStatus) + delete(rawMsg, key) + case "level": + err = unpopulate(val, "Level", &e.Level) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "time": + err = unpopulate(val, "Time", &e.Time) + 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 ExtensionsList. +func (e ExtensionsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionsList. +func (e *ExtensionsList) 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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FluxConfiguration. +func (f FluxConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FluxConfiguration. +func (f *FluxConfiguration) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FluxConfigurationPatch. +func (f FluxConfigurationPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", f.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FluxConfigurationPatch. +func (f *FluxConfigurationPatch) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FluxConfigurationPatchProperties. +func (f FluxConfigurationPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureBlob", f.AzureBlob) + populate(objectMap, "bucket", f.Bucket) + populate(objectMap, "configurationProtectedSettings", f.ConfigurationProtectedSettings) + populate(objectMap, "gitRepository", f.GitRepository) + populate(objectMap, "kustomizations", f.Kustomizations) + populate(objectMap, "sourceKind", f.SourceKind) + populate(objectMap, "suspend", f.Suspend) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FluxConfigurationPatchProperties. +func (f *FluxConfigurationPatchProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureBlob": + err = unpopulate(val, "AzureBlob", &f.AzureBlob) + delete(rawMsg, key) + case "bucket": + err = unpopulate(val, "Bucket", &f.Bucket) + delete(rawMsg, key) + case "configurationProtectedSettings": + err = unpopulate(val, "ConfigurationProtectedSettings", &f.ConfigurationProtectedSettings) + delete(rawMsg, key) + case "gitRepository": + err = unpopulate(val, "GitRepository", &f.GitRepository) + delete(rawMsg, key) + case "kustomizations": + err = unpopulate(val, "Kustomizations", &f.Kustomizations) + delete(rawMsg, key) + case "sourceKind": + err = unpopulate(val, "SourceKind", &f.SourceKind) + delete(rawMsg, key) + case "suspend": + err = unpopulate(val, "Suspend", &f.Suspend) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FluxConfigurationProperties. +func (f FluxConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureBlob", f.AzureBlob) + populate(objectMap, "bucket", f.Bucket) + populate(objectMap, "complianceState", f.ComplianceState) + populate(objectMap, "configurationProtectedSettings", f.ConfigurationProtectedSettings) + populate(objectMap, "errorMessage", f.ErrorMessage) + populate(objectMap, "gitRepository", f.GitRepository) + populate(objectMap, "kustomizations", f.Kustomizations) + populate(objectMap, "namespace", f.Namespace) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "repositoryPublicKey", f.RepositoryPublicKey) + populate(objectMap, "scope", f.Scope) + populate(objectMap, "sourceKind", f.SourceKind) + populate(objectMap, "sourceSyncedCommitId", f.SourceSyncedCommitID) + populateTimeRFC3339(objectMap, "sourceUpdatedAt", f.SourceUpdatedAt) + populateTimeRFC3339(objectMap, "statusUpdatedAt", f.StatusUpdatedAt) + populate(objectMap, "statuses", f.Statuses) + populate(objectMap, "suspend", f.Suspend) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FluxConfigurationProperties. +func (f *FluxConfigurationProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureBlob": + err = unpopulate(val, "AzureBlob", &f.AzureBlob) + delete(rawMsg, key) + case "bucket": + err = unpopulate(val, "Bucket", &f.Bucket) + delete(rawMsg, key) + case "complianceState": + err = unpopulate(val, "ComplianceState", &f.ComplianceState) + delete(rawMsg, key) + case "configurationProtectedSettings": + err = unpopulate(val, "ConfigurationProtectedSettings", &f.ConfigurationProtectedSettings) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &f.ErrorMessage) + delete(rawMsg, key) + case "gitRepository": + err = unpopulate(val, "GitRepository", &f.GitRepository) + delete(rawMsg, key) + case "kustomizations": + err = unpopulate(val, "Kustomizations", &f.Kustomizations) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &f.Namespace) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "repositoryPublicKey": + err = unpopulate(val, "RepositoryPublicKey", &f.RepositoryPublicKey) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &f.Scope) + delete(rawMsg, key) + case "sourceKind": + err = unpopulate(val, "SourceKind", &f.SourceKind) + delete(rawMsg, key) + case "sourceSyncedCommitId": + err = unpopulate(val, "SourceSyncedCommitID", &f.SourceSyncedCommitID) + delete(rawMsg, key) + case "sourceUpdatedAt": + err = unpopulateTimeRFC3339(val, "SourceUpdatedAt", &f.SourceUpdatedAt) + delete(rawMsg, key) + case "statusUpdatedAt": + err = unpopulateTimeRFC3339(val, "StatusUpdatedAt", &f.StatusUpdatedAt) + delete(rawMsg, key) + case "statuses": + err = unpopulate(val, "Statuses", &f.Statuses) + delete(rawMsg, key) + case "suspend": + err = unpopulate(val, "Suspend", &f.Suspend) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FluxConfigurationsList. +func (f FluxConfigurationsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FluxConfigurationsList. +func (f *FluxConfigurationsList) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GitRepositoryDefinition. +func (g GitRepositoryDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "httpsCACert", g.HTTPSCACert) + populate(objectMap, "httpsUser", g.HTTPSUser) + populate(objectMap, "localAuthRef", g.LocalAuthRef) + populate(objectMap, "repositoryRef", g.RepositoryRef) + populate(objectMap, "sshKnownHosts", g.SSHKnownHosts) + populate(objectMap, "syncIntervalInSeconds", g.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", g.TimeoutInSeconds) + populate(objectMap, "url", g.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GitRepositoryDefinition. +func (g *GitRepositoryDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "httpsCACert": + err = unpopulate(val, "HTTPSCACert", &g.HTTPSCACert) + delete(rawMsg, key) + case "httpsUser": + err = unpopulate(val, "HTTPSUser", &g.HTTPSUser) + delete(rawMsg, key) + case "localAuthRef": + err = unpopulate(val, "LocalAuthRef", &g.LocalAuthRef) + delete(rawMsg, key) + case "repositoryRef": + err = unpopulate(val, "RepositoryRef", &g.RepositoryRef) + delete(rawMsg, key) + case "sshKnownHosts": + err = unpopulate(val, "SSHKnownHosts", &g.SSHKnownHosts) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &g.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &g.TimeoutInSeconds) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &g.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GitRepositoryPatchDefinition. +func (g GitRepositoryPatchDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "httpsCACert", g.HTTPSCACert) + populate(objectMap, "httpsUser", g.HTTPSUser) + populate(objectMap, "localAuthRef", g.LocalAuthRef) + populate(objectMap, "repositoryRef", g.RepositoryRef) + populate(objectMap, "sshKnownHosts", g.SSHKnownHosts) + populate(objectMap, "syncIntervalInSeconds", g.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", g.TimeoutInSeconds) + populate(objectMap, "url", g.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GitRepositoryPatchDefinition. +func (g *GitRepositoryPatchDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "httpsCACert": + err = unpopulate(val, "HTTPSCACert", &g.HTTPSCACert) + delete(rawMsg, key) + case "httpsUser": + err = unpopulate(val, "HTTPSUser", &g.HTTPSUser) + delete(rawMsg, key) + case "localAuthRef": + err = unpopulate(val, "LocalAuthRef", &g.LocalAuthRef) + delete(rawMsg, key) + case "repositoryRef": + err = unpopulate(val, "RepositoryRef", &g.RepositoryRef) + delete(rawMsg, key) + case "sshKnownHosts": + err = unpopulate(val, "SSHKnownHosts", &g.SSHKnownHosts) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &g.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &g.TimeoutInSeconds) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &g.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HelmOperatorProperties. +func (h HelmOperatorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "chartValues", h.ChartValues) + populate(objectMap, "chartVersion", h.ChartVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HelmOperatorProperties. +func (h *HelmOperatorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "chartValues": + err = unpopulate(val, "ChartValues", &h.ChartValues) + delete(rawMsg, key) + case "chartVersion": + err = unpopulate(val, "ChartVersion", &h.ChartVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HelmReleasePropertiesDefinition. +func (h HelmReleasePropertiesDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failureCount", h.FailureCount) + populate(objectMap, "helmChartRef", h.HelmChartRef) + populate(objectMap, "installFailureCount", h.InstallFailureCount) + populate(objectMap, "lastRevisionApplied", h.LastRevisionApplied) + populate(objectMap, "upgradeFailureCount", h.UpgradeFailureCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HelmReleasePropertiesDefinition. +func (h *HelmReleasePropertiesDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failureCount": + err = unpopulate(val, "FailureCount", &h.FailureCount) + delete(rawMsg, key) + case "helmChartRef": + err = unpopulate(val, "HelmChartRef", &h.HelmChartRef) + delete(rawMsg, key) + case "installFailureCount": + err = unpopulate(val, "InstallFailureCount", &h.InstallFailureCount) + delete(rawMsg, key) + case "lastRevisionApplied": + err = unpopulate(val, "LastRevisionApplied", &h.LastRevisionApplied) + delete(rawMsg, key) + case "upgradeFailureCount": + err = unpopulate(val, "UpgradeFailureCount", &h.UpgradeFailureCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + objectMap["type"] = "SystemAssigned" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KustomizationDefinition. +func (k KustomizationDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dependsOn", k.DependsOn) + populate(objectMap, "force", k.Force) + populate(objectMap, "name", k.Name) + populate(objectMap, "path", k.Path) + populate(objectMap, "prune", k.Prune) + populate(objectMap, "retryIntervalInSeconds", k.RetryIntervalInSeconds) + populate(objectMap, "syncIntervalInSeconds", k.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", k.TimeoutInSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KustomizationDefinition. +func (k *KustomizationDefinition) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dependsOn": + err = unpopulate(val, "DependsOn", &k.DependsOn) + delete(rawMsg, key) + case "force": + err = unpopulate(val, "Force", &k.Force) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &k.Name) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &k.Path) + delete(rawMsg, key) + case "prune": + err = unpopulate(val, "Prune", &k.Prune) + delete(rawMsg, key) + case "retryIntervalInSeconds": + err = unpopulate(val, "RetryIntervalInSeconds", &k.RetryIntervalInSeconds) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &k.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &k.TimeoutInSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KustomizationPatchDefinition. +func (k KustomizationPatchDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dependsOn", k.DependsOn) + populate(objectMap, "force", k.Force) + populate(objectMap, "path", k.Path) + populate(objectMap, "prune", k.Prune) + populate(objectMap, "retryIntervalInSeconds", k.RetryIntervalInSeconds) + populate(objectMap, "syncIntervalInSeconds", k.SyncIntervalInSeconds) + populate(objectMap, "timeoutInSeconds", k.TimeoutInSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KustomizationPatchDefinition. +func (k *KustomizationPatchDefinition) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dependsOn": + err = unpopulate(val, "DependsOn", &k.DependsOn) + delete(rawMsg, key) + case "force": + err = unpopulate(val, "Force", &k.Force) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &k.Path) + delete(rawMsg, key) + case "prune": + err = unpopulate(val, "Prune", &k.Prune) + delete(rawMsg, key) + case "retryIntervalInSeconds": + err = unpopulate(val, "RetryIntervalInSeconds", &k.RetryIntervalInSeconds) + delete(rawMsg, key) + case "syncIntervalInSeconds": + err = unpopulate(val, "SyncIntervalInSeconds", &k.SyncIntervalInSeconds) + delete(rawMsg, key) + case "timeoutInSeconds": + err = unpopulate(val, "TimeoutInSeconds", &k.TimeoutInSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedIdentityDefinition. +func (m ManagedIdentityDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", m.ClientID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentityDefinition. +func (m *ManagedIdentityDefinition) 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 "clientId": + err = unpopulate(val, "ClientID", &m.ClientID) + 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 ManagedIdentityPatchDefinition. +func (m ManagedIdentityPatchDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", m.ClientID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentityPatchDefinition. +func (m *ManagedIdentityPatchDefinition) 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 "clientId": + err = unpopulate(val, "ClientID", &m.ClientID) + 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 ObjectReferenceDefinition. +func (o ObjectReferenceDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", o.Name) + populate(objectMap, "namespace", o.Namespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReferenceDefinition. +func (o *ObjectReferenceDefinition) 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 "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &o.Namespace) + 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 ObjectStatusConditionDefinition. +func (o ObjectStatusConditionDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "lastTransitionTime", o.LastTransitionTime) + populate(objectMap, "message", o.Message) + populate(objectMap, "reason", o.Reason) + populate(objectMap, "status", o.Status) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectStatusConditionDefinition. +func (o *ObjectStatusConditionDefinition) 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 "lastTransitionTime": + err = unpopulateTimeRFC3339(val, "LastTransitionTime", &o.LastTransitionTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &o.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + 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 ObjectStatusDefinition. +func (o ObjectStatusDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliedBy", o.AppliedBy) + populate(objectMap, "complianceState", o.ComplianceState) + populate(objectMap, "helmReleaseProperties", o.HelmReleaseProperties) + populate(objectMap, "kind", o.Kind) + populate(objectMap, "name", o.Name) + populate(objectMap, "namespace", o.Namespace) + populate(objectMap, "statusConditions", o.StatusConditions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectStatusDefinition. +func (o *ObjectStatusDefinition) 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 "appliedBy": + err = unpopulate(val, "AppliedBy", &o.AppliedBy) + delete(rawMsg, key) + case "complianceState": + err = unpopulate(val, "ComplianceState", &o.ComplianceState) + delete(rawMsg, key) + case "helmReleaseProperties": + err = unpopulate(val, "HelmReleaseProperties", &o.HelmReleaseProperties) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &o.Namespace) + delete(rawMsg, key) + case "statusConditions": + err = unpopulate(val, "StatusConditions", &o.StatusConditions) + 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 OperationStatusList. +func (o OperationStatusList) 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 OperationStatusList. +func (o *OperationStatusList) 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 OperationStatusResult. +func (o OperationStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult. +func (o *OperationStatusResult) 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 "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + 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 PatchExtension. +func (p PatchExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchExtension. +func (p *PatchExtension) 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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 PatchExtensionProperties. +func (p PatchExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoUpgradeMinorVersion", p.AutoUpgradeMinorVersion) + populate(objectMap, "configurationProtectedSettings", p.ConfigurationProtectedSettings) + populate(objectMap, "configurationSettings", p.ConfigurationSettings) + populate(objectMap, "releaseTrain", p.ReleaseTrain) + populate(objectMap, "version", p.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchExtensionProperties. +func (p *PatchExtensionProperties) 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 "autoUpgradeMinorVersion": + err = unpopulate(val, "AutoUpgradeMinorVersion", &p.AutoUpgradeMinorVersion) + delete(rawMsg, key) + case "configurationProtectedSettings": + err = unpopulate(val, "ConfigurationProtectedSettings", &p.ConfigurationProtectedSettings) + delete(rawMsg, key) + case "configurationSettings": + err = unpopulate(val, "ConfigurationSettings", &p.ConfigurationSettings) + delete(rawMsg, key) + case "releaseTrain": + err = unpopulate(val, "ReleaseTrain", &p.ReleaseTrain) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &p.Version) + 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 Plan. +func (p Plan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "product", p.Product) + populate(objectMap, "promotionCode", p.PromotionCode) + populate(objectMap, "publisher", p.Publisher) + populate(objectMap, "version", p.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Plan. +func (p *Plan) 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 "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "product": + err = unpopulate(val, "Product", &p.Product) + delete(rawMsg, key) + case "promotionCode": + err = unpopulate(val, "PromotionCode", &p.PromotionCode) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &p.Publisher) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &p.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RepositoryRefDefinition. +func (r RepositoryRefDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "branch", r.Branch) + populate(objectMap, "commit", r.Commit) + populate(objectMap, "semver", r.Semver) + populate(objectMap, "tag", r.Tag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RepositoryRefDefinition. +func (r *RepositoryRefDefinition) 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 "branch": + err = unpopulate(val, "Branch", &r.Branch) + delete(rawMsg, key) + case "commit": + err = unpopulate(val, "Commit", &r.Commit) + delete(rawMsg, key) + case "semver": + err = unpopulate(val, "Semver", &r.Semver) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &r.Tag) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation. +func (r ResourceProviderOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", r.Display) + populate(objectMap, "isDataAction", r.IsDataAction) + populate(objectMap, "name", r.Name) + populate(objectMap, "origin", r.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperation. +func (r *ResourceProviderOperation) 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 "display": + err = unpopulate(val, "Display", &r.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &r.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &r.Origin) + 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 ResourceProviderOperationDisplay. +func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "operation", r.Operation) + populate(objectMap, "provider", r.Provider) + populate(objectMap, "resource", r.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplay. +func (r *ResourceProviderOperationDisplay) 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 "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &r.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &r.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &r.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. +func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList. +func (r *ResourceProviderOperationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 Scope. +func (s Scope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cluster", s.Cluster) + populate(objectMap, "namespace", s.Namespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Scope. +func (s *Scope) 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 "cluster": + err = unpopulate(val, "Cluster", &s.Cluster) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &s.Namespace) + 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 ScopeCluster. +func (s ScopeCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "releaseNamespace", s.ReleaseNamespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeCluster. +func (s *ScopeCluster) 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 "releaseNamespace": + err = unpopulate(val, "ReleaseNamespace", &s.ReleaseNamespace) + 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 ScopeNamespace. +func (s ScopeNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetNamespace", s.TargetNamespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeNamespace. +func (s *ScopeNamespace) 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 "targetNamespace": + err = unpopulate(val, "TargetNamespace", &s.TargetNamespace) + 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 ServicePrincipalDefinition. +func (s ServicePrincipalDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientCertificate", s.ClientCertificate) + populate(objectMap, "clientCertificatePassword", s.ClientCertificatePassword) + populate(objectMap, "clientCertificateSendChain", s.ClientCertificateSendChain) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "clientSecret", s.ClientSecret) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalDefinition. +func (s *ServicePrincipalDefinition) 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 "clientCertificate": + err = unpopulate(val, "ClientCertificate", &s.ClientCertificate) + delete(rawMsg, key) + case "clientCertificatePassword": + err = unpopulate(val, "ClientCertificatePassword", &s.ClientCertificatePassword) + delete(rawMsg, key) + case "clientCertificateSendChain": + err = unpopulate(val, "ClientCertificateSendChain", &s.ClientCertificateSendChain) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &s.ClientSecret) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + 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 ServicePrincipalPatchDefinition. +func (s ServicePrincipalPatchDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientCertificate", s.ClientCertificate) + populate(objectMap, "clientCertificatePassword", s.ClientCertificatePassword) + populate(objectMap, "clientCertificateSendChain", s.ClientCertificateSendChain) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "clientSecret", s.ClientSecret) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalPatchDefinition. +func (s *ServicePrincipalPatchDefinition) 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 "clientCertificate": + err = unpopulate(val, "ClientCertificate", &s.ClientCertificate) + delete(rawMsg, key) + case "clientCertificatePassword": + err = unpopulate(val, "ClientCertificatePassword", &s.ClientCertificatePassword) + delete(rawMsg, key) + case "clientCertificateSendChain": + err = unpopulate(val, "ClientCertificateSendChain", &s.ClientCertificateSendChain) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &s.ClientSecret) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + 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 SourceControlConfiguration. +func (s SourceControlConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControlConfiguration. +func (s *SourceControlConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 SourceControlConfigurationList. +func (s SourceControlConfigurationList) 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 SourceControlConfigurationList. +func (s *SourceControlConfigurationList) 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 SourceControlConfigurationProperties. +func (s SourceControlConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "complianceStatus", s.ComplianceStatus) + populate(objectMap, "configurationProtectedSettings", s.ConfigurationProtectedSettings) + populate(objectMap, "enableHelmOperator", s.EnableHelmOperator) + populate(objectMap, "helmOperatorProperties", s.HelmOperatorProperties) + populate(objectMap, "operatorInstanceName", s.OperatorInstanceName) + populate(objectMap, "operatorNamespace", s.OperatorNamespace) + populate(objectMap, "operatorParams", s.OperatorParams) + populate(objectMap, "operatorScope", s.OperatorScope) + populate(objectMap, "operatorType", s.OperatorType) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "repositoryPublicKey", s.RepositoryPublicKey) + populate(objectMap, "repositoryUrl", s.RepositoryURL) + populate(objectMap, "sshKnownHostsContents", s.SSHKnownHostsContents) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControlConfigurationProperties. +func (s *SourceControlConfigurationProperties) 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 "complianceStatus": + err = unpopulate(val, "ComplianceStatus", &s.ComplianceStatus) + delete(rawMsg, key) + case "configurationProtectedSettings": + err = unpopulate(val, "ConfigurationProtectedSettings", &s.ConfigurationProtectedSettings) + delete(rawMsg, key) + case "enableHelmOperator": + err = unpopulate(val, "EnableHelmOperator", &s.EnableHelmOperator) + delete(rawMsg, key) + case "helmOperatorProperties": + err = unpopulate(val, "HelmOperatorProperties", &s.HelmOperatorProperties) + delete(rawMsg, key) + case "operatorInstanceName": + err = unpopulate(val, "OperatorInstanceName", &s.OperatorInstanceName) + delete(rawMsg, key) + case "operatorNamespace": + err = unpopulate(val, "OperatorNamespace", &s.OperatorNamespace) + delete(rawMsg, key) + case "operatorParams": + err = unpopulate(val, "OperatorParams", &s.OperatorParams) + delete(rawMsg, key) + case "operatorScope": + err = unpopulate(val, "OperatorScope", &s.OperatorScope) + delete(rawMsg, key) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "repositoryPublicKey": + err = unpopulate(val, "RepositoryPublicKey", &s.RepositoryPublicKey) + delete(rawMsg, key) + case "repositoryUrl": + err = unpopulate(val, "RepositoryURL", &s.RepositoryURL) + delete(rawMsg, key) + case "sshKnownHostsContents": + err = unpopulate(val, "SSHKnownHostsContents", &s.SSHKnownHostsContents) + 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 +} + +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/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_operations_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client.go similarity index 90% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_operations_client.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operations_client.go index 286626e71c92..7a346da35c8a 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_operations_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/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 armkubernetesconfiguration @@ -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 - List all the available operations the KubernetesConfiguration resource provider supports. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-11-01 +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_operationstatus_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client.go similarity index 84% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_operationstatus_client.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_client.go index dc5f94032e58..7f4a3c22660f 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_operationstatus_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/operationstatus_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 armkubernetesconfiguration @@ -31,9 +32,9 @@ type OperationStatusClient struct { } // NewOperationStatusClient creates a new instance of OperationStatusClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationStatusClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCred // Get - Get Async Operation status // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// extensionName - Name of the Extension. -// operationID - operation Id -// options - OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - extensionName - Name of the Extension. +// - operationID - operation Id +// - options - OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. func (client *OperationStatusClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, operationID string, options *OperationStatusClientGetOptions) (OperationStatusClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationID, options) if err != nil { @@ -115,7 +117,7 @@ func (client *OperationStatusClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -131,13 +133,14 @@ func (client *OperationStatusClient) getHandleResponse(resp *http.Response) (Ope } // NewListPager - List Async Operations, currently in progress, in a cluster -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// options - OperationStatusClientListOptions contains the optional parameters for the OperationStatusClient.List method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - options - OperationStatusClientListOptions contains the optional parameters for the OperationStatusClient.NewListPager +// method. func (client *OperationStatusClient) NewListPager(resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, options *OperationStatusClientListOptions) *runtime.Pager[OperationStatusClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationStatusClientListResponse]{ More: func(page OperationStatusClientListResponse) bool { @@ -194,7 +197,7 @@ func (client *OperationStatusClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_response_types.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/response_types.go similarity index 84% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_response_types.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/response_types.go index 85ac6c1cc6a2..cc8bd5059921 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_response_types.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/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 armkubernetesconfiguration -// ExtensionsClientCreateResponse contains the response from method ExtensionsClient.Create. +// ExtensionsClientCreateResponse contains the response from method ExtensionsClient.BeginCreate. type ExtensionsClientCreateResponse struct { Extension } -// ExtensionsClientDeleteResponse contains the response from method ExtensionsClient.Delete. +// ExtensionsClientDeleteResponse contains the response from method ExtensionsClient.BeginDelete. type ExtensionsClientDeleteResponse struct { // placeholder for future response values } @@ -23,12 +24,12 @@ type ExtensionsClientGetResponse struct { Extension } -// ExtensionsClientListResponse contains the response from method ExtensionsClient.List. +// ExtensionsClientListResponse contains the response from method ExtensionsClient.NewListPager. type ExtensionsClientListResponse struct { ExtensionsList } -// ExtensionsClientUpdateResponse contains the response from method ExtensionsClient.Update. +// ExtensionsClientUpdateResponse contains the response from method ExtensionsClient.BeginUpdate. type ExtensionsClientUpdateResponse struct { Extension } @@ -38,12 +39,12 @@ type FluxConfigOperationStatusClientGetResponse struct { OperationStatusResult } -// FluxConfigurationsClientCreateOrUpdateResponse contains the response from method FluxConfigurationsClient.CreateOrUpdate. +// FluxConfigurationsClientCreateOrUpdateResponse contains the response from method FluxConfigurationsClient.BeginCreateOrUpdate. type FluxConfigurationsClientCreateOrUpdateResponse struct { FluxConfiguration } -// FluxConfigurationsClientDeleteResponse contains the response from method FluxConfigurationsClient.Delete. +// FluxConfigurationsClientDeleteResponse contains the response from method FluxConfigurationsClient.BeginDelete. type FluxConfigurationsClientDeleteResponse struct { // placeholder for future response values } @@ -53,12 +54,12 @@ type FluxConfigurationsClientGetResponse struct { FluxConfiguration } -// FluxConfigurationsClientListResponse contains the response from method FluxConfigurationsClient.List. +// FluxConfigurationsClientListResponse contains the response from method FluxConfigurationsClient.NewListPager. type FluxConfigurationsClientListResponse struct { FluxConfigurationsList } -// FluxConfigurationsClientUpdateResponse contains the response from method FluxConfigurationsClient.Update. +// FluxConfigurationsClientUpdateResponse contains the response from method FluxConfigurationsClient.BeginUpdate. type FluxConfigurationsClientUpdateResponse struct { FluxConfiguration } @@ -68,12 +69,12 @@ type OperationStatusClientGetResponse struct { OperationStatusResult } -// OperationStatusClientListResponse contains the response from method OperationStatusClient.List. +// OperationStatusClientListResponse contains the response from method OperationStatusClient.NewListPager. type OperationStatusClientListResponse struct { OperationStatusList } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { ResourceProviderOperationList } @@ -83,7 +84,7 @@ type SourceControlConfigurationsClientCreateOrUpdateResponse struct { SourceControlConfiguration } -// SourceControlConfigurationsClientDeleteResponse contains the response from method SourceControlConfigurationsClient.Delete. +// SourceControlConfigurationsClientDeleteResponse contains the response from method SourceControlConfigurationsClient.BeginDelete. type SourceControlConfigurationsClientDeleteResponse struct { // placeholder for future response values } @@ -93,7 +94,7 @@ type SourceControlConfigurationsClientGetResponse struct { SourceControlConfiguration } -// SourceControlConfigurationsClientListResponse contains the response from method SourceControlConfigurationsClient.List. +// SourceControlConfigurationsClientListResponse contains the response from method SourceControlConfigurationsClient.NewListPager. type SourceControlConfigurationsClientListResponse struct { SourceControlConfigurationList } diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_sourcecontrolconfigurations_client.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client.go similarity index 83% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_sourcecontrolconfigurations_client.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_client.go index f7d0419d688e..71d8a9cd7f64 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_sourcecontrolconfigurations_client.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/sourcecontrolconfigurations_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 armkubernetesconfiguration @@ -31,9 +32,9 @@ type SourceControlConfigurationsClient struct { } // NewSourceControlConfigurationsClient creates a new instance of SourceControlConfigurationsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSourceControlConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SourceControlConfigurationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewSourceControlConfigurationsClient(subscriptionID string, credential azco // CreateOrUpdate - Create a new Kubernetes Source Control Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// sourceControlConfigurationName - Name of the Source Control Configuration. -// sourceControlConfiguration - Properties necessary to Create KubernetesConfiguration. -// options - SourceControlConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SourceControlConfigurationsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - sourceControlConfigurationName - Name of the Source Control Configuration. +// - sourceControlConfiguration - Properties necessary to Create KubernetesConfiguration. +// - options - SourceControlConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SourceControlConfigurationsClient.CreateOrUpdate +// method. func (client *SourceControlConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration SourceControlConfiguration, options *SourceControlConfigurationsClientCreateOrUpdateOptions) (SourceControlConfigurationsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, sourceControlConfiguration, options) if err != nil { @@ -112,7 +114,7 @@ func (client *SourceControlConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, sourceControlConfiguration) @@ -130,14 +132,15 @@ func (client *SourceControlConfigurationsClient) createOrUpdateHandleResponse(re // BeginDelete - This will delete the YAML file used to set up the Source control configuration, thus stopping future sync // from the source repo. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// sourceControlConfigurationName - Name of the Source Control Configuration. -// options - SourceControlConfigurationsClientBeginDeleteOptions contains the optional parameters for the SourceControlConfigurationsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - sourceControlConfigurationName - Name of the Source Control Configuration. +// - options - SourceControlConfigurationsClientBeginDeleteOptions contains the optional parameters for the SourceControlConfigurationsClient.BeginDelete +// method. func (client *SourceControlConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, options *SourceControlConfigurationsClientBeginDeleteOptions) (*runtime.Poller[SourceControlConfigurationsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, options) @@ -153,7 +156,8 @@ func (client *SourceControlConfigurationsClient) BeginDelete(ctx context.Context // Delete - This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from // the source repo. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *SourceControlConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, options *SourceControlConfigurationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, options) if err != nil { @@ -201,7 +205,7 @@ func (client *SourceControlConfigurationsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,14 +213,15 @@ func (client *SourceControlConfigurationsClient) deleteCreateRequest(ctx context // Get - Gets details of the Source Control Configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// sourceControlConfigurationName - Name of the Source Control Configuration. -// options - SourceControlConfigurationsClientGetOptions contains the optional parameters for the SourceControlConfigurationsClient.Get -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - sourceControlConfigurationName - Name of the Source Control Configuration. +// - options - SourceControlConfigurationsClientGetOptions contains the optional parameters for the SourceControlConfigurationsClient.Get +// method. func (client *SourceControlConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, options *SourceControlConfigurationsClientGetOptions) (SourceControlConfigurationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, options) if err != nil { @@ -264,7 +269,7 @@ func (client *SourceControlConfigurationsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,14 +285,14 @@ func (client *SourceControlConfigurationsClient) getHandleResponse(resp *http.Re } // NewListPager - List all Source Control Configurations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. -// clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. -// clusterName - The name of the kubernetes cluster. -// options - SourceControlConfigurationsClientListOptions contains the optional parameters for the SourceControlConfigurationsClient.List -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterRp - The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. +// - clusterResourceName - The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. +// - clusterName - The name of the kubernetes cluster. +// - options - SourceControlConfigurationsClientListOptions contains the optional parameters for the SourceControlConfigurationsClient.NewListPager +// method. func (client *SourceControlConfigurationsClient) NewListPager(resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, options *SourceControlConfigurationsClientListOptions) *runtime.Pager[SourceControlConfigurationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SourceControlConfigurationsClientListResponse]{ More: func(page SourceControlConfigurationsClientListResponse) bool { @@ -344,7 +349,7 @@ func (client *SourceControlConfigurationsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_time_rfc3339.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/time_rfc3339.go index c0ab0dd359ba..05cf41fd7ceb 100644 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/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 armkubernetesconfiguration @@ -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/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_extensions_client_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_extensions_client_test.go deleted file mode 100644 index 4609cfac60f5..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_extensions_client_test.go +++ /dev/null @@ -1,188 +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 armkubernetesconfiguration_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/kubernetesconfiguration/armkubernetesconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateExtension.json -func ExampleExtensionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewExtensionsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "ClusterMonitor", - armkubernetesconfiguration.Extension{ - Properties: &armkubernetesconfiguration.ExtensionProperties{ - AutoUpgradeMinorVersion: to.Ptr(true), - ConfigurationProtectedSettings: map[string]*string{ - "omsagent.secret.key": to.Ptr("secretKeyValue01"), - }, - ConfigurationSettings: map[string]*string{ - "omsagent.env.clusterName": to.Ptr("clusterName1"), - "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - }, - ExtensionType: to.Ptr("azuremonitor-containers"), - ReleaseTrain: to.Ptr("Preview"), - Scope: &armkubernetesconfiguration.Scope{ - Cluster: &armkubernetesconfiguration.ScopeCluster{ - ReleaseNamespace: to.Ptr("kube-system"), - }, - }, - }, - }, - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetExtension.json -func ExampleExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewExtensionsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "ClusterMonitor", - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/DeleteExtension.json -func ExampleExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewExtensionsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "ClusterMonitor", - &armkubernetesconfiguration.ExtensionsClientBeginDeleteOptions{ForceDelete: 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/PatchExtension.json -func ExampleExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewExtensionsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "ClusterMonitor", - armkubernetesconfiguration.PatchExtension{ - Properties: &armkubernetesconfiguration.PatchExtensionProperties{ - AutoUpgradeMinorVersion: to.Ptr(true), - ConfigurationProtectedSettings: map[string]*string{ - "omsagent.secret.key": to.Ptr("secretKeyValue01"), - }, - ConfigurationSettings: map[string]*string{ - "omsagent.env.clusterName": to.Ptr("clusterName1"), - "omsagent.secret.wsid": to.Ptr("a38cef99-5a89-52ed-b6db-22095c23664b"), - }, - ReleaseTrain: to.Ptr("Preview"), - }, - }, - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListExtensions.json -func ExampleExtensionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewExtensionsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - 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/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_fluxconfigoperationstatus_client_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_fluxconfigoperationstatus_client_test.go deleted file mode 100644 index 0a219cc42fc7..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_fluxconfigoperationstatus_client_test.go +++ /dev/null @@ -1,43 +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 armkubernetesconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetFluxConfigurationAsyncOperationStatus.json -func ExampleFluxConfigOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewFluxConfigOperationStatusClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "srs-fluxconfig", - "99999999-9999-9999-9999-999999999999", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_fluxconfigurations_client_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_fluxconfigurations_client_test.go deleted file mode 100644 index faee842af33b..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_fluxconfigurations_client_test.go +++ /dev/null @@ -1,209 +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 armkubernetesconfiguration_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/kubernetesconfiguration/armkubernetesconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetFluxConfiguration.json -func ExampleFluxConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewFluxConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "srs-fluxconfig", - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateFluxConfiguration.json -func ExampleFluxConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewFluxConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "srs-fluxconfig", - armkubernetesconfiguration.FluxConfiguration{ - Properties: &armkubernetesconfiguration.FluxConfigurationProperties{ - GitRepository: &armkubernetesconfiguration.GitRepositoryDefinition{ - HTTPSCACert: to.Ptr("ZXhhbXBsZWNlcnRpZmljYXRl"), - RepositoryRef: &armkubernetesconfiguration.RepositoryRefDefinition{ - Branch: to.Ptr("master"), - }, - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - URL: to.Ptr("https://github.com/Azure/arc-k8s-demo"), - }, - Kustomizations: map[string]*armkubernetesconfiguration.KustomizationDefinition{ - "srs-kustomization1": { - Path: to.Ptr("./test/path"), - DependsOn: []*string{}, - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - }, - "srs-kustomization2": { - Path: to.Ptr("./other/test/path"), - DependsOn: []*string{ - to.Ptr("srs-kustomization1")}, - Prune: to.Ptr(false), - RetryIntervalInSeconds: to.Ptr[int64](600), - SyncIntervalInSeconds: to.Ptr[int64](600), - TimeoutInSeconds: to.Ptr[int64](600), - }, - }, - Namespace: to.Ptr("srs-namespace"), - Scope: to.Ptr(armkubernetesconfiguration.ScopeTypeCluster), - SourceKind: to.Ptr(armkubernetesconfiguration.SourceKindTypeGitRepository), - Suspend: to.Ptr(false), - }, - }, - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/PatchFluxConfiguration.json -func ExampleFluxConfigurationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewFluxConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "srs-fluxconfig", - armkubernetesconfiguration.FluxConfigurationPatch{ - Properties: &armkubernetesconfiguration.FluxConfigurationPatchProperties{ - GitRepository: &armkubernetesconfiguration.GitRepositoryPatchDefinition{ - URL: to.Ptr("https://github.com/jonathan-innis/flux2-kustomize-helm-example.git"), - }, - Kustomizations: map[string]*armkubernetesconfiguration.KustomizationPatchDefinition{ - "srs-kustomization1": nil, - "srs-kustomization2": { - Path: to.Ptr("./test/alt-path"), - SyncIntervalInSeconds: to.Ptr[int64](300), - }, - "srs-kustomization3": { - Path: to.Ptr("./test/another-path"), - SyncIntervalInSeconds: to.Ptr[int64](300), - }, - }, - Suspend: to.Ptr(true), - }, - }, - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/DeleteFluxConfiguration.json -func ExampleFluxConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewFluxConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "srs-fluxconfig", - &armkubernetesconfiguration.FluxConfigurationsClientBeginDeleteOptions{ForceDelete: 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListFluxConfigurations.json -func ExampleFluxConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewFluxConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - 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/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_operations_client_test.go deleted file mode 100644 index 6b22c55b4660..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/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 armkubernetesconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.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/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_operationstatus_client_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_operationstatus_client_test.go deleted file mode 100644 index d11010db641d..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_operationstatus_client_test.go +++ /dev/null @@ -1,71 +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 armkubernetesconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetExtensionAsyncOperationStatus.json -func ExampleOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewOperationStatusClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "ClusterMonitor", - "99999999-9999-9999-9999-999999999999", - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListAsyncOperationStatus.json -func ExampleOperationStatusClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewOperationStatusClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - 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/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_sourcecontrolconfigurations_client_test.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_sourcecontrolconfigurations_client_test.go deleted file mode 100644 index 1d75f32db32d..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/ze_generated_example_sourcecontrolconfigurations_client_test.go +++ /dev/null @@ -1,142 +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 armkubernetesconfiguration_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/kubernetesconfiguration/armkubernetesconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/GetSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewSourceControlConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "SRS_GitHubConfig", - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/CreateSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewSourceControlConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "SRS_GitHubConfig", - armkubernetesconfiguration.SourceControlConfiguration{ - Properties: &armkubernetesconfiguration.SourceControlConfigurationProperties{ - ConfigurationProtectedSettings: map[string]*string{ - "protectedSetting1Key": to.Ptr("protectedSetting1Value"), - }, - EnableHelmOperator: to.Ptr(true), - HelmOperatorProperties: &armkubernetesconfiguration.HelmOperatorProperties{ - ChartValues: to.Ptr("--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"), - ChartVersion: to.Ptr("0.3.0"), - }, - OperatorInstanceName: to.Ptr("SRSGitHubFluxOp-01"), - OperatorNamespace: to.Ptr("SRS_Namespace"), - OperatorParams: to.Ptr("--git-email=xyzgituser@users.srs.github.com"), - OperatorScope: to.Ptr(armkubernetesconfiguration.OperatorScopeTypeNamespace), - OperatorType: to.Ptr(armkubernetesconfiguration.OperatorTypeFlux), - RepositoryURL: to.Ptr("git@github.com:k8sdeveloper425/flux-get-started"), - SSHKnownHostsContents: to.Ptr("c3NoLmRldi5henVyZS5jb20gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0hyMW9UV3FOcU9sekdKT2ZHSjROYWtWeUl6ZjFyWFlkNGQ3d282akJsa0x2Q0E0b2RCbEwwbURVeVowL1FVZlRUcWV1K3RtMjJnT3N2K1ZyVlRNazZ2d1JVNzVnWS95OXV0NU1iM2JSNUJWNThkS1h5cTlBOVVlQjVDYWtlaG41WmdtNngxbUtvVnlmK0ZGbjI2aVlxWEpSZ3pJWlpjWjVWNmhyRTBRZzM5a1ptNGF6NDhvMEFVYmY2U3A0U0xkdm51TWEyc1ZOd0hCYm9TN0VKa201N1hRUFZVMy9RcHlOTEhiV0Rkend0cmxTK2V6MzBTM0FkWWhMS0VPeEFHOHdlT255cnRMSkFVZW45bVRrb2w4b0lJMWVkZjdtV1diV1ZmMG5CbWx5MjErblpjbUNUSVNRQnRkY3lQYUVubzdmRlFNREQyNi9zMGxmS29iNEt3OEg="), - }, - }, - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/DeleteSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewSourceControlConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - "SRS_GitHubConfig", - 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/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2022-03-01/examples/ListSourceControlConfiguration.json -func ExampleSourceControlConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkubernetesconfiguration.NewSourceControlConfigurationsClient("subId1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "Microsoft.Kubernetes", - "connectedClusters", - "clusterName1", - 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/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_models_serde.go b/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_models_serde.go deleted file mode 100644 index e84b159cc838..000000000000 --- a/sdk/resourcemanager/kubernetesconfiguration/armkubernetesconfiguration/zz_generated_models_serde.go +++ /dev/null @@ -1,379 +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 armkubernetesconfiguration - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ComplianceStatus. -func (c ComplianceStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "complianceState", c.ComplianceState) - populateTimeRFC3339(objectMap, "lastConfigApplied", c.LastConfigApplied) - populate(objectMap, "message", c.Message) - populate(objectMap, "messageLevel", c.MessageLevel) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceStatus. -func (c *ComplianceStatus) 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 "complianceState": - err = unpopulate(val, "ComplianceState", &c.ComplianceState) - delete(rawMsg, key) - case "lastConfigApplied": - err = unpopulateTimeRFC3339(val, "LastConfigApplied", &c.LastConfigApplied) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &c.Message) - delete(rawMsg, key) - case "messageLevel": - err = unpopulate(val, "MessageLevel", &c.MessageLevel) - 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 ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ExtensionProperties. -func (e ExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aksAssignedIdentity", e.AksAssignedIdentity) - populate(objectMap, "autoUpgradeMinorVersion", e.AutoUpgradeMinorVersion) - populate(objectMap, "configurationProtectedSettings", e.ConfigurationProtectedSettings) - populate(objectMap, "configurationSettings", e.ConfigurationSettings) - populate(objectMap, "customLocationSettings", e.CustomLocationSettings) - populate(objectMap, "errorInfo", e.ErrorInfo) - populate(objectMap, "extensionType", e.ExtensionType) - populate(objectMap, "installedVersion", e.InstalledVersion) - populate(objectMap, "packageUri", e.PackageURI) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "releaseTrain", e.ReleaseTrain) - populate(objectMap, "scope", e.Scope) - populate(objectMap, "statuses", e.Statuses) - populate(objectMap, "version", e.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FluxConfigurationPatch. -func (f FluxConfigurationPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", f.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FluxConfigurationPatchProperties. -func (f FluxConfigurationPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bucket", f.Bucket) - populate(objectMap, "configurationProtectedSettings", f.ConfigurationProtectedSettings) - populate(objectMap, "gitRepository", f.GitRepository) - populate(objectMap, "kustomizations", f.Kustomizations) - populate(objectMap, "sourceKind", f.SourceKind) - populate(objectMap, "suspend", f.Suspend) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FluxConfigurationProperties. -func (f FluxConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bucket", f.Bucket) - populate(objectMap, "complianceState", f.ComplianceState) - populate(objectMap, "configurationProtectedSettings", f.ConfigurationProtectedSettings) - populate(objectMap, "errorMessage", f.ErrorMessage) - populate(objectMap, "gitRepository", f.GitRepository) - populate(objectMap, "kustomizations", f.Kustomizations) - populate(objectMap, "namespace", f.Namespace) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "repositoryPublicKey", f.RepositoryPublicKey) - populate(objectMap, "scope", f.Scope) - populate(objectMap, "sourceKind", f.SourceKind) - populate(objectMap, "sourceSyncedCommitId", f.SourceSyncedCommitID) - populateTimeRFC3339(objectMap, "sourceUpdatedAt", f.SourceUpdatedAt) - populateTimeRFC3339(objectMap, "statusUpdatedAt", f.StatusUpdatedAt) - populate(objectMap, "statuses", f.Statuses) - populate(objectMap, "suspend", f.Suspend) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FluxConfigurationProperties. -func (f *FluxConfigurationProperties) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bucket": - err = unpopulate(val, "Bucket", &f.Bucket) - delete(rawMsg, key) - case "complianceState": - err = unpopulate(val, "ComplianceState", &f.ComplianceState) - delete(rawMsg, key) - case "configurationProtectedSettings": - err = unpopulate(val, "ConfigurationProtectedSettings", &f.ConfigurationProtectedSettings) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &f.ErrorMessage) - delete(rawMsg, key) - case "gitRepository": - err = unpopulate(val, "GitRepository", &f.GitRepository) - delete(rawMsg, key) - case "kustomizations": - err = unpopulate(val, "Kustomizations", &f.Kustomizations) - delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &f.Namespace) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) - delete(rawMsg, key) - case "repositoryPublicKey": - err = unpopulate(val, "RepositoryPublicKey", &f.RepositoryPublicKey) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &f.Scope) - delete(rawMsg, key) - case "sourceKind": - err = unpopulate(val, "SourceKind", &f.SourceKind) - delete(rawMsg, key) - case "sourceSyncedCommitId": - err = unpopulate(val, "SourceSyncedCommitID", &f.SourceSyncedCommitID) - delete(rawMsg, key) - case "sourceUpdatedAt": - err = unpopulateTimeRFC3339(val, "SourceUpdatedAt", &f.SourceUpdatedAt) - delete(rawMsg, key) - case "statusUpdatedAt": - err = unpopulateTimeRFC3339(val, "StatusUpdatedAt", &f.StatusUpdatedAt) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &f.Statuses) - delete(rawMsg, key) - case "suspend": - err = unpopulate(val, "Suspend", &f.Suspend) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KustomizationDefinition. -func (k KustomizationDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dependsOn", k.DependsOn) - populate(objectMap, "force", k.Force) - populate(objectMap, "name", k.Name) - populate(objectMap, "path", k.Path) - populate(objectMap, "prune", k.Prune) - populate(objectMap, "retryIntervalInSeconds", k.RetryIntervalInSeconds) - populate(objectMap, "syncIntervalInSeconds", k.SyncIntervalInSeconds) - populate(objectMap, "timeoutInSeconds", k.TimeoutInSeconds) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type KustomizationPatchDefinition. -func (k KustomizationPatchDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dependsOn", k.DependsOn) - populate(objectMap, "force", k.Force) - populate(objectMap, "path", k.Path) - populate(objectMap, "prune", k.Prune) - populate(objectMap, "retryIntervalInSeconds", k.RetryIntervalInSeconds) - populate(objectMap, "syncIntervalInSeconds", k.SyncIntervalInSeconds) - populate(objectMap, "timeoutInSeconds", k.TimeoutInSeconds) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ObjectStatusConditionDefinition. -func (o ObjectStatusConditionDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastTransitionTime", o.LastTransitionTime) - populate(objectMap, "message", o.Message) - populate(objectMap, "reason", o.Reason) - populate(objectMap, "status", o.Status) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectStatusConditionDefinition. -func (o *ObjectStatusConditionDefinition) 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 "lastTransitionTime": - err = unpopulateTimeRFC3339(val, "LastTransitionTime", &o.LastTransitionTime) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &o.Message) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &o.Reason) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) - 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 ObjectStatusDefinition. -func (o ObjectStatusDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appliedBy", o.AppliedBy) - populate(objectMap, "complianceState", o.ComplianceState) - populate(objectMap, "helmReleaseProperties", o.HelmReleaseProperties) - populate(objectMap, "kind", o.Kind) - populate(objectMap, "name", o.Name) - populate(objectMap, "namespace", o.Namespace) - populate(objectMap, "statusConditions", o.StatusConditions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PatchExtension. -func (p PatchExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PatchExtensionProperties. -func (p PatchExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoUpgradeMinorVersion", p.AutoUpgradeMinorVersion) - populate(objectMap, "configurationProtectedSettings", p.ConfigurationProtectedSettings) - populate(objectMap, "configurationSettings", p.ConfigurationSettings) - populate(objectMap, "releaseTrain", p.ReleaseTrain) - populate(objectMap, "version", p.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SourceControlConfigurationProperties. -func (s SourceControlConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "complianceStatus", s.ComplianceStatus) - populate(objectMap, "configurationProtectedSettings", s.ConfigurationProtectedSettings) - populate(objectMap, "enableHelmOperator", s.EnableHelmOperator) - populate(objectMap, "helmOperatorProperties", s.HelmOperatorProperties) - populate(objectMap, "operatorInstanceName", s.OperatorInstanceName) - populate(objectMap, "operatorNamespace", s.OperatorNamespace) - populate(objectMap, "operatorParams", s.OperatorParams) - populate(objectMap, "operatorScope", s.OperatorScope) - populate(objectMap, "operatorType", s.OperatorType) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "repositoryPublicKey", s.RepositoryPublicKey) - populate(objectMap, "repositoryUrl", s.RepositoryURL) - populate(objectMap, "sshKnownHostsContents", s.SSHKnownHostsContents) - return json.Marshal(objectMap) -} - -// 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 -} - -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 -}