diff --git a/sdk/resourcemanager/domainservices/armdomainservices/CHANGELOG.md b/sdk/resourcemanager/domainservices/armdomainservices/CHANGELOG.md index 0f6eb6606da3..a10bfa0722cb 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/CHANGELOG.md +++ b/sdk/resourcemanager/domainservices/armdomainservices/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 2.0.0 (2023-02-06) +### Breaking Changes + +- Struct `CloudError` has been removed +- Struct `CloudErrorBody` has been removed + +### Features Added + +- New type alias `ChannelBinding` with values `ChannelBindingDisabled`, `ChannelBindingEnabled` +- New type alias `LdapSigning` with values `LdapSigningDisabled`, `LdapSigningEnabled` +- New type alias `SyncScope` with values `SyncScopeAll`, `SyncScopeCloudOnly` +- New field `ChannelBinding` in struct `DomainSecuritySettings` +- New field `LdapSigning` in struct `DomainSecuritySettings` +- New field `SyncApplicationID` in struct `DomainServiceProperties` +- New field `SyncScope` in struct `DomainServiceProperties` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainservices/armdomainservices` 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/domainservices/armdomainservices/autorest.md b/sdk/resourcemanager/domainservices/armdomainservices/autorest.md index 32ec46be3360..504844d4a9b0 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/autorest.md +++ b/sdk/resourcemanager/domainservices/armdomainservices/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/domainservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/domainservices/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/domainservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/domainservices/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/domainservices/armdomainservices/zz_generated_client.go b/sdk/resourcemanager/domainservices/armdomainservices/client.go similarity index 86% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_client.go rename to sdk/resourcemanager/domainservices/armdomainservices/client.go index 65e8fe83021c..182cf9f0f113 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_client.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/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 armdomainservices @@ -31,10 +32,10 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,11 +60,12 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // the specific service already exists, then any patchable properties will be updated and any immutable // properties will remain unchanged. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// domainService - Properties supplied to the Create or Update a Domain Service operation. -// options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - domainService - Properties supplied to the Create or Update a Domain Service operation. +// - options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, domainServiceName string, domainService DomainService, options *ClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, domainServiceName, domainService, options) @@ -80,7 +82,8 @@ func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName // specific service already exists, then any patchable properties will be updated and any immutable // properties will remain unchanged. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// +// Generated from API version 2022-12-01 func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, domainServiceName string, domainService DomainService, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainServiceName, domainService, options) if err != nil { @@ -116,7 +119,7 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainService) @@ -124,10 +127,11 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG // BeginDelete - The Delete Domain Service operation deletes an existing Domain Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, domainServiceName string, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, domainServiceName, options) @@ -142,7 +146,8 @@ func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, // Delete - The Delete Domain Service operation deletes an existing Domain Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// +// Generated from API version 2022-12-01 func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, domainServiceName string, options *ClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainServiceName, options) if err != nil { @@ -178,7 +183,7 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,10 +191,11 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName // Get - The Get Domain Service operation retrieves a json representation of the Domain Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// options - ClientGetOptions contains the optional parameters for the Client.Get method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - options - ClientGetOptions contains the optional parameters for the Client.Get method. func (client *Client) Get(ctx context.Context, resourceGroupName string, domainServiceName string, options *ClientGetOptions) (ClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, domainServiceName, options) if err != nil { @@ -225,7 +231,7 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,9 +248,9 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // NewListPager - The List Domain Services in Subscription operation lists all the domain services available under the given // subscription (and across all resource groups within that subscription). -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// options - ClientListOptions contains the optional parameters for the Client.List method. +// +// Generated from API version 2022-12-01 +// - options - ClientListOptions contains the optional parameters for the Client.NewListPager method. func (client *Client) NewListPager(options *ClientListOptions) *runtime.Pager[ClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{ More: func(page ClientListResponse) bool { @@ -285,7 +291,7 @@ func (client *Client) listCreateRequest(ctx context.Context, options *ClientList return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,10 +308,11 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons // NewListByResourceGroupPager - The List Domain Services in Resource Group operation lists all the domain services available // under the given resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - ClientListByResourceGroupOptions contains the optional parameters for the Client.ListByResourceGroup method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager +// method. func (client *Client) NewListByResourceGroupPager(resourceGroupName string, options *ClientListByResourceGroupOptions) *runtime.Pager[ClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListByResourceGroupResponse]{ More: func(page ClientListByResourceGroupResponse) bool { @@ -350,7 +357,7 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -368,11 +375,12 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl // BeginUpdate - The Update Domain Service operation can be used to update the existing deployment. The update call only supports // the properties listed in the PATCH body. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// domainService - Properties supplied to the Update a Domain Service operation. -// options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - domainService - Properties supplied to the Update a Domain Service operation. +// - options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, domainServiceName string, domainService DomainService, options *ClientBeginUpdateOptions) (*runtime.Poller[ClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, domainServiceName, domainService, options) @@ -388,7 +396,8 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, // Update - The Update Domain Service operation can be used to update the existing deployment. The update call only supports // the properties listed in the PATCH body. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// +// Generated from API version 2022-12-01 func (client *Client) update(ctx context.Context, resourceGroupName string, domainServiceName string, domainService DomainService, options *ClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, domainServiceName, domainService, options) if err != nil { @@ -424,7 +433,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainService) diff --git a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_constants.go b/sdk/resourcemanager/domainservices/armdomainservices/constants.go similarity index 83% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_constants.go rename to sdk/resourcemanager/domainservices/armdomainservices/constants.go index 8e8fdcafd545..c1c3c655ef8e 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_constants.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/constants.go @@ -5,14 +5,31 @@ // 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 armdomainservices const ( moduleName = "armdomainservices" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) +// ChannelBinding - A flag to determine whether or not ChannelBinding is enabled or disabled. +type ChannelBinding string + +const ( + ChannelBindingDisabled ChannelBinding = "Disabled" + ChannelBindingEnabled ChannelBinding = "Enabled" +) + +// PossibleChannelBindingValues returns the possible values for the ChannelBinding const type. +func PossibleChannelBindingValues() []ChannelBinding { + return []ChannelBinding{ + ChannelBindingDisabled, + ChannelBindingEnabled, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -97,6 +114,22 @@ func PossibleKerberosRc4EncryptionValues() []KerberosRc4Encryption { } } +// LdapSigning - A flag to determine whether or not LdapSigning is enabled or disabled. +type LdapSigning string + +const ( + LdapSigningDisabled LdapSigning = "Disabled" + LdapSigningEnabled LdapSigning = "Enabled" +) + +// PossibleLdapSigningValues returns the possible values for the LdapSigning const type. +func PossibleLdapSigningValues() []LdapSigning { + return []LdapSigning{ + LdapSigningDisabled, + LdapSigningEnabled, + } +} + // Ldaps - A flag to determine whether or not Secure LDAP is enabled or disabled. type Ldaps string @@ -233,6 +266,22 @@ func PossibleSyncOnPremPasswordsValues() []SyncOnPremPasswords { } } +// SyncScope - All or CloudOnly, All users in AAD are synced to AAD DS domain or only users actively syncing in the cloud +type SyncScope string + +const ( + SyncScopeAll SyncScope = "All" + SyncScopeCloudOnly SyncScope = "CloudOnly" +) + +// PossibleSyncScopeValues returns the possible values for the SyncScope const type. +func PossibleSyncScopeValues() []SyncScope { + return []SyncScope{ + SyncScopeAll, + SyncScopeCloudOnly, + } +} + // TLSV1 - A flag to determine whether or not TlsV1 is enabled or disabled. type TLSV1 string diff --git a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_domainserviceoperations_client.go b/sdk/resourcemanager/domainservices/armdomainservices/domainserviceoperations_client.go similarity index 90% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_domainserviceoperations_client.go rename to sdk/resourcemanager/domainservices/armdomainservices/domainserviceoperations_client.go index 1cbd9fba7031..bd82507fad8d 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_domainserviceoperations_client.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/domainserviceoperations_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 armdomainservices @@ -27,8 +28,8 @@ type DomainServiceOperationsClient struct { } // NewDomainServiceOperationsClient creates a new instance of DomainServiceOperationsClient 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 NewDomainServiceOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*DomainServiceOperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,10 +50,10 @@ func NewDomainServiceOperationsClient(credential azcore.TokenCredential, options } // NewListPager - Lists all the available Domain Services operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// options - DomainServiceOperationsClientListOptions contains the optional parameters for the DomainServiceOperationsClient.List -// method. +// +// Generated from API version 2022-12-01 +// - options - DomainServiceOperationsClientListOptions contains the optional parameters for the DomainServiceOperationsClient.NewListPager +// method. func (client *DomainServiceOperationsClient) NewListPager(options *DomainServiceOperationsClientListOptions) *runtime.Pager[DomainServiceOperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DomainServiceOperationsClientListResponse]{ More: func(page DomainServiceOperationsClientListResponse) bool { @@ -89,7 +90,7 @@ func (client *DomainServiceOperationsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/domainservices/armdomainservices/go.mod b/sdk/resourcemanager/domainservices/armdomainservices/go.mod index 00076e183366..df902dda2e17 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/go.mod +++ b/sdk/resourcemanager/domainservices/armdomainservices/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainservices/armdomainservices +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainservices/armdomainservices/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/domainservices/armdomainservices/go.sum b/sdk/resourcemanager/domainservices/armdomainservices/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/go.sum +++ b/sdk/resourcemanager/domainservices/armdomainservices/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/domainservices/armdomainservices/zz_generated_models.go b/sdk/resourcemanager/domainservices/armdomainservices/models.go similarity index 94% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_models.go rename to sdk/resourcemanager/domainservices/armdomainservices/models.go index 91fe0fc28efd..ce5bf02f3a89 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_models.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/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 armdomainservices @@ -33,37 +34,16 @@ type ClientGetOptions struct { // placeholder for future optional parameters } -// ClientListByResourceGroupOptions contains the optional parameters for the Client.ListByResourceGroup method. +// ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager method. type ClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ClientListOptions contains the optional parameters for the Client.List method. +// ClientListOptions contains the optional parameters for the Client.NewListPager method. type ClientListOptions struct { // placeholder for future optional parameters } -// CloudError - An error response from the Domain Services. -type CloudError struct { - // An error response from the Domain Services. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from the Domain Services. -type CloudErrorBody struct { - // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - - // A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty"` - - // A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - - // The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` -} - // ConfigDiagnostics - Configuration Diagnostics type ConfigDiagnostics struct { // Last domain configuration diagnostics DateTime @@ -111,12 +91,18 @@ type ContainerAccount struct { // DomainSecuritySettings - Domain Security Settings type DomainSecuritySettings struct { + // A flag to determine whether or not ChannelBinding is enabled or disabled. + ChannelBinding *ChannelBinding `json:"channelBinding,omitempty"` + // A flag to determine whether or not KerberosArmoring is enabled or disabled. KerberosArmoring *KerberosArmoring `json:"kerberosArmoring,omitempty"` // A flag to determine whether or not KerberosRc4Encryption is enabled or disabled. KerberosRc4Encryption *KerberosRc4Encryption `json:"kerberosRc4Encryption,omitempty"` + // A flag to determine whether or not LdapSigning is enabled or disabled. + LdapSigning *LdapSigning `json:"ldapSigning,omitempty"` + // A flag to determine whether or not NtlmV1 is enabled or disabled. NtlmV1 *NtlmV1 `json:"ntlmV1,omitempty"` @@ -169,7 +155,8 @@ type DomainServiceListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// DomainServiceOperationsClientListOptions contains the optional parameters for the DomainServiceOperationsClient.List method. +// DomainServiceOperationsClientListOptions contains the optional parameters for the DomainServiceOperationsClient.NewListPager +// method. type DomainServiceOperationsClientListOptions struct { // placeholder for future optional parameters } @@ -206,6 +193,9 @@ type DomainServiceProperties struct { // Sku Type SKU *string `json:"sku,omitempty"` + // All or CloudOnly, All users in AAD are synced to AAD DS domain or only users actively syncing in the cloud + SyncScope *SyncScope `json:"syncScope,omitempty"` + // READ-ONLY; Deployment Id DeploymentID *string `json:"deploymentId,omitempty" azure:"ro"` @@ -215,6 +205,9 @@ type DomainServiceProperties struct { // READ-ONLY; the current deployment or provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + // READ-ONLY; The unique sync application id of the Azure AD Domain Services deployment. + SyncApplicationID *string `json:"syncApplicationId,omitempty" azure:"ro"` + // READ-ONLY; SyncOwner ReplicaSet Id SyncOwner *string `json:"syncOwner,omitempty" azure:"ro"` @@ -423,7 +416,7 @@ type OuContainerClientGetOptions struct { // placeholder for future optional parameters } -// OuContainerClientListOptions contains the optional parameters for the OuContainerClient.List method. +// OuContainerClientListOptions contains the optional parameters for the OuContainerClient.NewListPager method. type OuContainerClientListOptions struct { // placeholder for future optional parameters } @@ -437,7 +430,8 @@ type OuContainerListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// OuContainerOperationsClientListOptions contains the optional parameters for the OuContainerOperationsClient.List method. +// OuContainerOperationsClientListOptions contains the optional parameters for the OuContainerOperationsClient.NewListPager +// method. type OuContainerOperationsClientListOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/domainservices/armdomainservices/models_serde.go b/sdk/resourcemanager/domainservices/armdomainservices/models_serde.go new file mode 100644 index 000000000000..f339b1617f4b --- /dev/null +++ b/sdk/resourcemanager/domainservices/armdomainservices/models_serde.go @@ -0,0 +1,1132 @@ +//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 armdomainservices + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type ConfigDiagnostics. +func (c ConfigDiagnostics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC1123(objectMap, "lastExecuted", c.LastExecuted) + populate(objectMap, "validatorResults", c.ValidatorResults) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigDiagnostics. +func (c *ConfigDiagnostics) UnmarshalJSON(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 "lastExecuted": + err = unpopulateTimeRFC1123(val, "LastExecuted", &c.LastExecuted) + delete(rawMsg, key) + case "validatorResults": + err = unpopulate(val, "ValidatorResults", &c.ValidatorResults) + 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 ConfigDiagnosticsValidatorResult. +func (c ConfigDiagnosticsValidatorResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "issues", c.Issues) + populate(objectMap, "replicaSetSubnetDisplayName", c.ReplicaSetSubnetDisplayName) + populate(objectMap, "status", c.Status) + populate(objectMap, "validatorId", c.ValidatorID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigDiagnosticsValidatorResult. +func (c *ConfigDiagnosticsValidatorResult) UnmarshalJSON(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 "issues": + err = unpopulate(val, "Issues", &c.Issues) + delete(rawMsg, key) + case "replicaSetSubnetDisplayName": + err = unpopulate(val, "ReplicaSetSubnetDisplayName", &c.ReplicaSetSubnetDisplayName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "validatorId": + err = unpopulate(val, "ValidatorID", &c.ValidatorID) + 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 ConfigDiagnosticsValidatorResultIssue. +func (c ConfigDiagnosticsValidatorResultIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "descriptionParams", c.DescriptionParams) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigDiagnosticsValidatorResultIssue. +func (c *ConfigDiagnosticsValidatorResultIssue) UnmarshalJSON(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 "descriptionParams": + err = unpopulate(val, "DescriptionParams", &c.DescriptionParams) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + 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 ContainerAccount. +func (c ContainerAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountName", c.AccountName) + populate(objectMap, "password", c.Password) + populate(objectMap, "spn", c.Spn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAccount. +func (c *ContainerAccount) UnmarshalJSON(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 "accountName": + err = unpopulate(val, "AccountName", &c.AccountName) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + case "spn": + err = unpopulate(val, "Spn", &c.Spn) + 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 DomainSecuritySettings. +func (d DomainSecuritySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "channelBinding", d.ChannelBinding) + populate(objectMap, "kerberosArmoring", d.KerberosArmoring) + populate(objectMap, "kerberosRc4Encryption", d.KerberosRc4Encryption) + populate(objectMap, "ldapSigning", d.LdapSigning) + populate(objectMap, "ntlmV1", d.NtlmV1) + populate(objectMap, "syncKerberosPasswords", d.SyncKerberosPasswords) + populate(objectMap, "syncNtlmPasswords", d.SyncNtlmPasswords) + populate(objectMap, "syncOnPremPasswords", d.SyncOnPremPasswords) + populate(objectMap, "tlsV1", d.TLSV1) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainSecuritySettings. +func (d *DomainSecuritySettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "channelBinding": + err = unpopulate(val, "ChannelBinding", &d.ChannelBinding) + delete(rawMsg, key) + case "kerberosArmoring": + err = unpopulate(val, "KerberosArmoring", &d.KerberosArmoring) + delete(rawMsg, key) + case "kerberosRc4Encryption": + err = unpopulate(val, "KerberosRc4Encryption", &d.KerberosRc4Encryption) + delete(rawMsg, key) + case "ldapSigning": + err = unpopulate(val, "LdapSigning", &d.LdapSigning) + delete(rawMsg, key) + case "ntlmV1": + err = unpopulate(val, "NtlmV1", &d.NtlmV1) + delete(rawMsg, key) + case "syncKerberosPasswords": + err = unpopulate(val, "SyncKerberosPasswords", &d.SyncKerberosPasswords) + delete(rawMsg, key) + case "syncNtlmPasswords": + err = unpopulate(val, "SyncNtlmPasswords", &d.SyncNtlmPasswords) + delete(rawMsg, key) + case "syncOnPremPasswords": + err = unpopulate(val, "SyncOnPremPasswords", &d.SyncOnPremPasswords) + delete(rawMsg, key) + case "tlsV1": + err = unpopulate(val, "TLSV1", &d.TLSV1) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DomainService. +func (d DomainService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainService. +func (d *DomainService) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DomainServiceListResult. +func (d DomainServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainServiceListResult. +func (d *DomainServiceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DomainServiceProperties. +func (d DomainServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configDiagnostics", d.ConfigDiagnostics) + populate(objectMap, "deploymentId", d.DeploymentID) + populate(objectMap, "domainConfigurationType", d.DomainConfigurationType) + populate(objectMap, "domainName", d.DomainName) + populate(objectMap, "domainSecuritySettings", d.DomainSecuritySettings) + populate(objectMap, "filteredSync", d.FilteredSync) + populate(objectMap, "ldapsSettings", d.LdapsSettings) + populate(objectMap, "migrationProperties", d.MigrationProperties) + populate(objectMap, "notificationSettings", d.NotificationSettings) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "replicaSets", d.ReplicaSets) + populate(objectMap, "resourceForestSettings", d.ResourceForestSettings) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "syncApplicationId", d.SyncApplicationID) + populate(objectMap, "syncOwner", d.SyncOwner) + populate(objectMap, "syncScope", d.SyncScope) + populate(objectMap, "tenantId", d.TenantID) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainServiceProperties. +func (d *DomainServiceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configDiagnostics": + err = unpopulate(val, "ConfigDiagnostics", &d.ConfigDiagnostics) + delete(rawMsg, key) + case "deploymentId": + err = unpopulate(val, "DeploymentID", &d.DeploymentID) + delete(rawMsg, key) + case "domainConfigurationType": + err = unpopulate(val, "DomainConfigurationType", &d.DomainConfigurationType) + delete(rawMsg, key) + case "domainName": + err = unpopulate(val, "DomainName", &d.DomainName) + delete(rawMsg, key) + case "domainSecuritySettings": + err = unpopulate(val, "DomainSecuritySettings", &d.DomainSecuritySettings) + delete(rawMsg, key) + case "filteredSync": + err = unpopulate(val, "FilteredSync", &d.FilteredSync) + delete(rawMsg, key) + case "ldapsSettings": + err = unpopulate(val, "LdapsSettings", &d.LdapsSettings) + delete(rawMsg, key) + case "migrationProperties": + err = unpopulate(val, "MigrationProperties", &d.MigrationProperties) + delete(rawMsg, key) + case "notificationSettings": + err = unpopulate(val, "NotificationSettings", &d.NotificationSettings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "replicaSets": + err = unpopulate(val, "ReplicaSets", &d.ReplicaSets) + delete(rawMsg, key) + case "resourceForestSettings": + err = unpopulate(val, "ResourceForestSettings", &d.ResourceForestSettings) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "syncApplicationId": + err = unpopulate(val, "SyncApplicationID", &d.SyncApplicationID) + delete(rawMsg, key) + case "syncOwner": + err = unpopulate(val, "SyncOwner", &d.SyncOwner) + delete(rawMsg, key) + case "syncScope": + err = unpopulate(val, "SyncScope", &d.SyncScope) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &d.TenantID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForestTrust. +func (f ForestTrust) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "friendlyName", f.FriendlyName) + populate(objectMap, "remoteDnsIps", f.RemoteDNSIPs) + populate(objectMap, "trustDirection", f.TrustDirection) + populate(objectMap, "trustPassword", f.TrustPassword) + populate(objectMap, "trustedDomainFqdn", f.TrustedDomainFqdn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForestTrust. +func (f *ForestTrust) UnmarshalJSON(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 "friendlyName": + err = unpopulate(val, "FriendlyName", &f.FriendlyName) + delete(rawMsg, key) + case "remoteDnsIps": + err = unpopulate(val, "RemoteDNSIPs", &f.RemoteDNSIPs) + delete(rawMsg, key) + case "trustDirection": + err = unpopulate(val, "TrustDirection", &f.TrustDirection) + delete(rawMsg, key) + case "trustPassword": + err = unpopulate(val, "TrustPassword", &f.TrustPassword) + delete(rawMsg, key) + case "trustedDomainFqdn": + err = unpopulate(val, "TrustedDomainFqdn", &f.TrustedDomainFqdn) + 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 HealthAlert. +func (h HealthAlert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", h.ID) + populate(objectMap, "issue", h.Issue) + populateTimeRFC3339(objectMap, "lastDetected", h.LastDetected) + populate(objectMap, "name", h.Name) + populateTimeRFC3339(objectMap, "raised", h.Raised) + populate(objectMap, "resolutionUri", h.ResolutionURI) + populate(objectMap, "severity", h.Severity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthAlert. +func (h *HealthAlert) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "issue": + err = unpopulate(val, "Issue", &h.Issue) + delete(rawMsg, key) + case "lastDetected": + err = unpopulateTimeRFC3339(val, "LastDetected", &h.LastDetected) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "raised": + err = unpopulateTimeRFC3339(val, "Raised", &h.Raised) + delete(rawMsg, key) + case "resolutionUri": + err = unpopulate(val, "ResolutionURI", &h.ResolutionURI) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &h.Severity) + 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 HealthMonitor. +func (h HealthMonitor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "details", h.Details) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthMonitor. +func (h *HealthMonitor) UnmarshalJSON(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 "details": + err = unpopulate(val, "Details", &h.Details) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LdapsSettings. +func (l LdapsSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "certificateNotAfter", l.CertificateNotAfter) + populate(objectMap, "certificateThumbprint", l.CertificateThumbprint) + populate(objectMap, "externalAccess", l.ExternalAccess) + populate(objectMap, "ldaps", l.Ldaps) + populate(objectMap, "pfxCertificate", l.PfxCertificate) + populate(objectMap, "pfxCertificatePassword", l.PfxCertificatePassword) + populate(objectMap, "publicCertificate", l.PublicCertificate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LdapsSettings. +func (l *LdapsSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateNotAfter": + err = unpopulateTimeRFC3339(val, "CertificateNotAfter", &l.CertificateNotAfter) + delete(rawMsg, key) + case "certificateThumbprint": + err = unpopulate(val, "CertificateThumbprint", &l.CertificateThumbprint) + delete(rawMsg, key) + case "externalAccess": + err = unpopulate(val, "ExternalAccess", &l.ExternalAccess) + delete(rawMsg, key) + case "ldaps": + err = unpopulate(val, "Ldaps", &l.Ldaps) + delete(rawMsg, key) + case "pfxCertificate": + err = unpopulate(val, "PfxCertificate", &l.PfxCertificate) + delete(rawMsg, key) + case "pfxCertificatePassword": + err = unpopulate(val, "PfxCertificatePassword", &l.PfxCertificatePassword) + delete(rawMsg, key) + case "publicCertificate": + err = unpopulate(val, "PublicCertificate", &l.PublicCertificate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationProgress. +func (m MigrationProgress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "completionPercentage", m.CompletionPercentage) + populate(objectMap, "progressMessage", m.ProgressMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationProgress. +func (m *MigrationProgress) UnmarshalJSON(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 "completionPercentage": + err = unpopulate(val, "CompletionPercentage", &m.CompletionPercentage) + delete(rawMsg, key) + case "progressMessage": + err = unpopulate(val, "ProgressMessage", &m.ProgressMessage) + 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 MigrationProperties. +func (m MigrationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migrationProgress", m.MigrationProgress) + populate(objectMap, "oldSubnetId", m.OldSubnetID) + populate(objectMap, "oldVnetSiteId", m.OldVnetSiteID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationProperties. +func (m *MigrationProperties) UnmarshalJSON(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 "migrationProgress": + err = unpopulate(val, "MigrationProgress", &m.MigrationProgress) + delete(rawMsg, key) + case "oldSubnetId": + err = unpopulate(val, "OldSubnetID", &m.OldSubnetID) + delete(rawMsg, key) + case "oldVnetSiteId": + err = unpopulate(val, "OldVnetSiteID", &m.OldVnetSiteID) + 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 NotificationSettings. +func (n NotificationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalRecipients", n.AdditionalRecipients) + populate(objectMap, "notifyDcAdmins", n.NotifyDcAdmins) + populate(objectMap, "notifyGlobalAdmins", n.NotifyGlobalAdmins) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationSettings. +func (n *NotificationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalRecipients": + err = unpopulate(val, "AdditionalRecipients", &n.AdditionalRecipients) + delete(rawMsg, key) + case "notifyDcAdmins": + err = unpopulate(val, "NotifyDcAdmins", &n.NotifyDcAdmins) + delete(rawMsg, key) + case "notifyGlobalAdmins": + err = unpopulate(val, "NotifyGlobalAdmins", &n.NotifyGlobalAdmins) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplayInfo. +func (o OperationDisplayInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayInfo. +func (o *OperationDisplayInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationEntity. +func (o OperationEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationEntity. +func (o *OperationEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationEntityListResult. +func (o OperationEntityListResult) 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 OperationEntityListResult. +func (o *OperationEntityListResult) UnmarshalJSON(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 OuContainer. +func (o OuContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + populate(objectMap, "location", o.Location) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "tags", o.Tags) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OuContainer. +func (o *OuContainer) UnmarshalJSON(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 "etag": + err = unpopulate(val, "Etag", &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &o.Location) + 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 "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) + 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 OuContainerListResult. +func (o OuContainerListResult) 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 OuContainerListResult. +func (o *OuContainerListResult) UnmarshalJSON(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 OuContainerProperties. +func (o OuContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accounts", o.Accounts) + populate(objectMap, "containerId", o.ContainerID) + populate(objectMap, "deploymentId", o.DeploymentID) + populate(objectMap, "distinguishedName", o.DistinguishedName) + populate(objectMap, "domainName", o.DomainName) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "serviceStatus", o.ServiceStatus) + populate(objectMap, "tenantId", o.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OuContainerProperties. +func (o *OuContainerProperties) UnmarshalJSON(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 "accounts": + err = unpopulate(val, "Accounts", &o.Accounts) + delete(rawMsg, key) + case "containerId": + err = unpopulate(val, "ContainerID", &o.ContainerID) + delete(rawMsg, key) + case "deploymentId": + err = unpopulate(val, "DeploymentID", &o.DeploymentID) + delete(rawMsg, key) + case "distinguishedName": + err = unpopulate(val, "DistinguishedName", &o.DistinguishedName) + delete(rawMsg, key) + case "domainName": + err = unpopulate(val, "DomainName", &o.DomainName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + case "serviceStatus": + err = unpopulate(val, "ServiceStatus", &o.ServiceStatus) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &o.TenantID) + 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 ReplicaSet. +func (r ReplicaSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainControllerIpAddress", r.DomainControllerIPAddress) + populate(objectMap, "externalAccessIpAddress", r.ExternalAccessIPAddress) + populate(objectMap, "healthAlerts", r.HealthAlerts) + populateTimeRFC1123(objectMap, "healthLastEvaluated", r.HealthLastEvaluated) + populate(objectMap, "healthMonitors", r.HealthMonitors) + populate(objectMap, "location", r.Location) + populate(objectMap, "replicaSetId", r.ReplicaSetID) + populate(objectMap, "serviceStatus", r.ServiceStatus) + populate(objectMap, "subnetId", r.SubnetID) + populate(objectMap, "vnetSiteId", r.VnetSiteID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaSet. +func (r *ReplicaSet) UnmarshalJSON(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 "domainControllerIpAddress": + err = unpopulate(val, "DomainControllerIPAddress", &r.DomainControllerIPAddress) + delete(rawMsg, key) + case "externalAccessIpAddress": + err = unpopulate(val, "ExternalAccessIPAddress", &r.ExternalAccessIPAddress) + delete(rawMsg, key) + case "healthAlerts": + err = unpopulate(val, "HealthAlerts", &r.HealthAlerts) + delete(rawMsg, key) + case "healthLastEvaluated": + err = unpopulateTimeRFC1123(val, "HealthLastEvaluated", &r.HealthLastEvaluated) + delete(rawMsg, key) + case "healthMonitors": + err = unpopulate(val, "HealthMonitors", &r.HealthMonitors) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "replicaSetId": + err = unpopulate(val, "ReplicaSetID", &r.ReplicaSetID) + delete(rawMsg, key) + case "serviceStatus": + err = unpopulate(val, "ServiceStatus", &r.ServiceStatus) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &r.SubnetID) + delete(rawMsg, key) + case "vnetSiteId": + err = unpopulate(val, "VnetSiteID", &r.VnetSiteID) + 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, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceForestSettings. +func (r ResourceForestSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceForest", r.ResourceForest) + populate(objectMap, "settings", r.Settings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceForestSettings. +func (r *ResourceForestSettings) UnmarshalJSON(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 "resourceForest": + err = unpopulate(val, "ResourceForest", &r.ResourceForest) + delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &r.Settings) + 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 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/domainservices/armdomainservices/zz_generated_oucontainer_client.go b/sdk/resourcemanager/domainservices/armdomainservices/oucontainer_client.go similarity index 85% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_oucontainer_client.go rename to sdk/resourcemanager/domainservices/armdomainservices/oucontainer_client.go index 0379859ad8c4..28e6bfbb65c9 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_oucontainer_client.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/oucontainer_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 armdomainservices @@ -31,10 +32,10 @@ type OuContainerClient struct { } // NewOuContainerClient creates a new instance of OuContainerClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription -// ID forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOuContainerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OuContainerClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ func NewOuContainerClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreate - The Create OuContainer operation creates a new OuContainer under the specified Domain Service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// ouContainerName - The name of the OuContainer. -// containerAccount - Container Account Description. -// options - OuContainerClientBeginCreateOptions contains the optional parameters for the OuContainerClient.BeginCreate method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - ouContainerName - The name of the OuContainer. +// - containerAccount - Container Account Description. +// - options - OuContainerClientBeginCreateOptions contains the optional parameters for the OuContainerClient.BeginCreate method. func (client *OuContainerClient) BeginCreate(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount, options *OuContainerClientBeginCreateOptions) (*runtime.Poller[OuContainerClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, domainServiceName, ouContainerName, containerAccount, options) @@ -77,7 +79,8 @@ func (client *OuContainerClient) BeginCreate(ctx context.Context, resourceGroupN // Create - The Create OuContainer operation creates a new OuContainer under the specified Domain Service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// +// Generated from API version 2022-12-01 func (client *OuContainerClient) create(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount, options *OuContainerClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, domainServiceName, ouContainerName, containerAccount, options) if err != nil { @@ -117,7 +120,7 @@ func (client *OuContainerClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, containerAccount) @@ -125,11 +128,12 @@ func (client *OuContainerClient) createCreateRequest(ctx context.Context, resour // BeginDelete - The Delete OuContainer operation deletes specified OuContainer. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// ouContainerName - The name of the OuContainer. -// options - OuContainerClientBeginDeleteOptions contains the optional parameters for the OuContainerClient.BeginDelete method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - ouContainerName - The name of the OuContainer. +// - options - OuContainerClientBeginDeleteOptions contains the optional parameters for the OuContainerClient.BeginDelete method. func (client *OuContainerClient) BeginDelete(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, options *OuContainerClientBeginDeleteOptions) (*runtime.Poller[OuContainerClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, domainServiceName, ouContainerName, options) @@ -144,7 +148,8 @@ func (client *OuContainerClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - The Delete OuContainer operation deletes specified OuContainer. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// +// Generated from API version 2022-12-01 func (client *OuContainerClient) deleteOperation(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, options *OuContainerClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainServiceName, ouContainerName, options) if err != nil { @@ -184,7 +189,7 @@ func (client *OuContainerClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,11 +197,12 @@ func (client *OuContainerClient) deleteCreateRequest(ctx context.Context, resour // Get - Get OuContainer in DomainService instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// ouContainerName - The name of the OuContainer. -// options - OuContainerClientGetOptions contains the optional parameters for the OuContainerClient.Get method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - ouContainerName - The name of the OuContainer. +// - options - OuContainerClientGetOptions contains the optional parameters for the OuContainerClient.Get method. func (client *OuContainerClient) Get(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, options *OuContainerClientGetOptions) (OuContainerClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, domainServiceName, ouContainerName, options) if err != nil { @@ -236,7 +242,7 @@ func (client *OuContainerClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,11 +258,11 @@ func (client *OuContainerClient) getHandleResponse(resp *http.Response) (OuConta } // NewListPager - The List of OuContainers in DomainService instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// options - OuContainerClientListOptions contains the optional parameters for the OuContainerClient.List method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - options - OuContainerClientListOptions contains the optional parameters for the OuContainerClient.NewListPager method. func (client *OuContainerClient) NewListPager(resourceGroupName string, domainServiceName string, options *OuContainerClientListOptions) *runtime.Pager[OuContainerClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OuContainerClientListResponse]{ More: func(page OuContainerClientListResponse) bool { @@ -305,7 +311,7 @@ func (client *OuContainerClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,12 +328,13 @@ func (client *OuContainerClient) listHandleResponse(resp *http.Response) (OuCont // BeginUpdate - The Update OuContainer operation can be used to update the existing OuContainers. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// domainServiceName - The name of the domain service. -// ouContainerName - The name of the OuContainer. -// containerAccount - Container Account Description. -// options - OuContainerClientBeginUpdateOptions contains the optional parameters for the OuContainerClient.BeginUpdate method. +// +// Generated from API version 2022-12-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - domainServiceName - The name of the domain service. +// - ouContainerName - The name of the OuContainer. +// - containerAccount - Container Account Description. +// - options - OuContainerClientBeginUpdateOptions contains the optional parameters for the OuContainerClient.BeginUpdate method. func (client *OuContainerClient) BeginUpdate(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount, options *OuContainerClientBeginUpdateOptions) (*runtime.Poller[OuContainerClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, domainServiceName, ouContainerName, containerAccount, options) @@ -342,7 +349,8 @@ func (client *OuContainerClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - The Update OuContainer operation can be used to update the existing OuContainers. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// +// Generated from API version 2022-12-01 func (client *OuContainerClient) update(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount, options *OuContainerClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, domainServiceName, ouContainerName, containerAccount, options) if err != nil { @@ -382,7 +390,7 @@ func (client *OuContainerClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, containerAccount) diff --git a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_oucontaineroperations_client.go b/sdk/resourcemanager/domainservices/armdomainservices/oucontaineroperations_client.go similarity index 90% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_oucontaineroperations_client.go rename to sdk/resourcemanager/domainservices/armdomainservices/oucontaineroperations_client.go index d5c8eff15063..bb100ff8a0f0 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_oucontaineroperations_client.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/oucontaineroperations_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 armdomainservices @@ -27,8 +28,8 @@ type OuContainerOperationsClient struct { } // NewOuContainerOperationsClient creates a new instance of OuContainerOperationsClient 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 NewOuContainerOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OuContainerOperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,10 +50,10 @@ func NewOuContainerOperationsClient(credential azcore.TokenCredential, options * } // NewListPager - Lists all the available OuContainer operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 -// options - OuContainerOperationsClientListOptions contains the optional parameters for the OuContainerOperationsClient.List -// method. +// +// Generated from API version 2022-12-01 +// - options - OuContainerOperationsClientListOptions contains the optional parameters for the OuContainerOperationsClient.NewListPager +// method. func (client *OuContainerOperationsClient) NewListPager(options *OuContainerOperationsClientListOptions) *runtime.Pager[OuContainerOperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OuContainerOperationsClientListResponse]{ More: func(page OuContainerOperationsClientListResponse) bool { @@ -89,7 +90,7 @@ func (client *OuContainerOperationsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-12-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_response_types.go b/sdk/resourcemanager/domainservices/armdomainservices/response_types.go similarity index 82% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_response_types.go rename to sdk/resourcemanager/domainservices/armdomainservices/response_types.go index a744e92f80b8..0ed4b07125af 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_response_types.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/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 armdomainservices -// ClientCreateOrUpdateResponse contains the response from method Client.CreateOrUpdate. +// ClientCreateOrUpdateResponse contains the response from method Client.BeginCreateOrUpdate. type ClientCreateOrUpdateResponse struct { DomainService } -// ClientDeleteResponse contains the response from method Client.Delete. +// ClientDeleteResponse contains the response from method Client.BeginDelete. type ClientDeleteResponse struct { // placeholder for future response values } @@ -23,32 +24,32 @@ type ClientGetResponse struct { DomainService } -// ClientListByResourceGroupResponse contains the response from method Client.ListByResourceGroup. +// ClientListByResourceGroupResponse contains the response from method Client.NewListByResourceGroupPager. type ClientListByResourceGroupResponse struct { DomainServiceListResult } -// ClientListResponse contains the response from method Client.List. +// ClientListResponse contains the response from method Client.NewListPager. type ClientListResponse struct { DomainServiceListResult } -// ClientUpdateResponse contains the response from method Client.Update. +// ClientUpdateResponse contains the response from method Client.BeginUpdate. type ClientUpdateResponse struct { DomainService } -// DomainServiceOperationsClientListResponse contains the response from method DomainServiceOperationsClient.List. +// DomainServiceOperationsClientListResponse contains the response from method DomainServiceOperationsClient.NewListPager. type DomainServiceOperationsClientListResponse struct { OperationEntityListResult } -// OuContainerClientCreateResponse contains the response from method OuContainerClient.Create. +// OuContainerClientCreateResponse contains the response from method OuContainerClient.BeginCreate. type OuContainerClientCreateResponse struct { OuContainer } -// OuContainerClientDeleteResponse contains the response from method OuContainerClient.Delete. +// OuContainerClientDeleteResponse contains the response from method OuContainerClient.BeginDelete. type OuContainerClientDeleteResponse struct { // placeholder for future response values } @@ -58,17 +59,17 @@ type OuContainerClientGetResponse struct { OuContainer } -// OuContainerClientListResponse contains the response from method OuContainerClient.List. +// OuContainerClientListResponse contains the response from method OuContainerClient.NewListPager. type OuContainerClientListResponse struct { OuContainerListResult } -// OuContainerClientUpdateResponse contains the response from method OuContainerClient.Update. +// OuContainerClientUpdateResponse contains the response from method OuContainerClient.BeginUpdate. type OuContainerClientUpdateResponse struct { OuContainer } -// OuContainerOperationsClientListResponse contains the response from method OuContainerOperationsClient.List. +// OuContainerOperationsClientListResponse contains the response from method OuContainerOperationsClient.NewListPager. type OuContainerOperationsClientListResponse struct { OperationEntityListResult } diff --git a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_time_rfc1123.go b/sdk/resourcemanager/domainservices/armdomainservices/time_rfc1123.go similarity index 94% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_time_rfc1123.go rename to sdk/resourcemanager/domainservices/armdomainservices/time_rfc1123.go index c28918d35436..110f9512c4a5 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_time_rfc1123.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/time_rfc1123.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 armdomainservices @@ -45,7 +46,7 @@ func (t *timeRFC1123) UnmarshalText(data []byte) error { return err } -func populateTimeRFC1123(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC1123(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_time_rfc3339.go b/sdk/resourcemanager/domainservices/armdomainservices/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/domainservices/armdomainservices/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/domainservices/armdomainservices/time_rfc3339.go index 93b85abf930c..4f3a6dda8f65 100644 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/domainservices/armdomainservices/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 armdomainservices @@ -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/domainservices/armdomainservices/ze_generated_example_domainserviceoperations_client_test.go b/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_domainserviceoperations_client_test.go deleted file mode 100644 index 8456c93d92dd..000000000000 --- a/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_domainserviceoperations_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 armdomainservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainservices/armdomainservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/GetOperations.json -func ExampleDomainServiceOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewDomainServiceOperationsClient(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/domainservices/armdomainservices/ze_generated_example_domainservices_client_test.go b/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_domainservices_client_test.go deleted file mode 100644 index da443cd60368..000000000000 --- a/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_domainservices_client_test.go +++ /dev/null @@ -1,242 +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 armdomainservices_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainservices/armdomainservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/ListDomainServicesBySubscription.json -func ExampleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", 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 - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/ListDomainServicesByResourceGroup.json -func ExampleClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/CreateDomainService.json -func ExampleClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "TestResourceGroup", - "TestDomainService.com", - armdomainservices.DomainService{ - Properties: &armdomainservices.DomainServiceProperties{ - DomainName: to.Ptr("TestDomainService.com"), - DomainSecuritySettings: &armdomainservices.DomainSecuritySettings{ - NtlmV1: to.Ptr(armdomainservices.NtlmV1Enabled), - SyncNtlmPasswords: to.Ptr(armdomainservices.SyncNtlmPasswordsEnabled), - TLSV1: to.Ptr(armdomainservices.TLSV1Disabled), - }, - FilteredSync: to.Ptr(armdomainservices.FilteredSyncEnabled), - LdapsSettings: &armdomainservices.LdapsSettings{ - ExternalAccess: to.Ptr(armdomainservices.ExternalAccessEnabled), - Ldaps: to.Ptr(armdomainservices.LdapsEnabled), - PfxCertificate: to.Ptr("MIIDPDCCAiSgAwIBAgIQQUI9P6tq2p9OFIJa7DLNvTANBgkqhkiG9w0BAQsFADAgMR4w..."), - PfxCertificatePassword: to.Ptr(""), - }, - NotificationSettings: &armdomainservices.NotificationSettings{ - AdditionalRecipients: []*string{ - to.Ptr("jicha@microsoft.com"), - to.Ptr("caalmont@microsoft.com")}, - NotifyDcAdmins: to.Ptr(armdomainservices.NotifyDcAdminsEnabled), - NotifyGlobalAdmins: to.Ptr(armdomainservices.NotifyGlobalAdminsEnabled), - }, - ReplicaSets: []*armdomainservices.ReplicaSet{ - { - Location: to.Ptr("West US"), - SubnetID: to.Ptr("/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetWUS/subnets/TestSubnetWUS"), - }}, - }, - }, - 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/GetDomainService.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "TestResourceGroup", - "TestDomainService.com", - 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/DeleteDomainService.json -func ExampleClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "TestResourceGroup", - "TestDomainService.com", - 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/UpdateDomainService.json -func ExampleClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "TestResourceGroup", - "TestDomainService.com", - armdomainservices.DomainService{ - Properties: &armdomainservices.DomainServiceProperties{ - ConfigDiagnostics: &armdomainservices.ConfigDiagnostics{ - LastExecuted: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "2021-05-05T12:00:23Z;"); return t }()), - ValidatorResults: []*armdomainservices.ConfigDiagnosticsValidatorResult{ - { - Issues: []*armdomainservices.ConfigDiagnosticsValidatorResultIssue{ - { - DescriptionParams: []*string{}, - ID: to.Ptr("AADDS-CFG-DIAG-I20"), - }}, - ReplicaSetSubnetDisplayName: to.Ptr("West US/aadds-subnet"), - Status: to.Ptr(armdomainservices.StatusWarning), - ValidatorID: to.Ptr("AADDS-CFG-DIAG-V06"), - }}, - }, - DomainSecuritySettings: &armdomainservices.DomainSecuritySettings{ - NtlmV1: to.Ptr(armdomainservices.NtlmV1Enabled), - SyncNtlmPasswords: to.Ptr(armdomainservices.SyncNtlmPasswordsEnabled), - TLSV1: to.Ptr(armdomainservices.TLSV1Disabled), - }, - FilteredSync: to.Ptr(armdomainservices.FilteredSyncEnabled), - LdapsSettings: &armdomainservices.LdapsSettings{ - ExternalAccess: to.Ptr(armdomainservices.ExternalAccessEnabled), - Ldaps: to.Ptr(armdomainservices.LdapsEnabled), - PfxCertificate: to.Ptr("MIIDPDCCAiSgAwIBAgIQQUI9P6tq2p9OFIJa7DLNvTANBgkqhkiG9w0BAQsFADAgMR4w..."), - PfxCertificatePassword: to.Ptr(""), - }, - NotificationSettings: &armdomainservices.NotificationSettings{ - AdditionalRecipients: []*string{ - to.Ptr("jicha@microsoft.com"), - to.Ptr("caalmont@microsoft.com")}, - NotifyDcAdmins: to.Ptr(armdomainservices.NotifyDcAdminsEnabled), - NotifyGlobalAdmins: to.Ptr(armdomainservices.NotifyGlobalAdminsEnabled), - }, - ReplicaSets: []*armdomainservices.ReplicaSet{ - { - Location: to.Ptr("West US"), - SubnetID: to.Ptr("/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetWUS/subnets/TestSubnetWUS"), - }, - { - Location: to.Ptr("East US"), - SubnetID: to.Ptr("/subscriptions/1639790a-76a2-4ac4-98d9-8562f5dfcb4d/resourceGroups/TestNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/TestVnetEUS/subnets/TestSubnetEUS"), - }}, - }, - }, - 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 -} diff --git a/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_oucontainer_client_test.go b/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_oucontainer_client_test.go deleted file mode 100644 index 814c75e05d17..000000000000 --- a/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_oucontainer_client_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdomainservices_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/domainservices/armdomainservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/ListOuContainers.json -func ExampleOuContainerClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewOuContainerClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("OuContainerResourceGroup", - "OuContainer.com", - 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/GetOuContainer.json -func ExampleOuContainerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewOuContainerClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "OuContainerResourceGroup", - "OuContainer.com", - "OuContainer1", - 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/CreateOuContainer.json -func ExampleOuContainerClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewOuContainerClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "OuContainerResourceGroup", - "OuContainer.com", - "OuContainer1", - armdomainservices.ContainerAccount{ - AccountName: to.Ptr("AccountName1"), - Password: to.Ptr(""), - Spn: to.Ptr("Spn1"), - }, - 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/DeleteOuContainer.json -func ExampleOuContainerClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewOuContainerClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "OuContainerResourceGroup", - "OuContainer.com", - "OuContainer1", - 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/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/UpdateOuContainer.json -func ExampleOuContainerClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewOuContainerClient("1639790a-76a2-4ac4-98d9-8562f5dfcb4d", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "OuContainerResourceGroup", - "OuContainer.com", - "OuContainer1", - armdomainservices.ContainerAccount{ - AccountName: to.Ptr("AccountName1"), - Password: to.Ptr(""), - Spn: to.Ptr("Spn1"), - }, - 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 -} diff --git a/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_oucontaineroperations_client_test.go b/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_oucontaineroperations_client_test.go deleted file mode 100644 index 9d83662c2ee7..000000000000 --- a/sdk/resourcemanager/domainservices/armdomainservices/ze_generated_example_oucontaineroperations_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 armdomainservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainservices/armdomainservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/domainservices/resource-manager/Microsoft.AAD/stable/2021-05-01/examples/GetOperations.json -func ExampleOuContainerOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdomainservices.NewOuContainerOperationsClient(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/domainservices/armdomainservices/zz_generated_models_serde.go b/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_models_serde.go deleted file mode 100644 index 0e25cd5bff7f..000000000000 --- a/sdk/resourcemanager/domainservices/armdomainservices/zz_generated_models_serde.go +++ /dev/null @@ -1,400 +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 armdomainservices - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ConfigDiagnostics. -func (c ConfigDiagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC1123(objectMap, "lastExecuted", c.LastExecuted) - populate(objectMap, "validatorResults", c.ValidatorResults) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigDiagnostics. -func (c *ConfigDiagnostics) UnmarshalJSON(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 "lastExecuted": - err = unpopulateTimeRFC1123(val, "LastExecuted", &c.LastExecuted) - delete(rawMsg, key) - case "validatorResults": - err = unpopulate(val, "ValidatorResults", &c.ValidatorResults) - 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 ConfigDiagnosticsValidatorResult. -func (c ConfigDiagnosticsValidatorResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "issues", c.Issues) - populate(objectMap, "replicaSetSubnetDisplayName", c.ReplicaSetSubnetDisplayName) - populate(objectMap, "status", c.Status) - populate(objectMap, "validatorId", c.ValidatorID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConfigDiagnosticsValidatorResultIssue. -func (c ConfigDiagnosticsValidatorResultIssue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "descriptionParams", c.DescriptionParams) - populate(objectMap, "id", c.ID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerAccount. -func (c ContainerAccount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountName", c.AccountName) - populate(objectMap, "password", c.Password) - populate(objectMap, "spn", c.Spn) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DomainService. -func (d DomainService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DomainServiceProperties. -func (d DomainServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configDiagnostics", d.ConfigDiagnostics) - populate(objectMap, "deploymentId", d.DeploymentID) - populate(objectMap, "domainConfigurationType", d.DomainConfigurationType) - populate(objectMap, "domainName", d.DomainName) - populate(objectMap, "domainSecuritySettings", d.DomainSecuritySettings) - populate(objectMap, "filteredSync", d.FilteredSync) - populate(objectMap, "ldapsSettings", d.LdapsSettings) - populate(objectMap, "migrationProperties", d.MigrationProperties) - populate(objectMap, "notificationSettings", d.NotificationSettings) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "replicaSets", d.ReplicaSets) - populate(objectMap, "resourceForestSettings", d.ResourceForestSettings) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "syncOwner", d.SyncOwner) - populate(objectMap, "tenantId", d.TenantID) - populate(objectMap, "version", d.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HealthAlert. -func (h HealthAlert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", h.ID) - populate(objectMap, "issue", h.Issue) - populateTimeRFC3339(objectMap, "lastDetected", h.LastDetected) - populate(objectMap, "name", h.Name) - populateTimeRFC3339(objectMap, "raised", h.Raised) - populate(objectMap, "resolutionUri", h.ResolutionURI) - populate(objectMap, "severity", h.Severity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HealthAlert. -func (h *HealthAlert) UnmarshalJSON(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 "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "issue": - err = unpopulate(val, "Issue", &h.Issue) - delete(rawMsg, key) - case "lastDetected": - err = unpopulateTimeRFC3339(val, "LastDetected", &h.LastDetected) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "raised": - err = unpopulateTimeRFC3339(val, "Raised", &h.Raised) - delete(rawMsg, key) - case "resolutionUri": - err = unpopulate(val, "ResolutionURI", &h.ResolutionURI) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &h.Severity) - 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 LdapsSettings. -func (l LdapsSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "certificateNotAfter", l.CertificateNotAfter) - populate(objectMap, "certificateThumbprint", l.CertificateThumbprint) - populate(objectMap, "externalAccess", l.ExternalAccess) - populate(objectMap, "ldaps", l.Ldaps) - populate(objectMap, "pfxCertificate", l.PfxCertificate) - populate(objectMap, "pfxCertificatePassword", l.PfxCertificatePassword) - populate(objectMap, "publicCertificate", l.PublicCertificate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LdapsSettings. -func (l *LdapsSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateNotAfter": - err = unpopulateTimeRFC3339(val, "CertificateNotAfter", &l.CertificateNotAfter) - delete(rawMsg, key) - case "certificateThumbprint": - err = unpopulate(val, "CertificateThumbprint", &l.CertificateThumbprint) - delete(rawMsg, key) - case "externalAccess": - err = unpopulate(val, "ExternalAccess", &l.ExternalAccess) - delete(rawMsg, key) - case "ldaps": - err = unpopulate(val, "Ldaps", &l.Ldaps) - delete(rawMsg, key) - case "pfxCertificate": - err = unpopulate(val, "PfxCertificate", &l.PfxCertificate) - delete(rawMsg, key) - case "pfxCertificatePassword": - err = unpopulate(val, "PfxCertificatePassword", &l.PfxCertificatePassword) - delete(rawMsg, key) - case "publicCertificate": - err = unpopulate(val, "PublicCertificate", &l.PublicCertificate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NotificationSettings. -func (n NotificationSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalRecipients", n.AdditionalRecipients) - populate(objectMap, "notifyDcAdmins", n.NotifyDcAdmins) - populate(objectMap, "notifyGlobalAdmins", n.NotifyGlobalAdmins) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OuContainer. -func (o OuContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "tags", o.Tags) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OuContainerProperties. -func (o OuContainerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accounts", o.Accounts) - populate(objectMap, "containerId", o.ContainerID) - populate(objectMap, "deploymentId", o.DeploymentID) - populate(objectMap, "distinguishedName", o.DistinguishedName) - populate(objectMap, "domainName", o.DomainName) - populate(objectMap, "provisioningState", o.ProvisioningState) - populate(objectMap, "serviceStatus", o.ServiceStatus) - populate(objectMap, "tenantId", o.TenantID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ReplicaSet. -func (r ReplicaSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domainControllerIpAddress", r.DomainControllerIPAddress) - populate(objectMap, "externalAccessIpAddress", r.ExternalAccessIPAddress) - populate(objectMap, "healthAlerts", r.HealthAlerts) - populateTimeRFC1123(objectMap, "healthLastEvaluated", r.HealthLastEvaluated) - populate(objectMap, "healthMonitors", r.HealthMonitors) - populate(objectMap, "location", r.Location) - populate(objectMap, "replicaSetId", r.ReplicaSetID) - populate(objectMap, "serviceStatus", r.ServiceStatus) - populate(objectMap, "subnetId", r.SubnetID) - populate(objectMap, "vnetSiteId", r.VnetSiteID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaSet. -func (r *ReplicaSet) UnmarshalJSON(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 "domainControllerIpAddress": - err = unpopulate(val, "DomainControllerIPAddress", &r.DomainControllerIPAddress) - delete(rawMsg, key) - case "externalAccessIpAddress": - err = unpopulate(val, "ExternalAccessIPAddress", &r.ExternalAccessIPAddress) - delete(rawMsg, key) - case "healthAlerts": - err = unpopulate(val, "HealthAlerts", &r.HealthAlerts) - delete(rawMsg, key) - case "healthLastEvaluated": - err = unpopulateTimeRFC1123(val, "HealthLastEvaluated", &r.HealthLastEvaluated) - delete(rawMsg, key) - case "healthMonitors": - err = unpopulate(val, "HealthMonitors", &r.HealthMonitors) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "replicaSetId": - err = unpopulate(val, "ReplicaSetID", &r.ReplicaSetID) - delete(rawMsg, key) - case "serviceStatus": - err = unpopulate(val, "ServiceStatus", &r.ServiceStatus) - delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &r.SubnetID) - delete(rawMsg, key) - case "vnetSiteId": - err = unpopulate(val, "VnetSiteID", &r.VnetSiteID) - 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]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceForestSettings. -func (r ResourceForestSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceForest", r.ResourceForest) - populate(objectMap, "settings", r.Settings) - 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 -}