diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/CHANGELOG.md b/sdk/resourcemanager/resourceconnector/armresourceconnector/CHANGELOG.md index 40b0c9485ac5..dbaded188d3c 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/CHANGELOG.md +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/CHANGELOG.md @@ -1,5 +1,43 @@ # Release History +## 0.2.0 (2022-06-27) +### Features Added + +- New const `StatusWaitingForCloudOperator` +- New const `SSHKeyTypeSSHCustomerUser` +- New const `StatusUpgradeFailed` +- New const `StatusConnecting` +- New const `StatusOffline` +- New const `StatusPreUpgrade` +- New const `StatusUpgradePrerequisitesCompleted` +- New const `ProviderKubeVirt` +- New const `StatusPreparingForUpgrade` +- New const `StatusPostUpgrade` +- New const `StatusNone` +- New const `StatusUpdatingCluster` +- New const `StatusUpdatingCloudOperator` +- New const `StatusUpgradeComplete` +- New const `ProviderOpenStack` +- New const `StatusUpgradeClusterExtensionFailedToDelete` +- New const `AccessProfileTypeClusterCustomerUser` +- New const `StatusUpdatingCAPI` +- New function `*AppliancesClient.GetUpgradeGraph(context.Context, string, string, string, *AppliancesClientGetUpgradeGraphOptions) (AppliancesClientGetUpgradeGraphResponse, error)` +- New function `*AppliancesClient.ListClusterCustomerUserCredential(context.Context, string, string, *AppliancesClientListClusterCustomerUserCredentialOptions) (AppliancesClientListClusterCustomerUserCredentialResponse, error)` +- New function `PossibleSSHKeyTypeValues() []SSHKeyType` +- New struct `ApplianceListClusterCustomerUserCredentialResults` +- New struct `AppliancesClientGetUpgradeGraphOptions` +- New struct `AppliancesClientGetUpgradeGraphResponse` +- New struct `AppliancesClientListClusterCustomerUserCredentialOptions` +- New struct `AppliancesClientListClusterCustomerUserCredentialResponse` +- New struct `SSHKey` +- New struct `SupportedVersion` +- New struct `SupportedVersionCatalogVersion` +- New struct `SupportedVersionCatalogVersionData` +- New struct `SupportedVersionMetadata` +- New struct `UpgradeGraph` +- New struct `UpgradeGraphProperties` + + ## 0.1.0 (2022-06-10) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourceconnector/armresourceconnector` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 0.1.0, which contains breaking changes. diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_appliances_client.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/appliances_client.go similarity index 77% rename from sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_appliances_client.go rename to sdk/resourcemanager/resourceconnector/armresourceconnector/appliances_client.go index 3ebfdb28b770..be326947d1a6 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_appliances_client.go +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/appliances_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 armresourceconnector @@ -56,7 +57,7 @@ func NewAppliancesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates an Appliance in the specified Subscription and Resource Group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - Appliances name. // parameters - Parameters supplied to create or update an Appliance. @@ -78,7 +79,7 @@ func (client *AppliancesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates an Appliance in the specified Subscription and Resource Group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview func (client *AppliancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters Appliance, options *AppliancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -114,7 +115,7 @@ func (client *AppliancesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +123,7 @@ func (client *AppliancesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - Appliances name. // options - AppliancesClientBeginDeleteOptions contains the optional parameters for the AppliancesClient.BeginDelete method. @@ -142,7 +143,7 @@ func (client *AppliancesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview func (client *AppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *AppliancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -178,7 +179,7 @@ func (client *AppliancesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +187,7 @@ func (client *AppliancesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the details of an Appliance with a specified resource group and name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - Appliances name. // options - AppliancesClientGetOptions contains the optional parameters for the AppliancesClient.Get method. @@ -225,7 +226,7 @@ func (client *AppliancesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,10 +241,73 @@ func (client *AppliancesClient) getHandleResponse(resp *http.Response) (Applianc return result, nil } +// GetUpgradeGraph - Gets the upgrade graph of an Appliance with a specified resource group and name and specific release +// train. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - Appliances name. +// upgradeGraph - Upgrade graph version, ex - stable +// options - AppliancesClientGetUpgradeGraphOptions contains the optional parameters for the AppliancesClient.GetUpgradeGraph +// method. +func (client *AppliancesClient) GetUpgradeGraph(ctx context.Context, resourceGroupName string, resourceName string, upgradeGraph string, options *AppliancesClientGetUpgradeGraphOptions) (AppliancesClientGetUpgradeGraphResponse, error) { + req, err := client.getUpgradeGraphCreateRequest(ctx, resourceGroupName, resourceName, upgradeGraph, options) + if err != nil { + return AppliancesClientGetUpgradeGraphResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppliancesClientGetUpgradeGraphResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppliancesClientGetUpgradeGraphResponse{}, runtime.NewResponseError(resp) + } + return client.getUpgradeGraphHandleResponse(resp) +} + +// getUpgradeGraphCreateRequest creates the GetUpgradeGraph request. +func (client *AppliancesClient) getUpgradeGraphCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, upgradeGraph string, options *AppliancesClientGetUpgradeGraphOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/upgradeGraphs/{upgradeGraph}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if upgradeGraph == "" { + return nil, errors.New("parameter upgradeGraph cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{upgradeGraph}", url.PathEscape(upgradeGraph)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getUpgradeGraphHandleResponse handles the GetUpgradeGraph response. +func (client *AppliancesClient) getUpgradeGraphHandleResponse(resp *http.Response) (AppliancesClientGetUpgradeGraphResponse, error) { + result := AppliancesClientGetUpgradeGraphResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpgradeGraph); err != nil { + return AppliancesClientGetUpgradeGraphResponse{}, err + } + return result, nil +} + // NewListByResourceGroupPager - Gets a list of Appliances in the specified subscription and resource group. The operation // returns properties of each Appliance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - AppliancesClientListByResourceGroupOptions contains the optional parameters for the AppliancesClient.ListByResourceGroup // method. @@ -291,7 +355,7 @@ func (client *AppliancesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,7 +373,7 @@ func (client *AppliancesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Gets a list of Appliances in the specified subscription. The operation returns properties // of each Appliance // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // options - AppliancesClientListBySubscriptionOptions contains the optional parameters for the AppliancesClient.ListBySubscription // method. func (client *AppliancesClient) NewListBySubscriptionPager(options *AppliancesClientListBySubscriptionOptions) *runtime.Pager[AppliancesClientListBySubscriptionResponse] { @@ -352,7 +416,7 @@ func (client *AppliancesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,9 +431,66 @@ func (client *AppliancesClient) listBySubscriptionHandleResponse(resp *http.Resp return result, nil } +// ListClusterCustomerUserCredential - Returns the cluster customer user credentials for the dedicated appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - Appliances name. +// options - AppliancesClientListClusterCustomerUserCredentialOptions contains the optional parameters for the AppliancesClient.ListClusterCustomerUserCredential +// method. +func (client *AppliancesClient) ListClusterCustomerUserCredential(ctx context.Context, resourceGroupName string, resourceName string, options *AppliancesClientListClusterCustomerUserCredentialOptions) (AppliancesClientListClusterCustomerUserCredentialResponse, error) { + req, err := client.listClusterCustomerUserCredentialCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return AppliancesClientListClusterCustomerUserCredentialResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppliancesClientListClusterCustomerUserCredentialResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppliancesClientListClusterCustomerUserCredentialResponse{}, runtime.NewResponseError(resp) + } + return client.listClusterCustomerUserCredentialHandleResponse(resp) +} + +// listClusterCustomerUserCredentialCreateRequest creates the ListClusterCustomerUserCredential request. +func (client *AppliancesClient) listClusterCustomerUserCredentialCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *AppliancesClientListClusterCustomerUserCredentialOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/listClusterCustomerUserCredential" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listClusterCustomerUserCredentialHandleResponse handles the ListClusterCustomerUserCredential response. +func (client *AppliancesClient) listClusterCustomerUserCredentialHandleResponse(resp *http.Response) (AppliancesClientListClusterCustomerUserCredentialResponse, error) { + result := AppliancesClientListClusterCustomerUserCredentialResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplianceListClusterCustomerUserCredentialResults); err != nil { + return AppliancesClientListClusterCustomerUserCredentialResponse{}, err + } + return result, nil +} + // ListClusterUserCredential - Returns the cluster user credentials for the dedicated appliance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - Appliances name. // options - AppliancesClientListClusterUserCredentialOptions contains the optional parameters for the AppliancesClient.ListClusterUserCredential @@ -409,7 +530,7 @@ func (client *AppliancesClient) listClusterUserCredentialCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +547,7 @@ func (client *AppliancesClient) listClusterUserCredentialHandleResponse(resp *ht // NewListOperationsPager - Lists all available Appliances operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // options - AppliancesClientListOperationsOptions contains the optional parameters for the AppliancesClient.ListOperations // method. func (client *AppliancesClient) NewListOperationsPager(options *AppliancesClientListOperationsOptions) *runtime.Pager[AppliancesClientListOperationsResponse] { @@ -465,7 +586,7 @@ func (client *AppliancesClient) listOperationsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -482,7 +603,7 @@ func (client *AppliancesClient) listOperationsHandleResponse(resp *http.Response // Update - Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-31-preview +// Generated from API version 2022-04-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - Appliances name. // parameters - The updatable fields of an existing Appliance. @@ -522,7 +643,7 @@ func (client *AppliancesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-31-preview") + reqQP.Set("api-version", "2022-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/autorest.md b/sdk/resourcemanager/resourceconnector/armresourceconnector/autorest.md index 47020006a213..b95dde9de560 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/autorest.md +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/resourceconnector/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/resourceconnector/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resourceconnector/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resourceconnector/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 +module-version: 0.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_constants.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/constants.go similarity index 53% rename from sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_constants.go rename to sdk/resourcemanager/resourceconnector/armresourceconnector/constants.go index e05be859510c..28293e2faaaa 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_constants.go +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/constants.go @@ -5,24 +5,27 @@ // 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 armresourceconnector const ( moduleName = "armresourceconnector" - moduleVersion = "v0.1.0" + moduleVersion = "v0.2.0" ) // AccessProfileType - Name which contains the role of the kubeconfig. type AccessProfileType string const ( - AccessProfileTypeClusterUser AccessProfileType = "clusterUser" + AccessProfileTypeClusterCustomerUser AccessProfileType = "clusterCustomerUser" + AccessProfileTypeClusterUser AccessProfileType = "clusterUser" ) // PossibleAccessProfileTypeValues returns the possible values for the AccessProfileType const type. func PossibleAccessProfileTypeValues() []AccessProfileType { return []AccessProfileType{ + AccessProfileTypeClusterCustomerUser, AccessProfileTypeClusterUser, } } @@ -65,15 +68,19 @@ func PossibleDistroValues() []Distro { type Provider string const ( - ProviderHCI Provider = "HCI" - ProviderSCVMM Provider = "SCVMM" - ProviderVMWare Provider = "VMWare" + ProviderHCI Provider = "HCI" + ProviderKubeVirt Provider = "KubeVirt" + ProviderOpenStack Provider = "OpenStack" + ProviderSCVMM Provider = "SCVMM" + ProviderVMWare Provider = "VMWare" ) // PossibleProviderValues returns the possible values for the Provider const type. func PossibleProviderValues() []Provider { return []Provider{ ProviderHCI, + ProviderKubeVirt, + ProviderOpenStack, ProviderSCVMM, ProviderVMWare, } @@ -95,22 +102,64 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { } } +// SSHKeyType - Appliance SSHKeyType definition. +type SSHKeyType string + +const ( + SSHKeyTypeSSHCustomerUser SSHKeyType = "SSHCustomerUser" +) + +// PossibleSSHKeyTypeValues returns the possible values for the SSHKeyType const type. +func PossibleSSHKeyTypeValues() []SSHKeyType { + return []SSHKeyType{ + SSHKeyTypeSSHCustomerUser, + } +} + // Status - Appliance’s health and state of connection to on-prem type Status string const ( - StatusConnected Status = "Connected" - StatusRunning Status = "Running" - StatusValidating Status = "Validating" - StatusWaitingForHeartbeat Status = "WaitingForHeartbeat" + StatusConnected Status = "Connected" + StatusConnecting Status = "Connecting" + StatusNone Status = "None" + StatusOffline Status = "Offline" + StatusPostUpgrade Status = "PostUpgrade" + StatusPreUpgrade Status = "PreUpgrade" + StatusPreparingForUpgrade Status = "PreparingForUpgrade" + StatusRunning Status = "Running" + StatusUpdatingCAPI Status = "UpdatingCAPI" + StatusUpdatingCloudOperator Status = "UpdatingCloudOperator" + StatusUpdatingCluster Status = "UpdatingCluster" + StatusUpgradeClusterExtensionFailedToDelete Status = "UpgradeClusterExtensionFailedToDelete" + StatusUpgradeComplete Status = "UpgradeComplete" + StatusUpgradeFailed Status = "UpgradeFailed" + StatusUpgradePrerequisitesCompleted Status = "UpgradePrerequisitesCompleted" + StatusValidating Status = "Validating" + StatusWaitingForCloudOperator Status = "WaitingForCloudOperator" + StatusWaitingForHeartbeat Status = "WaitingForHeartbeat" ) // PossibleStatusValues returns the possible values for the Status const type. func PossibleStatusValues() []Status { return []Status{ StatusConnected, + StatusConnecting, + StatusNone, + StatusOffline, + StatusPostUpgrade, + StatusPreUpgrade, + StatusPreparingForUpgrade, StatusRunning, + StatusUpdatingCAPI, + StatusUpdatingCloudOperator, + StatusUpdatingCluster, + StatusUpgradeClusterExtensionFailedToDelete, + StatusUpgradeComplete, + StatusUpgradeFailed, + StatusUpgradePrerequisitesCompleted, StatusValidating, + StatusWaitingForCloudOperator, StatusWaitingForHeartbeat, } } diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/go.mod b/sdk/resourcemanager/resourceconnector/armresourceconnector/go.mod index f9d6d73463b6..6129d65675c5 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/go.mod +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourceconnector/a go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.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.5.1 // 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/resourceconnector/armresourceconnector/go.sum b/sdk/resourcemanager/resourceconnector/armresourceconnector/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/go.sum +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/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.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= 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.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/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/resourceconnector/armresourceconnector/zz_generated_models.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/models.go similarity index 75% rename from sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_models.go rename to sdk/resourcemanager/resourceconnector/armresourceconnector/models.go index b692b439488c..efff732a8ecf 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_models.go +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armresourceconnector @@ -46,6 +47,15 @@ type ApplianceCredentialKubeconfig struct { Value *string `json:"value,omitempty" azure:"ro"` } +// ApplianceListClusterCustomerUserCredentialResults - The List Cluster Customer User Credential Results appliance. +type ApplianceListClusterCustomerUserCredentialResults struct { + // READ-ONLY; The list of appliance kubeconfigs. + Kubeconfigs []*ApplianceCredentialKubeconfig `json:"kubeconfigs,omitempty" azure:"ro"` + + // READ-ONLY; Map of Customer User Public and Private SSH Keys + SSHKeys map[string]*SSHKey `json:"sshKeys,omitempty" azure:"ro"` +} + // ApplianceListCredentialResults - The List Cluster User Credential appliance. type ApplianceListCredentialResults struct { // READ-ONLY; Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). @@ -114,14 +124,14 @@ type ApplianceProperties struct { // Certificates pair used to download MSI certificate from HIS PublicKey *string `json:"publicKey,omitempty"` + // Version of the Appliance + Version *string `json:"version,omitempty"` + // READ-ONLY; The current deployment or provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Appliance’s health and state of connection to on-prem Status *Status `json:"status,omitempty" azure:"ro"` - - // READ-ONLY; Version of the Appliance - Version *string `json:"version,omitempty" azure:"ro"` } // AppliancePropertiesInfrastructureConfig - Contains infrastructure information about the Appliance @@ -148,6 +158,11 @@ type AppliancesClientGetOptions struct { // placeholder for future optional parameters } +// AppliancesClientGetUpgradeGraphOptions contains the optional parameters for the AppliancesClient.GetUpgradeGraph method. +type AppliancesClientGetUpgradeGraphOptions struct { + // placeholder for future optional parameters +} + // AppliancesClientListByResourceGroupOptions contains the optional parameters for the AppliancesClient.ListByResourceGroup // method. type AppliancesClientListByResourceGroupOptions struct { @@ -160,6 +175,12 @@ type AppliancesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } +// AppliancesClientListClusterCustomerUserCredentialOptions contains the optional parameters for the AppliancesClient.ListClusterCustomerUserCredential +// method. +type AppliancesClientListClusterCustomerUserCredentialOptions struct { + // placeholder for future optional parameters +} + // AppliancesClientListClusterUserCredentialOptions contains the optional parameters for the AppliancesClient.ListClusterUserCredential // method. type AppliancesClientListClusterUserCredentialOptions struct { @@ -255,6 +276,57 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// SSHKey - Appliance SSHKey definition. +type SSHKey struct { + // User Private Key. + PrivateKey *string `json:"privateKey,omitempty"` + + // User Public Key. + PublicKey *string `json:"publicKey,omitempty"` +} + +// SupportedVersion - The SupportedVersion object for appliance. +type SupportedVersion struct { + // READ-ONLY; This is the metadata of the supported newer version. + Metadata *SupportedVersionMetadata `json:"metadata,omitempty" azure:"ro"` + + // READ-ONLY; The newer version available for upgrade. + Version *string `json:"version,omitempty" azure:"ro"` +} + +// SupportedVersionCatalogVersion - The SupportedVersionCatalogVersion object for appliance. +type SupportedVersionCatalogVersion struct { + // READ-ONLY; The newer supported version catalog version data. + Data *SupportedVersionCatalogVersionData `json:"data,omitempty" azure:"ro"` + + // READ-ONLY; The catalog version name for the version available for upgrade. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The catalog version namespace for the version available for upgrade. + Namespace *string `json:"namespace,omitempty" azure:"ro"` +} + +// SupportedVersionCatalogVersionData - The SupportedVersionCatalogVersionData object for appliance. +type SupportedVersionCatalogVersionData struct { + // READ-ONLY; The image audience name for the version available for upgrade. + Audience *string `json:"audience,omitempty" azure:"ro"` + + // READ-ONLY; The image catalog name for the version available for upgrade. + Catalog *string `json:"catalog,omitempty" azure:"ro"` + + // READ-ONLY; The image offer name for the version available for upgrade. + Offer *string `json:"offer,omitempty" azure:"ro"` + + // READ-ONLY; The image version for the version available for upgrade. + Version *string `json:"version,omitempty" azure:"ro"` +} + +// SupportedVersionMetadata - The SupportedVersionMetadata object for appliance. +type SupportedVersionMetadata struct { + // READ-ONLY; The newer supported version catalog version. + CatalogVersion *SupportedVersionCatalogVersion `json:"catalogVersion,omitempty" azure:"ro"` +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -294,3 +366,24 @@ type TrackedResource struct { // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } + +// UpgradeGraph - The Upgrade Graph for appliance. +type UpgradeGraph struct { + // The properties of supported version + Properties *UpgradeGraphProperties `json:"properties,omitempty"` + + // READ-ONLY; The appliance resource path + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The release train name. + Name *string `json:"name,omitempty" azure:"ro"` +} + +// UpgradeGraphProperties - The Upgrade Graph Properties for appliance. +type UpgradeGraphProperties struct { + // READ-ONLY; The current appliance version + ApplianceVersion *string `json:"applianceVersion,omitempty" azure:"ro"` + + // READ-ONLY; This contains the current version and supported upgrade versions. + SupportedVersions []*SupportedVersion `json:"supportedVersions,omitempty" azure:"ro"` +} diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/models_serde.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/models_serde.go new file mode 100644 index 000000000000..56da93755783 --- /dev/null +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/models_serde.go @@ -0,0 +1,955 @@ +//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 armresourceconnector + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type Appliance. +func (a Appliance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Appliance. +func (a *Appliance) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplianceCredentialKubeconfig. +func (a ApplianceCredentialKubeconfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", a.Name) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceCredentialKubeconfig. +func (a *ApplianceCredentialKubeconfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplianceListClusterCustomerUserCredentialResults. +func (a ApplianceListClusterCustomerUserCredentialResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kubeconfigs", a.Kubeconfigs) + populate(objectMap, "sshKeys", a.SSHKeys) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceListClusterCustomerUserCredentialResults. +func (a *ApplianceListClusterCustomerUserCredentialResults) UnmarshalJSON(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 "kubeconfigs": + err = unpopulate(val, "Kubeconfigs", &a.Kubeconfigs) + delete(rawMsg, key) + case "sshKeys": + err = unpopulate(val, "SSHKeys", &a.SSHKeys) + 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 ApplianceListCredentialResults. +func (a ApplianceListCredentialResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hybridConnectionConfig", a.HybridConnectionConfig) + populate(objectMap, "kubeconfigs", a.Kubeconfigs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceListCredentialResults. +func (a *ApplianceListCredentialResults) UnmarshalJSON(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 "hybridConnectionConfig": + err = unpopulate(val, "HybridConnectionConfig", &a.HybridConnectionConfig) + delete(rawMsg, key) + case "kubeconfigs": + err = unpopulate(val, "Kubeconfigs", &a.Kubeconfigs) + 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 ApplianceListResult. +func (a ApplianceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceListResult. +func (a *ApplianceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplianceOperation. +func (a ApplianceOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", a.Display) + populate(objectMap, "isDataAction", a.IsDataAction) + populate(objectMap, "name", a.Name) + populate(objectMap, "origin", a.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceOperation. +func (a *ApplianceOperation) UnmarshalJSON(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 "display": + err = unpopulate(val, "Display", &a.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &a.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &a.Origin) + 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 ApplianceOperationValueDisplay. +func (a ApplianceOperationValueDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", a.Description) + populate(objectMap, "operation", a.Operation) + populate(objectMap, "provider", a.Provider) + populate(objectMap, "resource", a.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceOperationValueDisplay. +func (a *ApplianceOperationValueDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &a.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &a.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &a.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplianceOperationsList. +func (a ApplianceOperationsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceOperationsList. +func (a *ApplianceOperationsList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplianceProperties. +func (a ApplianceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "distro", a.Distro) + populate(objectMap, "infrastructureConfig", a.InfrastructureConfig) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicKey", a.PublicKey) + populate(objectMap, "status", a.Status) + populate(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceProperties. +func (a *ApplianceProperties) UnmarshalJSON(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 "distro": + err = unpopulate(val, "Distro", &a.Distro) + delete(rawMsg, key) + case "infrastructureConfig": + err = unpopulate(val, "InfrastructureConfig", &a.InfrastructureConfig) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "publicKey": + err = unpopulate(val, "PublicKey", &a.PublicKey) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) + 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 AppliancePropertiesInfrastructureConfig. +func (a AppliancePropertiesInfrastructureConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provider", a.Provider) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppliancePropertiesInfrastructureConfig. +func (a *AppliancePropertiesInfrastructureConfig) UnmarshalJSON(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 "provider": + err = unpopulate(val, "Provider", &a.Provider) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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]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) +} + +// 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]interface{}) + 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 HybridConnectionConfig. +func (h HybridConnectionConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expirationTime", h.ExpirationTime) + populate(objectMap, "hybridConnectionName", h.HybridConnectionName) + populate(objectMap, "relay", h.Relay) + populate(objectMap, "token", h.Token) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HybridConnectionConfig. +func (h *HybridConnectionConfig) UnmarshalJSON(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 "expirationTime": + err = unpopulate(val, "ExpirationTime", &h.ExpirationTime) + delete(rawMsg, key) + case "hybridConnectionName": + err = unpopulate(val, "HybridConnectionName", &h.HybridConnectionName) + delete(rawMsg, key) + case "relay": + err = unpopulate(val, "Relay", &h.Relay) + delete(rawMsg, key) + case "token": + err = unpopulate(val, "Token", &h.Token) + 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]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + 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 PatchableAppliance. +func (p PatchableAppliance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchableAppliance. +func (p *PatchableAppliance) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 SSHKey. +func (s SSHKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateKey", s.PrivateKey) + populate(objectMap, "publicKey", s.PublicKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SSHKey. +func (s *SSHKey) UnmarshalJSON(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 "privateKey": + err = unpopulate(val, "PrivateKey", &s.PrivateKey) + delete(rawMsg, key) + case "publicKey": + err = unpopulate(val, "PublicKey", &s.PublicKey) + 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 SupportedVersion. +func (s SupportedVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metadata", s.Metadata) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedVersion. +func (s *SupportedVersion) UnmarshalJSON(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 "metadata": + err = unpopulate(val, "Metadata", &s.Metadata) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 SupportedVersionCatalogVersion. +func (s SupportedVersionCatalogVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", s.Data) + populate(objectMap, "name", s.Name) + populate(objectMap, "namespace", s.Namespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedVersionCatalogVersion. +func (s *SupportedVersionCatalogVersion) UnmarshalJSON(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 "data": + err = unpopulate(val, "Data", &s.Data) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + 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 SupportedVersionCatalogVersionData. +func (s SupportedVersionCatalogVersionData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "audience", s.Audience) + populate(objectMap, "catalog", s.Catalog) + populate(objectMap, "offer", s.Offer) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedVersionCatalogVersionData. +func (s *SupportedVersionCatalogVersionData) UnmarshalJSON(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 "audience": + err = unpopulate(val, "Audience", &s.Audience) + delete(rawMsg, key) + case "catalog": + err = unpopulate(val, "Catalog", &s.Catalog) + delete(rawMsg, key) + case "offer": + err = unpopulate(val, "Offer", &s.Offer) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 SupportedVersionMetadata. +func (s SupportedVersionMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "catalogVersion", s.CatalogVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedVersionMetadata. +func (s *SupportedVersionMetadata) UnmarshalJSON(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 "catalogVersion": + err = unpopulate(val, "CatalogVersion", &s.CatalogVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpgradeGraph. +func (u UpgradeGraph) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", u.ID) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeGraph. +func (u *UpgradeGraph) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpgradeGraphProperties. +func (u UpgradeGraphProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applianceVersion", u.ApplianceVersion) + populate(objectMap, "supportedVersions", u.SupportedVersions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeGraphProperties. +func (u *UpgradeGraphProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applianceVersion": + err = unpopulate(val, "ApplianceVersion", &u.ApplianceVersion) + delete(rawMsg, key) + case "supportedVersions": + err = unpopulate(val, "SupportedVersions", &u.SupportedVersions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_response_types.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/response_types.go similarity index 79% rename from sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_response_types.go rename to sdk/resourcemanager/resourceconnector/armresourceconnector/response_types.go index ad649bff1222..6ccca8895c76 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_response_types.go +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armresourceconnector @@ -23,6 +24,11 @@ type AppliancesClientGetResponse struct { Appliance } +// AppliancesClientGetUpgradeGraphResponse contains the response from method AppliancesClient.GetUpgradeGraph. +type AppliancesClientGetUpgradeGraphResponse struct { + UpgradeGraph +} + // AppliancesClientListByResourceGroupResponse contains the response from method AppliancesClient.ListByResourceGroup. type AppliancesClientListByResourceGroupResponse struct { ApplianceListResult @@ -33,6 +39,11 @@ type AppliancesClientListBySubscriptionResponse struct { ApplianceListResult } +// AppliancesClientListClusterCustomerUserCredentialResponse contains the response from method AppliancesClient.ListClusterCustomerUserCredential. +type AppliancesClientListClusterCustomerUserCredentialResponse struct { + ApplianceListClusterCustomerUserCredentialResults +} + // AppliancesClientListClusterUserCredentialResponse contains the response from method AppliancesClient.ListClusterUserCredential. type AppliancesClientListClusterUserCredentialResponse struct { ApplianceListCredentialResults diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_time_rfc3339.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/resourceconnector/armresourceconnector/time_rfc3339.go index d05d186da381..591ddd3818b5 100644 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/resourceconnector/armresourceconnector/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 armresourceconnector diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/ze_generated_example_appliances_client_test.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/ze_generated_example_appliances_client_test.go deleted file mode 100644 index 9c51da163edc..000000000000 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/ze_generated_example_appliances_client_test.go +++ /dev/null @@ -1,221 +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 armresourceconnector_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/resourceconnector/armresourceconnector" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesListOperations.json -func ExampleAppliancesClient_NewListOperationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListOperationsPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesListBySubscription.json -func ExampleAppliancesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("11111111-2222-3333-4444-555555555555", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesListByResourceGroup.json -func ExampleAppliancesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("11111111-2222-3333-4444-555555555555", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("testresourcegroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesGet.json -func ExampleAppliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("11111111-2222-3333-4444-555555555555", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testresourcegroup", - "appliance01", - 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/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesCreate_Update.json -func ExampleAppliancesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("11111111-2222-3333-4444-555555555555", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testresourcegroup", - "appliance01", - armresourceconnector.Appliance{ - Location: to.Ptr("West US"), - Properties: &armresourceconnector.ApplianceProperties{ - Distro: to.Ptr(armresourceconnector.DistroAKSEdge), - InfrastructureConfig: &armresourceconnector.AppliancePropertiesInfrastructureConfig{ - Provider: to.Ptr(armresourceconnector.ProviderVMWare), - }, - }, - }, - 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/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesDelete.json -func ExampleAppliancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("11111111-2222-3333-4444-555555555555", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testresourcegroup", - "appliance01", - 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/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesPatch.json -func ExampleAppliancesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("11111111-2222-3333-4444-555555555555", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "testresourcegroup", - "appliance01", - armresourceconnector.PatchableAppliance{ - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, - 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/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2021-10-31-preview/examples/AppliancesListClusterUserCredential.json -func ExampleAppliancesClient_ListClusterUserCredential() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresourceconnector.NewAppliancesClient("11111111-2222-3333-4444-555555555555", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListClusterUserCredential(ctx, - "testresourcegroup", - "testresourcename", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_models_serde.go b/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_models_serde.go deleted file mode 100644 index 11a0a62ded29..000000000000 --- a/sdk/resourcemanager/resourceconnector/armresourceconnector/zz_generated_models_serde.go +++ /dev/null @@ -1,115 +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 armresourceconnector - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type Appliance. -func (a Appliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PatchableAppliance. -func (p PatchableAppliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", p.Tags) - 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 -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -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 -}