package mysql // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" "github.com/satori/go.uuid" "net/http" ) // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql" // CreateMode enumerates the values for create mode. type CreateMode string const ( // CreateModeDefault ... CreateModeDefault CreateMode = "Default" // CreateModeGeoRestore ... CreateModeGeoRestore CreateMode = "GeoRestore" // CreateModePointInTimeRestore ... CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" // CreateModeReplica ... CreateModeReplica CreateMode = "Replica" // CreateModeServerPropertiesForCreate ... CreateModeServerPropertiesForCreate CreateMode = "ServerPropertiesForCreate" ) // PossibleCreateModeValues returns an array of possible values for the CreateMode const type. func PossibleCreateModeValues() []CreateMode { return []CreateMode{CreateModeDefault, CreateModeGeoRestore, CreateModePointInTimeRestore, CreateModeReplica, CreateModeServerPropertiesForCreate} } // GeoRedundantBackup enumerates the values for geo redundant backup. type GeoRedundantBackup string const ( // Disabled ... Disabled GeoRedundantBackup = "Disabled" // Enabled ... Enabled GeoRedundantBackup = "Enabled" ) // PossibleGeoRedundantBackupValues returns an array of possible values for the GeoRedundantBackup const type. func PossibleGeoRedundantBackupValues() []GeoRedundantBackup { return []GeoRedundantBackup{Disabled, Enabled} } // IdentityType enumerates the values for identity type. type IdentityType string const ( // SystemAssigned ... SystemAssigned IdentityType = "SystemAssigned" ) // PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { return []IdentityType{SystemAssigned} } // InfrastructureEncryption enumerates the values for infrastructure encryption. type InfrastructureEncryption string const ( // InfrastructureEncryptionDisabled ... InfrastructureEncryptionDisabled InfrastructureEncryption = "Disabled" // InfrastructureEncryptionEnabled ... InfrastructureEncryptionEnabled InfrastructureEncryption = "Enabled" ) // PossibleInfrastructureEncryptionValues returns an array of possible values for the InfrastructureEncryption const type. func PossibleInfrastructureEncryptionValues() []InfrastructureEncryption { return []InfrastructureEncryption{InfrastructureEncryptionDisabled, InfrastructureEncryptionEnabled} } // MinimalTLSVersionEnum enumerates the values for minimal tls version enum. type MinimalTLSVersionEnum string const ( // TLS10 ... TLS10 MinimalTLSVersionEnum = "TLS1_0" // TLS11 ... TLS11 MinimalTLSVersionEnum = "TLS1_1" // TLS12 ... TLS12 MinimalTLSVersionEnum = "TLS1_2" // TLSEnforcementDisabled ... TLSEnforcementDisabled MinimalTLSVersionEnum = "TLSEnforcementDisabled" ) // PossibleMinimalTLSVersionEnumValues returns an array of possible values for the MinimalTLSVersionEnum const type. func PossibleMinimalTLSVersionEnumValues() []MinimalTLSVersionEnum { return []MinimalTLSVersionEnum{TLS10, TLS11, TLS12, TLSEnforcementDisabled} } // OperationOrigin enumerates the values for operation origin. type OperationOrigin string const ( // NotSpecified ... NotSpecified OperationOrigin = "NotSpecified" // System ... System OperationOrigin = "system" // User ... User OperationOrigin = "user" ) // PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. func PossibleOperationOriginValues() []OperationOrigin { return []OperationOrigin{NotSpecified, System, User} } // PrivateEndpointProvisioningState enumerates the values for private endpoint provisioning state. type PrivateEndpointProvisioningState string const ( // Approving ... Approving PrivateEndpointProvisioningState = "Approving" // Dropping ... Dropping PrivateEndpointProvisioningState = "Dropping" // Failed ... Failed PrivateEndpointProvisioningState = "Failed" // Ready ... Ready PrivateEndpointProvisioningState = "Ready" // Rejecting ... Rejecting PrivateEndpointProvisioningState = "Rejecting" ) // PossiblePrivateEndpointProvisioningStateValues returns an array of possible values for the PrivateEndpointProvisioningState const type. func PossiblePrivateEndpointProvisioningStateValues() []PrivateEndpointProvisioningState { return []PrivateEndpointProvisioningState{Approving, Dropping, Failed, Ready, Rejecting} } // PrivateLinkServiceConnectionStateActionsRequire enumerates the values for private link service connection // state actions require. type PrivateLinkServiceConnectionStateActionsRequire string const ( // None ... None PrivateLinkServiceConnectionStateActionsRequire = "None" ) // PossiblePrivateLinkServiceConnectionStateActionsRequireValues returns an array of possible values for the PrivateLinkServiceConnectionStateActionsRequire const type. func PossiblePrivateLinkServiceConnectionStateActionsRequireValues() []PrivateLinkServiceConnectionStateActionsRequire { return []PrivateLinkServiceConnectionStateActionsRequire{None} } // PrivateLinkServiceConnectionStateStatus enumerates the values for private link service connection state // status. type PrivateLinkServiceConnectionStateStatus string const ( // Approved ... Approved PrivateLinkServiceConnectionStateStatus = "Approved" // Disconnected ... Disconnected PrivateLinkServiceConnectionStateStatus = "Disconnected" // Pending ... Pending PrivateLinkServiceConnectionStateStatus = "Pending" // Rejected ... Rejected PrivateLinkServiceConnectionStateStatus = "Rejected" ) // PossiblePrivateLinkServiceConnectionStateStatusValues returns an array of possible values for the PrivateLinkServiceConnectionStateStatus const type. func PossiblePrivateLinkServiceConnectionStateStatusValues() []PrivateLinkServiceConnectionStateStatus { return []PrivateLinkServiceConnectionStateStatus{Approved, Disconnected, Pending, Rejected} } // PublicNetworkAccessEnum enumerates the values for public network access enum. type PublicNetworkAccessEnum string const ( // PublicNetworkAccessEnumDisabled ... PublicNetworkAccessEnumDisabled PublicNetworkAccessEnum = "Disabled" // PublicNetworkAccessEnumEnabled ... PublicNetworkAccessEnumEnabled PublicNetworkAccessEnum = "Enabled" ) // PossiblePublicNetworkAccessEnumValues returns an array of possible values for the PublicNetworkAccessEnum const type. func PossiblePublicNetworkAccessEnumValues() []PublicNetworkAccessEnum { return []PublicNetworkAccessEnum{PublicNetworkAccessEnumDisabled, PublicNetworkAccessEnumEnabled} } // ServerSecurityAlertPolicyState enumerates the values for server security alert policy state. type ServerSecurityAlertPolicyState string const ( // ServerSecurityAlertPolicyStateDisabled ... ServerSecurityAlertPolicyStateDisabled ServerSecurityAlertPolicyState = "Disabled" // ServerSecurityAlertPolicyStateEnabled ... ServerSecurityAlertPolicyStateEnabled ServerSecurityAlertPolicyState = "Enabled" ) // PossibleServerSecurityAlertPolicyStateValues returns an array of possible values for the ServerSecurityAlertPolicyState const type. func PossibleServerSecurityAlertPolicyStateValues() []ServerSecurityAlertPolicyState { return []ServerSecurityAlertPolicyState{ServerSecurityAlertPolicyStateDisabled, ServerSecurityAlertPolicyStateEnabled} } // ServerState enumerates the values for server state. type ServerState string const ( // ServerStateDisabled ... ServerStateDisabled ServerState = "Disabled" // ServerStateDropping ... ServerStateDropping ServerState = "Dropping" // ServerStateInaccessible ... ServerStateInaccessible ServerState = "Inaccessible" // ServerStateReady ... ServerStateReady ServerState = "Ready" ) // PossibleServerStateValues returns an array of possible values for the ServerState const type. func PossibleServerStateValues() []ServerState { return []ServerState{ServerStateDisabled, ServerStateDropping, ServerStateInaccessible, ServerStateReady} } // ServerVersion enumerates the values for server version. type ServerVersion string const ( // EightFullStopZero ... EightFullStopZero ServerVersion = "8.0" // FiveFullStopSeven ... FiveFullStopSeven ServerVersion = "5.7" // FiveFullStopSix ... FiveFullStopSix ServerVersion = "5.6" ) // PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. func PossibleServerVersionValues() []ServerVersion { return []ServerVersion{EightFullStopZero, FiveFullStopSeven, FiveFullStopSix} } // SkuTier enumerates the values for sku tier. type SkuTier string const ( // Basic ... Basic SkuTier = "Basic" // GeneralPurpose ... GeneralPurpose SkuTier = "GeneralPurpose" // MemoryOptimized ... MemoryOptimized SkuTier = "MemoryOptimized" ) // PossibleSkuTierValues returns an array of possible values for the SkuTier const type. func PossibleSkuTierValues() []SkuTier { return []SkuTier{Basic, GeneralPurpose, MemoryOptimized} } // SslEnforcementEnum enumerates the values for ssl enforcement enum. type SslEnforcementEnum string const ( // SslEnforcementEnumDisabled ... SslEnforcementEnumDisabled SslEnforcementEnum = "Disabled" // SslEnforcementEnumEnabled ... SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" ) // PossibleSslEnforcementEnumValues returns an array of possible values for the SslEnforcementEnum const type. func PossibleSslEnforcementEnumValues() []SslEnforcementEnum { return []SslEnforcementEnum{SslEnforcementEnumDisabled, SslEnforcementEnumEnabled} } // StorageAutogrow enumerates the values for storage autogrow. type StorageAutogrow string const ( // StorageAutogrowDisabled ... StorageAutogrowDisabled StorageAutogrow = "Disabled" // StorageAutogrowEnabled ... StorageAutogrowEnabled StorageAutogrow = "Enabled" ) // PossibleStorageAutogrowValues returns an array of possible values for the StorageAutogrow const type. func PossibleStorageAutogrowValues() []StorageAutogrow { return []StorageAutogrow{StorageAutogrowDisabled, StorageAutogrowEnabled} } // VirtualNetworkRuleState enumerates the values for virtual network rule state. type VirtualNetworkRuleState string const ( // VirtualNetworkRuleStateDeleting ... VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" // VirtualNetworkRuleStateInitializing ... VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" // VirtualNetworkRuleStateInProgress ... VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" // VirtualNetworkRuleStateReady ... VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" // VirtualNetworkRuleStateUnknown ... VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" ) // PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { return []VirtualNetworkRuleState{VirtualNetworkRuleStateDeleting, VirtualNetworkRuleStateInitializing, VirtualNetworkRuleStateInProgress, VirtualNetworkRuleStateReady, VirtualNetworkRuleStateUnknown} } // Advisor represents a recommendation action advisor. type Advisor struct { autorest.Response `json:"-"` // Properties - The properties of a recommendation action advisor. Properties interface{} `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // AdvisorsResultList a list of query statistics. type AdvisorsResultList struct { autorest.Response `json:"-"` // Value - READ-ONLY; The list of recommendation action advisors. Value *[]Advisor `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // AdvisorsResultListIterator provides access to a complete listing of Advisor values. type AdvisorsResultListIterator struct { i int page AdvisorsResultListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *AdvisorsResultListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsResultListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *AdvisorsResultListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter AdvisorsResultListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter AdvisorsResultListIterator) Response() AdvisorsResultList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter AdvisorsResultListIterator) Value() Advisor { if !iter.page.NotDone() { return Advisor{} } return iter.page.Values()[iter.i] } // Creates a new instance of the AdvisorsResultListIterator type. func NewAdvisorsResultListIterator(page AdvisorsResultListPage) AdvisorsResultListIterator { return AdvisorsResultListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (arl AdvisorsResultList) IsEmpty() bool { return arl.Value == nil || len(*arl.Value) == 0 } // advisorsResultListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (arl AdvisorsResultList) advisorsResultListPreparer(ctx context.Context) (*http.Request, error) { if arl.NextLink == nil || len(to.String(arl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(arl.NextLink))) } // AdvisorsResultListPage contains a page of Advisor values. type AdvisorsResultListPage struct { fn func(context.Context, AdvisorsResultList) (AdvisorsResultList, error) arl AdvisorsResultList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *AdvisorsResultListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsResultListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.arl) if err != nil { return err } page.arl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *AdvisorsResultListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page AdvisorsResultListPage) NotDone() bool { return !page.arl.IsEmpty() } // Response returns the raw server response from the last page request. func (page AdvisorsResultListPage) Response() AdvisorsResultList { return page.arl } // Values returns the slice of values for the current page or nil if there are no values. func (page AdvisorsResultListPage) Values() []Advisor { if page.arl.IsEmpty() { return nil } return *page.arl.Value } // Creates a new instance of the AdvisorsResultListPage type. func NewAdvisorsResultListPage(getNextPage func(context.Context, AdvisorsResultList) (AdvisorsResultList, error)) AdvisorsResultListPage { return AdvisorsResultListPage{fn: getNextPage} } // AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. type AzureEntityResource struct { // Etag - READ-ONLY; Resource Etag. Etag *string `json:"etag,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // CloudError an error response from the Batch service. type CloudError struct { Error *ErrorResponse `json:"error,omitempty"` } // Configuration represents a Configuration. type Configuration struct { autorest.Response `json:"-"` // ConfigurationProperties - The properties of a configuration. *ConfigurationProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Configuration. func (c Configuration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if c.ConfigurationProperties != nil { objectMap["properties"] = c.ConfigurationProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Configuration struct. func (c *Configuration) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var configurationProperties ConfigurationProperties err = json.Unmarshal(*v, &configurationProperties) if err != nil { return err } c.ConfigurationProperties = &configurationProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } c.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } c.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } c.Type = &typeVar } } } return nil } // ConfigurationListResult a list of server configurations. type ConfigurationListResult struct { autorest.Response `json:"-"` // Value - The list of server configurations. Value *[]Configuration `json:"value,omitempty"` } // ConfigurationProperties the properties of a configuration. type ConfigurationProperties struct { // Value - Value of the configuration. Value *string `json:"value,omitempty"` // Description - READ-ONLY; Description of the configuration. Description *string `json:"description,omitempty"` // DefaultValue - READ-ONLY; Default value of the configuration. DefaultValue *string `json:"defaultValue,omitempty"` // DataType - READ-ONLY; Data type of the configuration. DataType *string `json:"dataType,omitempty"` // AllowedValues - READ-ONLY; Allowed values of the configuration. AllowedValues *string `json:"allowedValues,omitempty"` // Source - Source of the configuration. Source *string `json:"source,omitempty"` } // ConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ConfigurationsCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ConfigurationsCreateOrUpdateFuture) Result(client ConfigurationsClient) (c Configuration, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ConfigurationsCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { c, err = client.CreateOrUpdateResponder(c.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") } } return } // CreateRecommendedActionSessionFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type CreateRecommendedActionSessionFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *CreateRecommendedActionSessionFuture) Result(client BaseClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.CreateRecommendedActionSessionFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.CreateRecommendedActionSessionFuture") return } ar.Response = future.Response() return } // Database represents a Database. type Database struct { autorest.Response `json:"-"` // DatabaseProperties - The properties of a database. *DatabaseProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Database. func (d Database) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if d.DatabaseProperties != nil { objectMap["properties"] = d.DatabaseProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Database struct. func (d *Database) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var databaseProperties DatabaseProperties err = json.Unmarshal(*v, &databaseProperties) if err != nil { return err } d.DatabaseProperties = &databaseProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } d.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } d.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } d.Type = &typeVar } } } return nil } // DatabaseListResult a List of databases. type DatabaseListResult struct { autorest.Response `json:"-"` // Value - The list of databases housed in a server Value *[]Database `json:"value,omitempty"` } // DatabaseProperties the properties of a database. type DatabaseProperties struct { // Charset - The charset of the database. Charset *string `json:"charset,omitempty"` // Collation - The collation of the database. Collation *string `json:"collation,omitempty"` } // DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DatabasesCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Database, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.DatabasesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { d, err = client.CreateOrUpdateResponder(d.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") } } return } // DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DatabasesDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *DatabasesDeleteFuture) Result(client DatabasesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.DatabasesDeleteFuture") return } ar.Response = future.Response() return } // ErrorAdditionalInfo the resource management error additional info. type ErrorAdditionalInfo struct { // Type - READ-ONLY; The additional info type. Type *string `json:"type,omitempty"` // Info - READ-ONLY; The additional info. Info interface{} `json:"info,omitempty"` } // ErrorResponse the resource management error response. type ErrorResponse struct { // Code - READ-ONLY; The error code. Code *string `json:"code,omitempty"` // Message - READ-ONLY; The error message. Message *string `json:"message,omitempty"` // Target - READ-ONLY; The error target. Target *string `json:"target,omitempty"` // Details - READ-ONLY; The error details. Details *[]ErrorResponse `json:"details,omitempty"` // AdditionalInfo - READ-ONLY; The error additional info. AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` } // FirewallRule represents a server firewall rule. type FirewallRule struct { autorest.Response `json:"-"` // FirewallRuleProperties - The properties of a firewall rule. *FirewallRuleProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for FirewallRule. func (fr FirewallRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if fr.FirewallRuleProperties != nil { objectMap["properties"] = fr.FirewallRuleProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. func (fr *FirewallRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var firewallRuleProperties FirewallRuleProperties err = json.Unmarshal(*v, &firewallRuleProperties) if err != nil { return err } fr.FirewallRuleProperties = &firewallRuleProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } fr.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } fr.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } fr.Type = &typeVar } } } return nil } // FirewallRuleListResult a list of firewall rules. type FirewallRuleListResult struct { autorest.Response `json:"-"` // Value - The list of firewall rules in a server. Value *[]FirewallRule `json:"value,omitempty"` } // FirewallRuleProperties the properties of a server firewall rule. type FirewallRuleProperties struct { // StartIPAddress - The start IP address of the server firewall rule. Must be IPv4 format. StartIPAddress *string `json:"startIpAddress,omitempty"` // EndIPAddress - The end IP address of the server firewall rule. Must be IPv4 format. EndIPAddress *string `json:"endIpAddress,omitempty"` } // FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type FirewallRulesCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *FirewallRulesCreateOrUpdateFuture) Result(client FirewallRulesClient) (fr FirewallRule, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.FirewallRulesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if fr.Response.Response, err = future.GetResult(sender); err == nil && fr.Response.Response.StatusCode != http.StatusNoContent { fr, err = client.CreateOrUpdateResponder(fr.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", fr.Response.Response, "Failure responding to request") } } return } // FirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type FirewallRulesDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *FirewallRulesDeleteFuture) Result(client FirewallRulesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.FirewallRulesDeleteFuture") return } ar.Response = future.Response() return } // LogFile represents a log file. type LogFile struct { // LogFileProperties - The properties of the log file. *LogFileProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for LogFile. func (lf LogFile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if lf.LogFileProperties != nil { objectMap["properties"] = lf.LogFileProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for LogFile struct. func (lf *LogFile) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var logFileProperties LogFileProperties err = json.Unmarshal(*v, &logFileProperties) if err != nil { return err } lf.LogFileProperties = &logFileProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } lf.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } lf.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } lf.Type = &typeVar } } } return nil } // LogFileListResult a list of log files. type LogFileListResult struct { autorest.Response `json:"-"` // Value - The list of log files. Value *[]LogFile `json:"value,omitempty"` } // LogFileProperties the properties of a log file. type LogFileProperties struct { // SizeInKB - Size of the log file. SizeInKB *int64 `json:"sizeInKB,omitempty"` // CreatedTime - READ-ONLY; Creation timestamp of the log file. CreatedTime *date.Time `json:"createdTime,omitempty"` // LastModifiedTime - READ-ONLY; Last modified timestamp of the log file. LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` // Type - Type of the log file. Type *string `json:"type,omitempty"` // URL - The url to download the log file from. URL *string `json:"url,omitempty"` } // NameAvailability represents a resource name availability. type NameAvailability struct { autorest.Response `json:"-"` // Message - Error Message. Message *string `json:"message,omitempty"` // NameAvailable - Indicates whether the resource name is available. NameAvailable *bool `json:"nameAvailable,omitempty"` // Reason - Reason for name being unavailable. Reason *string `json:"reason,omitempty"` } // NameAvailabilityRequest request from client to check resource name availability. type NameAvailabilityRequest struct { // Name - Resource name to verify. Name *string `json:"name,omitempty"` // Type - Resource type used for verification. Type *string `json:"type,omitempty"` } // Operation REST API operation definition. type Operation struct { // Name - READ-ONLY; The name of the operation being performed on this particular object. Name *string `json:"name,omitempty"` // Display - READ-ONLY; The localized display information for this particular operation or action. Display *OperationDisplay `json:"display,omitempty"` // Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'NotSpecified', 'User', 'System' Origin OperationOrigin `json:"origin,omitempty"` // Properties - READ-ONLY; Additional descriptions for the operation. Properties map[string]interface{} `json:"properties"` } // MarshalJSON is the custom marshaler for Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } // OperationDisplay display metadata associated with the operation. type OperationDisplay struct { // Provider - READ-ONLY; Operation resource provider name. Provider *string `json:"provider,omitempty"` // Resource - READ-ONLY; Resource on which the operation is performed. Resource *string `json:"resource,omitempty"` // Operation - READ-ONLY; Localized friendly name for the operation. Operation *string `json:"operation,omitempty"` // Description - READ-ONLY; Operation description. Description *string `json:"description,omitempty"` } // OperationListResult a list of resource provider operations. type OperationListResult struct { autorest.Response `json:"-"` // Value - The list of resource provider operations. Value *[]Operation `json:"value,omitempty"` } // PerformanceTierListResult a list of performance tiers. type PerformanceTierListResult struct { autorest.Response `json:"-"` // Value - The list of performance tiers Value *[]PerformanceTierProperties `json:"value,omitempty"` } // PerformanceTierProperties performance tier properties type PerformanceTierProperties struct { // ID - ID of the performance tier. ID *string `json:"id,omitempty"` // ServiceLevelObjectives - Service level objectives associated with the performance tier ServiceLevelObjectives *[]PerformanceTierServiceLevelObjectives `json:"serviceLevelObjectives,omitempty"` } // PerformanceTierServiceLevelObjectives service level objectives for performance tier. type PerformanceTierServiceLevelObjectives struct { // ID - ID for the service level objective. ID *string `json:"id,omitempty"` // Edition - Edition of the performance tier. Edition *string `json:"edition,omitempty"` // VCore - vCore associated with the service level objective VCore *int32 `json:"vCore,omitempty"` // HardwareGeneration - Hardware generation associated with the service level objective HardwareGeneration *string `json:"hardwareGeneration,omitempty"` // MaxBackupRetentionDays - Maximum Backup retention in days for the performance tier edition MaxBackupRetentionDays *int32 `json:"maxBackupRetentionDays,omitempty"` // MinBackupRetentionDays - Minimum Backup retention in days for the performance tier edition MinBackupRetentionDays *int32 `json:"minBackupRetentionDays,omitempty"` // MaxStorageMB - Max storage allowed for a server. MaxStorageMB *int32 `json:"maxStorageMB,omitempty"` // MinStorageMB - Max storage allowed for a server. MinStorageMB *int32 `json:"minStorageMB,omitempty"` } // PrivateEndpointConnection a private endpoint connection type PrivateEndpointConnection struct { autorest.Response `json:"-"` // PrivateEndpointConnectionProperties - Resource properties. *PrivateEndpointConnectionProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for PrivateEndpointConnection. func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if pec.PrivateEndpointConnectionProperties != nil { objectMap["properties"] = pec.PrivateEndpointConnectionProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var privateEndpointConnectionProperties PrivateEndpointConnectionProperties err = json.Unmarshal(*v, &privateEndpointConnectionProperties) if err != nil { return err } pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } pec.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } pec.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } pec.Type = &typeVar } } } return nil } // PrivateEndpointConnectionListResult a list of private endpoint connections. type PrivateEndpointConnectionListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. Value *[]PrivateEndpointConnection `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // PrivateEndpointConnectionListResultIterator provides access to a complete listing of // PrivateEndpointConnection values. type PrivateEndpointConnectionListResultIterator struct { i int page PrivateEndpointConnectionListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *PrivateEndpointConnectionListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { if !iter.page.NotDone() { return PrivateEndpointConnection{} } return iter.page.Values()[iter.i] } // Creates a new instance of the PrivateEndpointConnectionListResultIterator type. func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { return PrivateEndpointConnectionListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { return peclr.Value == nil || len(*peclr.Value) == 0 } // privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { if peclr.NextLink == nil || len(to.String(peclr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(peclr.NextLink))) } // PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. type PrivateEndpointConnectionListResultPage struct { fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) peclr PrivateEndpointConnectionListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.peclr) if err != nil { return err } page.peclr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *PrivateEndpointConnectionListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page PrivateEndpointConnectionListResultPage) NotDone() bool { return !page.peclr.IsEmpty() } // Response returns the raw server response from the last page request. func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { return page.peclr } // Values returns the slice of values for the current page or nil if there are no values. func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { if page.peclr.IsEmpty() { return nil } return *page.peclr.Value } // Creates a new instance of the PrivateEndpointConnectionListResultPage type. func NewPrivateEndpointConnectionListResultPage(getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { return PrivateEndpointConnectionListResultPage{fn: getNextPage} } // PrivateEndpointConnectionProperties properties of a private endpoint connection. type PrivateEndpointConnectionProperties struct { // PrivateEndpoint - Private endpoint which the connection belongs to. PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` // ProvisioningState - READ-ONLY; State of the private endpoint connection. ProvisioningState *string `json:"provisioningState,omitempty"` } // PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type PrivateEndpointConnectionsCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) Result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.PrivateEndpointConnectionsCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { pec, err = client.CreateOrUpdateResponder(pec.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") } } return } // PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PrivateEndpointConnectionsDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *PrivateEndpointConnectionsDeleteFuture) Result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.PrivateEndpointConnectionsDeleteFuture") return } ar.Response = future.Response() return } // PrivateEndpointConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type PrivateEndpointConnectionsUpdateTagsFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *PrivateEndpointConnectionsUpdateTagsFuture) Result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.PrivateEndpointConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.PrivateEndpointConnectionsUpdateTagsFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { pec, err = client.UpdateTagsResponder(pec.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.PrivateEndpointConnectionsUpdateTagsFuture", "Result", pec.Response.Response, "Failure responding to request") } } return } // PrivateEndpointProperty ... type PrivateEndpointProperty struct { // ID - Resource id of the private endpoint. ID *string `json:"id,omitempty"` } // PrivateLinkResource a private link resource type PrivateLinkResource struct { autorest.Response `json:"-"` // Properties - READ-ONLY; The private link resource group id. Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // PrivateLinkResourceListResult a list of private link resources type PrivateLinkResourceListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. Value *[]PrivateLinkResource `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource // values. type PrivateLinkResourceListResultIterator struct { i int page PrivateLinkResourceListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *PrivateLinkResourceListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter PrivateLinkResourceListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { if !iter.page.NotDone() { return PrivateLinkResource{} } return iter.page.Values()[iter.i] } // Creates a new instance of the PrivateLinkResourceListResultIterator type. func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { return PrivateLinkResourceListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { return plrlr.Value == nil || len(*plrlr.Value) == 0 } // privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { if plrlr.NextLink == nil || len(to.String(plrlr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(plrlr.NextLink))) } // PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. type PrivateLinkResourceListResultPage struct { fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) plrlr PrivateLinkResourceListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.plrlr) if err != nil { return err } page.plrlr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *PrivateLinkResourceListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page PrivateLinkResourceListResultPage) NotDone() bool { return !page.plrlr.IsEmpty() } // Response returns the raw server response from the last page request. func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { return page.plrlr } // Values returns the slice of values for the current page or nil if there are no values. func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { if page.plrlr.IsEmpty() { return nil } return *page.plrlr.Value } // Creates a new instance of the PrivateLinkResourceListResultPage type. func NewPrivateLinkResourceListResultPage(getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { return PrivateLinkResourceListResultPage{fn: getNextPage} } // PrivateLinkResourceProperties properties of a private link resource. type PrivateLinkResourceProperties struct { // GroupID - READ-ONLY; The private link resource group id. GroupID *string `json:"groupId,omitempty"` // RequiredMembers - READ-ONLY; The private link resource required member names. RequiredMembers *[]string `json:"requiredMembers,omitempty"` } // PrivateLinkServiceConnectionStateProperty ... type PrivateLinkServiceConnectionStateProperty struct { // Status - The private link service connection status. Status *string `json:"status,omitempty"` // Description - The private link service connection description. Description *string `json:"description,omitempty"` // ActionsRequired - READ-ONLY; The actions required for private link service connection. ActionsRequired *string `json:"actionsRequired,omitempty"` } // ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than // required location and tags type ProxyResource struct { // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // QueryStatistic represents a Query Statistic. type QueryStatistic struct { autorest.Response `json:"-"` // QueryStatisticProperties - The properties of a query statistic. *QueryStatisticProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for QueryStatistic. func (qs QueryStatistic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if qs.QueryStatisticProperties != nil { objectMap["properties"] = qs.QueryStatisticProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for QueryStatistic struct. func (qs *QueryStatistic) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var queryStatisticProperties QueryStatisticProperties err = json.Unmarshal(*v, &queryStatisticProperties) if err != nil { return err } qs.QueryStatisticProperties = &queryStatisticProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } qs.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } qs.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } qs.Type = &typeVar } } } return nil } // QueryStatisticProperties the properties of a query statistic. type QueryStatisticProperties struct { // QueryID - Database query identifier. QueryID *string `json:"queryId,omitempty"` // StartTime - Observation start time. StartTime *date.Time `json:"startTime,omitempty"` // EndTime - Observation end time. EndTime *date.Time `json:"endTime,omitempty"` // AggregationFunction - Aggregation function name. AggregationFunction *string `json:"aggregationFunction,omitempty"` // DatabaseNames - The list of database names. DatabaseNames *[]string `json:"databaseNames,omitempty"` // QueryExecutionCount - Number of query executions in this time interval. QueryExecutionCount *int64 `json:"queryExecutionCount,omitempty"` // MetricName - Metric name. MetricName *string `json:"metricName,omitempty"` // MetricDisplayName - Metric display name. MetricDisplayName *string `json:"metricDisplayName,omitempty"` // MetricValue - Metric value. MetricValue *float64 `json:"metricValue,omitempty"` // MetricValueUnit - Metric value unit. MetricValueUnit *string `json:"metricValueUnit,omitempty"` } // QueryText represents a Query Text. type QueryText struct { autorest.Response `json:"-"` // QueryTextProperties - The properties of a query text. *QueryTextProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for QueryText. func (qt QueryText) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if qt.QueryTextProperties != nil { objectMap["properties"] = qt.QueryTextProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for QueryText struct. func (qt *QueryText) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var queryTextProperties QueryTextProperties err = json.Unmarshal(*v, &queryTextProperties) if err != nil { return err } qt.QueryTextProperties = &queryTextProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } qt.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } qt.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } qt.Type = &typeVar } } } return nil } // QueryTextProperties the properties of a query text. type QueryTextProperties struct { // QueryID - Query identifier unique to the server. QueryID *string `json:"queryId,omitempty"` // QueryText - Query text. QueryText *string `json:"queryText,omitempty"` } // QueryTextsResultList a list of query texts. type QueryTextsResultList struct { autorest.Response `json:"-"` // Value - READ-ONLY; The list of query texts. Value *[]QueryText `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // QueryTextsResultListIterator provides access to a complete listing of QueryText values. type QueryTextsResultListIterator struct { i int page QueryTextsResultListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *QueryTextsResultListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsResultListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *QueryTextsResultListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter QueryTextsResultListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter QueryTextsResultListIterator) Response() QueryTextsResultList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter QueryTextsResultListIterator) Value() QueryText { if !iter.page.NotDone() { return QueryText{} } return iter.page.Values()[iter.i] } // Creates a new instance of the QueryTextsResultListIterator type. func NewQueryTextsResultListIterator(page QueryTextsResultListPage) QueryTextsResultListIterator { return QueryTextsResultListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (qtrl QueryTextsResultList) IsEmpty() bool { return qtrl.Value == nil || len(*qtrl.Value) == 0 } // queryTextsResultListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (qtrl QueryTextsResultList) queryTextsResultListPreparer(ctx context.Context) (*http.Request, error) { if qtrl.NextLink == nil || len(to.String(qtrl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(qtrl.NextLink))) } // QueryTextsResultListPage contains a page of QueryText values. type QueryTextsResultListPage struct { fn func(context.Context, QueryTextsResultList) (QueryTextsResultList, error) qtrl QueryTextsResultList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *QueryTextsResultListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsResultListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.qtrl) if err != nil { return err } page.qtrl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *QueryTextsResultListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page QueryTextsResultListPage) NotDone() bool { return !page.qtrl.IsEmpty() } // Response returns the raw server response from the last page request. func (page QueryTextsResultListPage) Response() QueryTextsResultList { return page.qtrl } // Values returns the slice of values for the current page or nil if there are no values. func (page QueryTextsResultListPage) Values() []QueryText { if page.qtrl.IsEmpty() { return nil } return *page.qtrl.Value } // Creates a new instance of the QueryTextsResultListPage type. func NewQueryTextsResultListPage(getNextPage func(context.Context, QueryTextsResultList) (QueryTextsResultList, error)) QueryTextsResultListPage { return QueryTextsResultListPage{fn: getNextPage} } // RecommendationAction represents a Recommendation Action. type RecommendationAction struct { autorest.Response `json:"-"` // RecommendationActionProperties - The properties of a recommendation action. *RecommendationActionProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for RecommendationAction. func (ra RecommendationAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if ra.RecommendationActionProperties != nil { objectMap["properties"] = ra.RecommendationActionProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RecommendationAction struct. func (ra *RecommendationAction) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var recommendationActionProperties RecommendationActionProperties err = json.Unmarshal(*v, &recommendationActionProperties) if err != nil { return err } ra.RecommendationActionProperties = &recommendationActionProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } ra.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } ra.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } ra.Type = &typeVar } } } return nil } // RecommendationActionProperties the properties of a recommendation action. type RecommendationActionProperties struct { // AdvisorName - Advisor name. AdvisorName *string `json:"advisorName,omitempty"` // SessionID - Recommendation action session identifier. SessionID *string `json:"sessionId,omitempty"` // ActionID - Recommendation action identifier. ActionID *int32 `json:"actionId,omitempty"` // CreatedTime - Recommendation action creation time. CreatedTime *date.Time `json:"createdTime,omitempty"` // ExpirationTime - Recommendation action expiration time. ExpirationTime *date.Time `json:"expirationTime,omitempty"` // Reason - Recommendation action reason. Reason *string `json:"reason,omitempty"` // RecommendationType - Recommendation action type. RecommendationType *string `json:"recommendationType,omitempty"` // Details - Recommendation action details. Details map[string]*string `json:"details"` } // MarshalJSON is the custom marshaler for RecommendationActionProperties. func (rap RecommendationActionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if rap.AdvisorName != nil { objectMap["advisorName"] = rap.AdvisorName } if rap.SessionID != nil { objectMap["sessionId"] = rap.SessionID } if rap.ActionID != nil { objectMap["actionId"] = rap.ActionID } if rap.CreatedTime != nil { objectMap["createdTime"] = rap.CreatedTime } if rap.ExpirationTime != nil { objectMap["expirationTime"] = rap.ExpirationTime } if rap.Reason != nil { objectMap["reason"] = rap.Reason } if rap.RecommendationType != nil { objectMap["recommendationType"] = rap.RecommendationType } if rap.Details != nil { objectMap["details"] = rap.Details } return json.Marshal(objectMap) } // RecommendationActionsResultList a list of recommendation actions. type RecommendationActionsResultList struct { autorest.Response `json:"-"` // Value - READ-ONLY; The list of recommendation action advisors. Value *[]RecommendationAction `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // RecommendationActionsResultListIterator provides access to a complete listing of RecommendationAction // values. type RecommendationActionsResultListIterator struct { i int page RecommendationActionsResultListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *RecommendationActionsResultListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationActionsResultListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *RecommendationActionsResultListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter RecommendationActionsResultListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter RecommendationActionsResultListIterator) Response() RecommendationActionsResultList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter RecommendationActionsResultListIterator) Value() RecommendationAction { if !iter.page.NotDone() { return RecommendationAction{} } return iter.page.Values()[iter.i] } // Creates a new instance of the RecommendationActionsResultListIterator type. func NewRecommendationActionsResultListIterator(page RecommendationActionsResultListPage) RecommendationActionsResultListIterator { return RecommendationActionsResultListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (rarl RecommendationActionsResultList) IsEmpty() bool { return rarl.Value == nil || len(*rarl.Value) == 0 } // recommendationActionsResultListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rarl RecommendationActionsResultList) recommendationActionsResultListPreparer(ctx context.Context) (*http.Request, error) { if rarl.NextLink == nil || len(to.String(rarl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(rarl.NextLink))) } // RecommendationActionsResultListPage contains a page of RecommendationAction values. type RecommendationActionsResultListPage struct { fn func(context.Context, RecommendationActionsResultList) (RecommendationActionsResultList, error) rarl RecommendationActionsResultList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *RecommendationActionsResultListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationActionsResultListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.rarl) if err != nil { return err } page.rarl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *RecommendationActionsResultListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page RecommendationActionsResultListPage) NotDone() bool { return !page.rarl.IsEmpty() } // Response returns the raw server response from the last page request. func (page RecommendationActionsResultListPage) Response() RecommendationActionsResultList { return page.rarl } // Values returns the slice of values for the current page or nil if there are no values. func (page RecommendationActionsResultListPage) Values() []RecommendationAction { if page.rarl.IsEmpty() { return nil } return *page.rarl.Value } // Creates a new instance of the RecommendationActionsResultListPage type. func NewRecommendationActionsResultListPage(getNextPage func(context.Context, RecommendationActionsResultList) (RecommendationActionsResultList, error)) RecommendationActionsResultListPage { return RecommendationActionsResultListPage{fn: getNextPage} } // RecommendedActionSessionsOperationStatus recommendation action session operation status. type RecommendedActionSessionsOperationStatus struct { autorest.Response `json:"-"` // Name - Operation identifier. Name *string `json:"name,omitempty"` // StartTime - Operation start time. StartTime *date.Time `json:"startTime,omitempty"` // Status - Operation status. Status *string `json:"status,omitempty"` } // Resource ... type Resource struct { // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // ResourceIdentity azure Active Directory identity configuration for a resource. type ResourceIdentity struct { // PrincipalID - READ-ONLY; The Azure Active Directory principal id. PrincipalID *uuid.UUID `json:"principalId,omitempty"` // Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned' Type IdentityType `json:"type,omitempty"` // TenantID - READ-ONLY; The Azure Active Directory tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` } // SecurityAlertPolicyProperties properties of a security alert policy. type SecurityAlertPolicyProperties struct { // State - Specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'ServerSecurityAlertPolicyStateEnabled', 'ServerSecurityAlertPolicyStateDisabled' State ServerSecurityAlertPolicyState `json:"state,omitempty"` // DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly DisabledAlerts *[]string `json:"disabledAlerts,omitempty"` // EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent. EmailAddresses *[]string `json:"emailAddresses,omitempty"` // EmailAccountAdmins - Specifies that the alert is sent to the account administrators. EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. StorageEndpoint *string `json:"storageEndpoint,omitempty"` // StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs. RetentionDays *int32 `json:"retentionDays,omitempty"` } // Server represents a server. type Server struct { autorest.Response `json:"-"` // Identity - The Azure Active Directory identity of the server. Identity *ResourceIdentity `json:"identity,omitempty"` // Sku - The SKU (pricing tier) of the server. Sku *Sku `json:"sku,omitempty"` // ServerProperties - Properties of the server. *ServerProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Server. func (s Server) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if s.Identity != nil { objectMap["identity"] = s.Identity } if s.Sku != nil { objectMap["sku"] = s.Sku } if s.ServerProperties != nil { objectMap["properties"] = s.ServerProperties } if s.Tags != nil { objectMap["tags"] = s.Tags } if s.Location != nil { objectMap["location"] = s.Location } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Server struct. func (s *Server) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "identity": if v != nil { var identity ResourceIdentity err = json.Unmarshal(*v, &identity) if err != nil { return err } s.Identity = &identity } case "sku": if v != nil { var sku Sku err = json.Unmarshal(*v, &sku) if err != nil { return err } s.Sku = &sku } case "properties": if v != nil { var serverProperties ServerProperties err = json.Unmarshal(*v, &serverProperties) if err != nil { return err } s.ServerProperties = &serverProperties } case "tags": if v != nil { var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } s.Tags = tags } case "location": if v != nil { var location string err = json.Unmarshal(*v, &location) if err != nil { return err } s.Location = &location } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } s.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } s.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } s.Type = &typeVar } } } return nil } // ServerAdministratorProperties the properties of an server Administrator. type ServerAdministratorProperties struct { // AdministratorType - The type of administrator. AdministratorType *string `json:"administratorType,omitempty"` // Login - The server administrator login account name. Login *string `json:"login,omitempty"` // Sid - The server administrator Sid (Secure ID). Sid *uuid.UUID `json:"sid,omitempty"` // TenantID - The server Active Directory Administrator tenant id. TenantID *uuid.UUID `json:"tenantId,omitempty"` } // ServerAdministratorResource represents a and external administrator to be created. type ServerAdministratorResource struct { autorest.Response `json:"-"` // ServerAdministratorProperties - Properties of the server AAD administrator. *ServerAdministratorProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for ServerAdministratorResource. func (sar ServerAdministratorResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if sar.ServerAdministratorProperties != nil { objectMap["properties"] = sar.ServerAdministratorProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerAdministratorResource struct. func (sar *ServerAdministratorResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var serverAdministratorProperties ServerAdministratorProperties err = json.Unmarshal(*v, &serverAdministratorProperties) if err != nil { return err } sar.ServerAdministratorProperties = &serverAdministratorProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } sar.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } sar.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } sar.Type = &typeVar } } } return nil } // ServerAdministratorResourceListResult the response to a list Active Directory Administrators request. type ServerAdministratorResourceListResult struct { autorest.Response `json:"-"` // Value - The list of server Active Directory Administrators for the server. Value *[]ServerAdministratorResource `json:"value,omitempty"` } // ServerAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ServerAdministratorsCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServerAdministratorsCreateOrUpdateFuture) Result(client ServerAdministratorsClient) (sar ServerAdministratorResource, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServerAdministratorsCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if sar.Response.Response, err = future.GetResult(sender); err == nil && sar.Response.Response.StatusCode != http.StatusNoContent { sar, err = client.CreateOrUpdateResponder(sar.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsCreateOrUpdateFuture", "Result", sar.Response.Response, "Failure responding to request") } } return } // ServerAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ServerAdministratorsDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServerAdministratorsDeleteFuture) Result(client ServerAdministratorsClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServerAdministratorsDeleteFuture") return } ar.Response = future.Response() return } // ServerForCreate represents a server to be created. type ServerForCreate struct { // Identity - The Azure Active Directory identity of the server. Identity *ResourceIdentity `json:"identity,omitempty"` // Sku - The SKU (pricing tier) of the server. Sku *Sku `json:"sku,omitempty"` // Properties - Properties of the server. Properties BasicServerPropertiesForCreate `json:"properties,omitempty"` // Location - The location the resource resides in. Location *string `json:"location,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for ServerForCreate. func (sfc ServerForCreate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if sfc.Identity != nil { objectMap["identity"] = sfc.Identity } if sfc.Sku != nil { objectMap["sku"] = sfc.Sku } objectMap["properties"] = sfc.Properties if sfc.Location != nil { objectMap["location"] = sfc.Location } if sfc.Tags != nil { objectMap["tags"] = sfc.Tags } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerForCreate struct. func (sfc *ServerForCreate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "identity": if v != nil { var identity ResourceIdentity err = json.Unmarshal(*v, &identity) if err != nil { return err } sfc.Identity = &identity } case "sku": if v != nil { var sku Sku err = json.Unmarshal(*v, &sku) if err != nil { return err } sfc.Sku = &sku } case "properties": if v != nil { properties, err := unmarshalBasicServerPropertiesForCreate(*v) if err != nil { return err } sfc.Properties = properties } case "location": if v != nil { var location string err = json.Unmarshal(*v, &location) if err != nil { return err } sfc.Location = &location } case "tags": if v != nil { var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } sfc.Tags = tags } } } return nil } // ServerKey a MySQL Server key. type ServerKey struct { autorest.Response `json:"-"` // Kind - READ-ONLY; Kind of encryption protector used to protect the key. Kind *string `json:"kind,omitempty"` // ServerKeyProperties - Properties of the ServerKey Resource. *ServerKeyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for ServerKey. func (sk ServerKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if sk.ServerKeyProperties != nil { objectMap["properties"] = sk.ServerKeyProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerKey struct. func (sk *ServerKey) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "kind": if v != nil { var kind string err = json.Unmarshal(*v, &kind) if err != nil { return err } sk.Kind = &kind } case "properties": if v != nil { var serverKeyProperties ServerKeyProperties err = json.Unmarshal(*v, &serverKeyProperties) if err != nil { return err } sk.ServerKeyProperties = &serverKeyProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } sk.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } sk.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } sk.Type = &typeVar } } } return nil } // ServerKeyListResult a list of MySQL Server keys. type ServerKeyListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; A list of MySQL Server keys. Value *[]ServerKey `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // ServerKeyListResultIterator provides access to a complete listing of ServerKey values. type ServerKeyListResultIterator struct { i int page ServerKeyListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *ServerKeyListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *ServerKeyListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter ServerKeyListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter ServerKeyListResultIterator) Response() ServerKeyListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter ServerKeyListResultIterator) Value() ServerKey { if !iter.page.NotDone() { return ServerKey{} } return iter.page.Values()[iter.i] } // Creates a new instance of the ServerKeyListResultIterator type. func NewServerKeyListResultIterator(page ServerKeyListResultPage) ServerKeyListResultIterator { return ServerKeyListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (sklr ServerKeyListResult) IsEmpty() bool { return sklr.Value == nil || len(*sklr.Value) == 0 } // serverKeyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sklr ServerKeyListResult) serverKeyListResultPreparer(ctx context.Context) (*http.Request, error) { if sklr.NextLink == nil || len(to.String(sklr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(sklr.NextLink))) } // ServerKeyListResultPage contains a page of ServerKey values. type ServerKeyListResultPage struct { fn func(context.Context, ServerKeyListResult) (ServerKeyListResult, error) sklr ServerKeyListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *ServerKeyListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.sklr) if err != nil { return err } page.sklr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *ServerKeyListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page ServerKeyListResultPage) NotDone() bool { return !page.sklr.IsEmpty() } // Response returns the raw server response from the last page request. func (page ServerKeyListResultPage) Response() ServerKeyListResult { return page.sklr } // Values returns the slice of values for the current page or nil if there are no values. func (page ServerKeyListResultPage) Values() []ServerKey { if page.sklr.IsEmpty() { return nil } return *page.sklr.Value } // Creates a new instance of the ServerKeyListResultPage type. func NewServerKeyListResultPage(getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage { return ServerKeyListResultPage{fn: getNextPage} } // ServerKeyProperties properties for a key execution. type ServerKeyProperties struct { // ServerKeyType - The key type like 'AzureKeyVault'. ServerKeyType *string `json:"serverKeyType,omitempty"` // URI - The URI of the key. URI *string `json:"uri,omitempty"` // CreationDate - READ-ONLY; The key creation date. CreationDate *date.Time `json:"creationDate,omitempty"` } // ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ServerKeysCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServerKeysCreateOrUpdateFuture) Result(client ServerKeysClient) (sk ServerKey, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServerKeysCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if sk.Response.Response, err = future.GetResult(sender); err == nil && sk.Response.Response.StatusCode != http.StatusNoContent { sk, err = client.CreateOrUpdateResponder(sk.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerKeysCreateOrUpdateFuture", "Result", sk.Response.Response, "Failure responding to request") } } return } // ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServerKeysDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServerKeysDeleteFuture) Result(client ServerKeysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerKeysDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServerKeysDeleteFuture") return } ar.Response = future.Response() return } // ServerListResult a list of servers. type ServerListResult struct { autorest.Response `json:"-"` // Value - The list of servers Value *[]Server `json:"value,omitempty"` } // ServerPrivateEndpointConnection a private endpoint connection under a server type ServerPrivateEndpointConnection struct { // ID - READ-ONLY; Resource Id of the private endpoint connection. ID *string `json:"id,omitempty"` // Properties - READ-ONLY; Private endpoint connection properties Properties *ServerPrivateEndpointConnectionProperties `json:"properties,omitempty"` } // ServerPrivateEndpointConnectionProperties properties of a private endpoint connection. type ServerPrivateEndpointConnectionProperties struct { // PrivateEndpoint - Private endpoint which the connection belongs to. PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. PrivateLinkServiceConnectionState *ServerPrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` // ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', 'Rejecting' ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"` } // ServerPrivateLinkServiceConnectionStateProperty ... type ServerPrivateLinkServiceConnectionStateProperty struct { // Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected' Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"` // Description - The private link service connection description. Description *string `json:"description,omitempty"` // ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'None' ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"` } // ServerProperties the properties of a server. type ServerProperties struct { // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). AdministratorLogin *string `json:"administratorLogin,omitempty"` // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven', 'EightFullStopZero' Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // ByokEnforcement - READ-ONLY; Status showing whether the server data encryption is enabled with customer-managed keys. ByokEnforcement *string `json:"byokEnforcement,omitempty"` // InfrastructureEncryption - Status showing whether the server enabled infrastructure encryption. Possible values include: 'InfrastructureEncryptionEnabled', 'InfrastructureEncryptionDisabled' InfrastructureEncryption InfrastructureEncryption `json:"infrastructureEncryption,omitempty"` // UserVisibleState - A state of a server that is visible to user. Possible values include: 'ServerStateReady', 'ServerStateDropping', 'ServerStateDisabled', 'ServerStateInaccessible' UserVisibleState ServerState `json:"userVisibleState,omitempty"` // FullyQualifiedDomainName - The fully qualified domain name of a server. FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` // EarliestRestoreDate - Earliest restore point creation time (ISO8601 format) EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // ReplicationRole - The replication role of the server. ReplicationRole *string `json:"replicationRole,omitempty"` // MasterServerID - The master server id of a replica server. MasterServerID *string `json:"masterServerId,omitempty"` // ReplicaCapacity - The maximum number of replicas that a master server can have. ReplicaCapacity *int32 `json:"replicaCapacity,omitempty"` // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` // PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` } // BasicServerPropertiesForCreate the properties used to create a new server. type BasicServerPropertiesForCreate interface { AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) } // ServerPropertiesForCreate the properties used to create a new server. type ServerPropertiesForCreate struct { // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven', 'EightFullStopZero' Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // InfrastructureEncryption - Status showing whether the server enabled infrastructure encryption. Possible values include: 'InfrastructureEncryptionEnabled', 'InfrastructureEncryptionDisabled' InfrastructureEncryption InfrastructureEncryption `json:"infrastructureEncryption,omitempty"` // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' CreateMode CreateMode `json:"createMode,omitempty"` } func unmarshalBasicServerPropertiesForCreate(body []byte) (BasicServerPropertiesForCreate, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } switch m["createMode"] { case string(CreateModeDefault): var spfdc ServerPropertiesForDefaultCreate err := json.Unmarshal(body, &spfdc) return spfdc, err case string(CreateModePointInTimeRestore): var spfr ServerPropertiesForRestore err := json.Unmarshal(body, &spfr) return spfr, err case string(CreateModeGeoRestore): var spfgr ServerPropertiesForGeoRestore err := json.Unmarshal(body, &spfgr) return spfgr, err case string(CreateModeReplica): var spfr ServerPropertiesForReplica err := json.Unmarshal(body, &spfr) return spfr, err default: var spfc ServerPropertiesForCreate err := json.Unmarshal(body, &spfc) return spfc, err } } func unmarshalBasicServerPropertiesForCreateArray(body []byte) ([]BasicServerPropertiesForCreate, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } spfcArray := make([]BasicServerPropertiesForCreate, len(rawMessages)) for index, rawMessage := range rawMessages { spfc, err := unmarshalBasicServerPropertiesForCreate(*rawMessage) if err != nil { return nil, err } spfcArray[index] = spfc } return spfcArray, nil } // MarshalJSON is the custom marshaler for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) MarshalJSON() ([]byte, error) { spfc.CreateMode = CreateModeServerPropertiesForCreate objectMap := make(map[string]interface{}) if spfc.Version != "" { objectMap["version"] = spfc.Version } if spfc.SslEnforcement != "" { objectMap["sslEnforcement"] = spfc.SslEnforcement } if spfc.MinimalTLSVersion != "" { objectMap["minimalTlsVersion"] = spfc.MinimalTLSVersion } if spfc.InfrastructureEncryption != "" { objectMap["infrastructureEncryption"] = spfc.InfrastructureEncryption } if spfc.PublicNetworkAccess != "" { objectMap["publicNetworkAccess"] = spfc.PublicNetworkAccess } if spfc.StorageProfile != nil { objectMap["storageProfile"] = spfc.StorageProfile } if spfc.CreateMode != "" { objectMap["createMode"] = spfc.CreateMode } return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { return nil, false } // AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { return nil, false } // AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { return nil, false } // AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { return nil, false } // AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { return &spfc, true } // AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { return &spfc, true } // ServerPropertiesForDefaultCreate the properties used to create a new server. type ServerPropertiesForDefaultCreate struct { // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). AdministratorLogin *string `json:"administratorLogin,omitempty"` // AdministratorLoginPassword - The password of the administrator login. AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven', 'EightFullStopZero' Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // InfrastructureEncryption - Status showing whether the server enabled infrastructure encryption. Possible values include: 'InfrastructureEncryptionEnabled', 'InfrastructureEncryptionDisabled' InfrastructureEncryption InfrastructureEncryption `json:"infrastructureEncryption,omitempty"` // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' CreateMode CreateMode `json:"createMode,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { spfdc.CreateMode = CreateModeDefault objectMap := make(map[string]interface{}) if spfdc.AdministratorLogin != nil { objectMap["administratorLogin"] = spfdc.AdministratorLogin } if spfdc.AdministratorLoginPassword != nil { objectMap["administratorLoginPassword"] = spfdc.AdministratorLoginPassword } if spfdc.Version != "" { objectMap["version"] = spfdc.Version } if spfdc.SslEnforcement != "" { objectMap["sslEnforcement"] = spfdc.SslEnforcement } if spfdc.MinimalTLSVersion != "" { objectMap["minimalTlsVersion"] = spfdc.MinimalTLSVersion } if spfdc.InfrastructureEncryption != "" { objectMap["infrastructureEncryption"] = spfdc.InfrastructureEncryption } if spfdc.PublicNetworkAccess != "" { objectMap["publicNetworkAccess"] = spfdc.PublicNetworkAccess } if spfdc.StorageProfile != nil { objectMap["storageProfile"] = spfdc.StorageProfile } if spfdc.CreateMode != "" { objectMap["createMode"] = spfdc.CreateMode } return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { return &spfdc, true } // AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { return nil, false } // AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { return nil, false } // AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { return nil, false } // AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { return nil, false } // AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { return &spfdc, true } // ServerPropertiesForGeoRestore the properties used to create a new server by restoring to a different // region from a geo replicated backup. type ServerPropertiesForGeoRestore struct { // SourceServerID - The source server id to restore from. SourceServerID *string `json:"sourceServerId,omitempty"` // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven', 'EightFullStopZero' Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // InfrastructureEncryption - Status showing whether the server enabled infrastructure encryption. Possible values include: 'InfrastructureEncryptionEnabled', 'InfrastructureEncryptionDisabled' InfrastructureEncryption InfrastructureEncryption `json:"infrastructureEncryption,omitempty"` // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' CreateMode CreateMode `json:"createMode,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForGeoRestore. func (spfgr ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) { spfgr.CreateMode = CreateModeGeoRestore objectMap := make(map[string]interface{}) if spfgr.SourceServerID != nil { objectMap["sourceServerId"] = spfgr.SourceServerID } if spfgr.Version != "" { objectMap["version"] = spfgr.Version } if spfgr.SslEnforcement != "" { objectMap["sslEnforcement"] = spfgr.SslEnforcement } if spfgr.MinimalTLSVersion != "" { objectMap["minimalTlsVersion"] = spfgr.MinimalTLSVersion } if spfgr.InfrastructureEncryption != "" { objectMap["infrastructureEncryption"] = spfgr.InfrastructureEncryption } if spfgr.PublicNetworkAccess != "" { objectMap["publicNetworkAccess"] = spfgr.PublicNetworkAccess } if spfgr.StorageProfile != nil { objectMap["storageProfile"] = spfgr.StorageProfile } if spfgr.CreateMode != "" { objectMap["createMode"] = spfgr.CreateMode } return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { return nil, false } // AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { return nil, false } // AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { return &spfgr, true } // AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { return nil, false } // AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { return nil, false } // AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore. func (spfgr ServerPropertiesForGeoRestore) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { return &spfgr, true } // ServerPropertiesForReplica the properties to create a new replica. type ServerPropertiesForReplica struct { // SourceServerID - The master server id to create replica from. SourceServerID *string `json:"sourceServerId,omitempty"` // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven', 'EightFullStopZero' Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // InfrastructureEncryption - Status showing whether the server enabled infrastructure encryption. Possible values include: 'InfrastructureEncryptionEnabled', 'InfrastructureEncryptionDisabled' InfrastructureEncryption InfrastructureEncryption `json:"infrastructureEncryption,omitempty"` // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' CreateMode CreateMode `json:"createMode,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForReplica. func (spfr ServerPropertiesForReplica) MarshalJSON() ([]byte, error) { spfr.CreateMode = CreateModeReplica objectMap := make(map[string]interface{}) if spfr.SourceServerID != nil { objectMap["sourceServerId"] = spfr.SourceServerID } if spfr.Version != "" { objectMap["version"] = spfr.Version } if spfr.SslEnforcement != "" { objectMap["sslEnforcement"] = spfr.SslEnforcement } if spfr.MinimalTLSVersion != "" { objectMap["minimalTlsVersion"] = spfr.MinimalTLSVersion } if spfr.InfrastructureEncryption != "" { objectMap["infrastructureEncryption"] = spfr.InfrastructureEncryption } if spfr.PublicNetworkAccess != "" { objectMap["publicNetworkAccess"] = spfr.PublicNetworkAccess } if spfr.StorageProfile != nil { objectMap["storageProfile"] = spfr.StorageProfile } if spfr.CreateMode != "" { objectMap["createMode"] = spfr.CreateMode } return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. func (spfr ServerPropertiesForReplica) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { return nil, false } // AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. func (spfr ServerPropertiesForReplica) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { return nil, false } // AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. func (spfr ServerPropertiesForReplica) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { return nil, false } // AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. func (spfr ServerPropertiesForReplica) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { return &spfr, true } // AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. func (spfr ServerPropertiesForReplica) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { return nil, false } // AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica. func (spfr ServerPropertiesForReplica) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { return &spfr, true } // ServerPropertiesForRestore the properties used to create a new server by restoring from a backup. type ServerPropertiesForRestore struct { // SourceServerID - The source server id to restore from. SourceServerID *string `json:"sourceServerId,omitempty"` // RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from. RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven', 'EightFullStopZero' Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // InfrastructureEncryption - Status showing whether the server enabled infrastructure encryption. Possible values include: 'InfrastructureEncryptionEnabled', 'InfrastructureEncryptionDisabled' InfrastructureEncryption InfrastructureEncryption `json:"infrastructureEncryption,omitempty"` // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica' CreateMode CreateMode `json:"createMode,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { spfr.CreateMode = CreateModePointInTimeRestore objectMap := make(map[string]interface{}) if spfr.SourceServerID != nil { objectMap["sourceServerId"] = spfr.SourceServerID } if spfr.RestorePointInTime != nil { objectMap["restorePointInTime"] = spfr.RestorePointInTime } if spfr.Version != "" { objectMap["version"] = spfr.Version } if spfr.SslEnforcement != "" { objectMap["sslEnforcement"] = spfr.SslEnforcement } if spfr.MinimalTLSVersion != "" { objectMap["minimalTlsVersion"] = spfr.MinimalTLSVersion } if spfr.InfrastructureEncryption != "" { objectMap["infrastructureEncryption"] = spfr.InfrastructureEncryption } if spfr.PublicNetworkAccess != "" { objectMap["publicNetworkAccess"] = spfr.PublicNetworkAccess } if spfr.StorageProfile != nil { objectMap["storageProfile"] = spfr.StorageProfile } if spfr.CreateMode != "" { objectMap["createMode"] = spfr.CreateMode } return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) { return nil, false } // AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) { return &spfr, true } // AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) { return nil, false } // AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) { return nil, false } // AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) { return nil, false } // AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) { return &spfr, true } // ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersCreateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServersCreateFuture) Result(client ServersClient) (s Server, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServersCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServersCreateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { s, err = client.CreateResponder(s.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServersCreateFuture", "Result", s.Response.Response, "Failure responding to request") } } return } // ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServersDeleteFuture) Result(client ServersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServersDeleteFuture") return } ar.Response = future.Response() return } // ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) Result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServerSecurityAlertPoliciesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent { ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request") } } return } // ServerSecurityAlertPolicy a server security alert policy. type ServerSecurityAlertPolicy struct { autorest.Response `json:"-"` // SecurityAlertPolicyProperties - Resource properties. *SecurityAlertPolicyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy. func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if ssap.SecurityAlertPolicyProperties != nil { objectMap["properties"] = ssap.SecurityAlertPolicyProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct. func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var securityAlertPolicyProperties SecurityAlertPolicyProperties err = json.Unmarshal(*v, &securityAlertPolicyProperties) if err != nil { return err } ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } ssap.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } ssap.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } ssap.Type = &typeVar } } } return nil } // ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersRestartFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServersRestartFuture) Result(client ServersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServersRestartFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServersRestartFuture") return } ar.Response = future.Response() return } // ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ServersUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *ServersUpdateFuture) Result(client ServersClient) (s Server, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.ServersUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { s, err = client.UpdateResponder(s.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request") } } return } // ServerUpdateParameters parameters allowed to update for a server. type ServerUpdateParameters struct { // Identity - The Azure Active Directory identity of the server. Identity *ResourceIdentity `json:"identity,omitempty"` // Sku - The SKU (pricing tier) of the server. Sku *Sku `json:"sku,omitempty"` // ServerUpdateParametersProperties - The properties that can be updated for a server. *ServerUpdateParametersProperties `json:"properties,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for ServerUpdateParameters. func (sup ServerUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if sup.Identity != nil { objectMap["identity"] = sup.Identity } if sup.Sku != nil { objectMap["sku"] = sup.Sku } if sup.ServerUpdateParametersProperties != nil { objectMap["properties"] = sup.ServerUpdateParametersProperties } if sup.Tags != nil { objectMap["tags"] = sup.Tags } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerUpdateParameters struct. func (sup *ServerUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "identity": if v != nil { var identity ResourceIdentity err = json.Unmarshal(*v, &identity) if err != nil { return err } sup.Identity = &identity } case "sku": if v != nil { var sku Sku err = json.Unmarshal(*v, &sku) if err != nil { return err } sup.Sku = &sku } case "properties": if v != nil { var serverUpdateParametersProperties ServerUpdateParametersProperties err = json.Unmarshal(*v, &serverUpdateParametersProperties) if err != nil { return err } sup.ServerUpdateParametersProperties = &serverUpdateParametersProperties } case "tags": if v != nil { var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } sup.Tags = tags } } } return nil } // ServerUpdateParametersProperties the properties that can be updated for a server. type ServerUpdateParametersProperties struct { // StorageProfile - Storage profile of a server. StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // AdministratorLoginPassword - The password of the administrator login. AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // Version - The version of a server. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven', 'EightFullStopZero' Version ServerVersion `json:"version,omitempty"` // SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled' SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // MinimalTLSVersion - Enforce a minimal Tls version for the server. Possible values include: 'TLS10', 'TLS11', 'TLS12', 'TLSEnforcementDisabled' MinimalTLSVersion MinimalTLSVersionEnum `json:"minimalTlsVersion,omitempty"` // PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled' PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"` // ReplicationRole - The replication role of the server. ReplicationRole *string `json:"replicationRole,omitempty"` } // Sku billing information related properties of a server. type Sku struct { // Name - The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. Name *string `json:"name,omitempty"` // Tier - The tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' Tier SkuTier `json:"tier,omitempty"` // Capacity - The scale up/out capacity, representing server's compute units. Capacity *int32 `json:"capacity,omitempty"` // Size - The size code, to be interpreted by resource as appropriate. Size *string `json:"size,omitempty"` // Family - The family of hardware. Family *string `json:"family,omitempty"` } // StorageProfile storage Profile properties of a server type StorageProfile struct { // BackupRetentionDays - Backup retention days for the server. BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"` // GeoRedundantBackup - Enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled' GeoRedundantBackup GeoRedundantBackup `json:"geoRedundantBackup,omitempty"` // StorageMB - Max storage allowed for a server. StorageMB *int32 `json:"storageMB,omitempty"` // StorageAutogrow - Enable Storage Auto Grow. Possible values include: 'StorageAutogrowEnabled', 'StorageAutogrowDisabled' StorageAutogrow StorageAutogrow `json:"storageAutogrow,omitempty"` } // TagsObject tags object for patch operations. type TagsObject struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for TagsObject. func (toVar TagsObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if toVar.Tags != nil { objectMap["tags"] = toVar.Tags } return json.Marshal(objectMap) } // TopQueryStatisticsInput input to get top query statistics type TopQueryStatisticsInput struct { // TopQueryStatisticsInputProperties - The properties of a wait statistics input. *TopQueryStatisticsInputProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for TopQueryStatisticsInput. func (tqsi TopQueryStatisticsInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if tqsi.TopQueryStatisticsInputProperties != nil { objectMap["properties"] = tqsi.TopQueryStatisticsInputProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TopQueryStatisticsInput struct. func (tqsi *TopQueryStatisticsInput) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var topQueryStatisticsInputProperties TopQueryStatisticsInputProperties err = json.Unmarshal(*v, &topQueryStatisticsInputProperties) if err != nil { return err } tqsi.TopQueryStatisticsInputProperties = &topQueryStatisticsInputProperties } } } return nil } // TopQueryStatisticsInputProperties the properties for input to get top query statistics type TopQueryStatisticsInputProperties struct { // NumberOfTopQueries - Max number of top queries to return. NumberOfTopQueries *int32 `json:"numberOfTopQueries,omitempty"` // AggregationFunction - Aggregation function name. AggregationFunction *string `json:"aggregationFunction,omitempty"` // ObservedMetric - Observed metric name. ObservedMetric *string `json:"observedMetric,omitempty"` // ObservationStartTime - Observation start time. ObservationStartTime *date.Time `json:"observationStartTime,omitempty"` // ObservationEndTime - Observation end time. ObservationEndTime *date.Time `json:"observationEndTime,omitempty"` // AggregationWindow - Aggregation interval type in ISO 8601 format. AggregationWindow *string `json:"aggregationWindow,omitempty"` } // TopQueryStatisticsResultList a list of query statistics. type TopQueryStatisticsResultList struct { autorest.Response `json:"-"` // Value - READ-ONLY; The list of top query statistics. Value *[]QueryStatistic `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // TopQueryStatisticsResultListIterator provides access to a complete listing of QueryStatistic values. type TopQueryStatisticsResultListIterator struct { i int page TopQueryStatisticsResultListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *TopQueryStatisticsResultListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsResultListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *TopQueryStatisticsResultListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter TopQueryStatisticsResultListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter TopQueryStatisticsResultListIterator) Response() TopQueryStatisticsResultList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter TopQueryStatisticsResultListIterator) Value() QueryStatistic { if !iter.page.NotDone() { return QueryStatistic{} } return iter.page.Values()[iter.i] } // Creates a new instance of the TopQueryStatisticsResultListIterator type. func NewTopQueryStatisticsResultListIterator(page TopQueryStatisticsResultListPage) TopQueryStatisticsResultListIterator { return TopQueryStatisticsResultListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (tqsrl TopQueryStatisticsResultList) IsEmpty() bool { return tqsrl.Value == nil || len(*tqsrl.Value) == 0 } // topQueryStatisticsResultListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tqsrl TopQueryStatisticsResultList) topQueryStatisticsResultListPreparer(ctx context.Context) (*http.Request, error) { if tqsrl.NextLink == nil || len(to.String(tqsrl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(tqsrl.NextLink))) } // TopQueryStatisticsResultListPage contains a page of QueryStatistic values. type TopQueryStatisticsResultListPage struct { fn func(context.Context, TopQueryStatisticsResultList) (TopQueryStatisticsResultList, error) tqsrl TopQueryStatisticsResultList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *TopQueryStatisticsResultListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsResultListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.tqsrl) if err != nil { return err } page.tqsrl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *TopQueryStatisticsResultListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page TopQueryStatisticsResultListPage) NotDone() bool { return !page.tqsrl.IsEmpty() } // Response returns the raw server response from the last page request. func (page TopQueryStatisticsResultListPage) Response() TopQueryStatisticsResultList { return page.tqsrl } // Values returns the slice of values for the current page or nil if there are no values. func (page TopQueryStatisticsResultListPage) Values() []QueryStatistic { if page.tqsrl.IsEmpty() { return nil } return *page.tqsrl.Value } // Creates a new instance of the TopQueryStatisticsResultListPage type. func NewTopQueryStatisticsResultListPage(getNextPage func(context.Context, TopQueryStatisticsResultList) (TopQueryStatisticsResultList, error)) TopQueryStatisticsResultListPage { return TopQueryStatisticsResultListPage{fn: getNextPage} } // TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for TrackedResource. func (tr TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if tr.Tags != nil { objectMap["tags"] = tr.Tags } if tr.Location != nil { objectMap["location"] = tr.Location } return json.Marshal(objectMap) } // VirtualNetworkRule a virtual network rule. type VirtualNetworkRule struct { autorest.Response `json:"-"` // VirtualNetworkRuleProperties - Resource properties. *VirtualNetworkRuleProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for VirtualNetworkRule. func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if vnr.VirtualNetworkRuleProperties != nil { objectMap["properties"] = vnr.VirtualNetworkRuleProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var virtualNetworkRuleProperties VirtualNetworkRuleProperties err = json.Unmarshal(*v, &virtualNetworkRuleProperties) if err != nil { return err } vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } vnr.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } vnr.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } vnr.Type = &typeVar } } } return nil } // VirtualNetworkRuleListResult a list of virtual network rules. type VirtualNetworkRuleListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Array of results. Value *[]VirtualNetworkRule `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. type VirtualNetworkRuleListResultIterator struct { i int page VirtualNetworkRuleListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *VirtualNetworkRuleListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter VirtualNetworkRuleListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { if !iter.page.NotDone() { return VirtualNetworkRule{} } return iter.page.Values()[iter.i] } // Creates a new instance of the VirtualNetworkRuleListResultIterator type. func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator { return VirtualNetworkRuleListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { return vnrlr.Value == nil || len(*vnrlr.Value) == 0 } // virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) { if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(vnrlr.NextLink))) } // VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. type VirtualNetworkRuleListResultPage struct { fn func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) vnrlr VirtualNetworkRuleListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.vnrlr) if err != nil { return err } page.vnrlr = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *VirtualNetworkRuleListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page VirtualNetworkRuleListResultPage) NotDone() bool { return !page.vnrlr.IsEmpty() } // Response returns the raw server response from the last page request. func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { return page.vnrlr } // Values returns the slice of values for the current page or nil if there are no values. func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { if page.vnrlr.IsEmpty() { return nil } return *page.vnrlr.Value } // Creates a new instance of the VirtualNetworkRuleListResultPage type. func NewVirtualNetworkRuleListResultPage(getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { return VirtualNetworkRuleListResultPage{fn: getNextPage} } // VirtualNetworkRuleProperties properties of a virtual network rule. type VirtualNetworkRuleProperties struct { // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` // State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' State VirtualNetworkRuleState `json:"state,omitempty"` } // VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkRulesCreateOrUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.VirtualNetworkRulesCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if vnr.Response.Response, err = future.GetResult(sender); err == nil && vnr.Response.Response.StatusCode != http.StatusNoContent { vnr, err = client.CreateOrUpdateResponder(vnr.Response.Response) if err != nil { err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", vnr.Response.Response, "Failure responding to request") } } return } // VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkRulesDeleteFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. func (future *VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { err = azure.NewAsyncOpIncompleteError("mysql.VirtualNetworkRulesDeleteFuture") return } ar.Response = future.Response() return } // WaitStatistic represents a Wait Statistic. type WaitStatistic struct { autorest.Response `json:"-"` // WaitStatisticProperties - The properties of a wait statistic. *WaitStatisticProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for WaitStatistic. func (ws WaitStatistic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if ws.WaitStatisticProperties != nil { objectMap["properties"] = ws.WaitStatisticProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for WaitStatistic struct. func (ws *WaitStatistic) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var waitStatisticProperties WaitStatisticProperties err = json.Unmarshal(*v, &waitStatisticProperties) if err != nil { return err } ws.WaitStatisticProperties = &waitStatisticProperties } case "id": if v != nil { var ID string err = json.Unmarshal(*v, &ID) if err != nil { return err } ws.ID = &ID } case "name": if v != nil { var name string err = json.Unmarshal(*v, &name) if err != nil { return err } ws.Name = &name } case "type": if v != nil { var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } ws.Type = &typeVar } } } return nil } // WaitStatisticProperties the properties of a wait statistic. type WaitStatisticProperties struct { // StartTime - Observation start time. StartTime *date.Time `json:"startTime,omitempty"` // EndTime - Observation end time. EndTime *date.Time `json:"endTime,omitempty"` // EventName - Wait event name. EventName *string `json:"eventName,omitempty"` // EventTypeName - Wait event type name. EventTypeName *string `json:"eventTypeName,omitempty"` // QueryID - Database query identifier. QueryID *int64 `json:"queryId,omitempty"` // DatabaseName - Database Name. DatabaseName *string `json:"databaseName,omitempty"` // UserID - Database user identifier. UserID *int64 `json:"userId,omitempty"` // Count - Wait event count observed in this time interval. Count *int64 `json:"count,omitempty"` // TotalTimeInMs - Total time of wait in milliseconds in this time interval. TotalTimeInMs *float64 `json:"totalTimeInMs,omitempty"` } // WaitStatisticsInput input to get wait statistics type WaitStatisticsInput struct { // WaitStatisticsInputProperties - The properties of a wait statistics input. *WaitStatisticsInputProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for WaitStatisticsInput. func (wsi WaitStatisticsInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if wsi.WaitStatisticsInputProperties != nil { objectMap["properties"] = wsi.WaitStatisticsInputProperties } return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for WaitStatisticsInput struct. func (wsi *WaitStatisticsInput) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } for k, v := range m { switch k { case "properties": if v != nil { var waitStatisticsInputProperties WaitStatisticsInputProperties err = json.Unmarshal(*v, &waitStatisticsInputProperties) if err != nil { return err } wsi.WaitStatisticsInputProperties = &waitStatisticsInputProperties } } } return nil } // WaitStatisticsInputProperties the properties for input to get wait statistics type WaitStatisticsInputProperties struct { // ObservationStartTime - Observation start time. ObservationStartTime *date.Time `json:"observationStartTime,omitempty"` // ObservationEndTime - Observation end time. ObservationEndTime *date.Time `json:"observationEndTime,omitempty"` // AggregationWindow - Aggregation interval type in ISO 8601 format. AggregationWindow *string `json:"aggregationWindow,omitempty"` } // WaitStatisticsResultList a list of wait statistics. type WaitStatisticsResultList struct { autorest.Response `json:"-"` // Value - READ-ONLY; The list of wait statistics. Value *[]WaitStatistic `json:"value,omitempty"` // NextLink - READ-ONLY; Link to retrieve next page of results. NextLink *string `json:"nextLink,omitempty"` } // WaitStatisticsResultListIterator provides access to a complete listing of WaitStatistic values. type WaitStatisticsResultListIterator struct { i int page WaitStatisticsResultListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. func (iter *WaitStatisticsResultListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsResultListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } iter.i++ if iter.i < len(iter.page.Values()) { return nil } err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err } iter.i = 0 return nil } // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (iter *WaitStatisticsResultListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. func (iter WaitStatisticsResultListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. func (iter WaitStatisticsResultListIterator) Response() WaitStatisticsResultList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. func (iter WaitStatisticsResultListIterator) Value() WaitStatistic { if !iter.page.NotDone() { return WaitStatistic{} } return iter.page.Values()[iter.i] } // Creates a new instance of the WaitStatisticsResultListIterator type. func NewWaitStatisticsResultListIterator(page WaitStatisticsResultListPage) WaitStatisticsResultListIterator { return WaitStatisticsResultListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. func (wsrl WaitStatisticsResultList) IsEmpty() bool { return wsrl.Value == nil || len(*wsrl.Value) == 0 } // waitStatisticsResultListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (wsrl WaitStatisticsResultList) waitStatisticsResultListPreparer(ctx context.Context) (*http.Request, error) { if wsrl.NextLink == nil || len(to.String(wsrl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(wsrl.NextLink))) } // WaitStatisticsResultListPage contains a page of WaitStatistic values. type WaitStatisticsResultListPage struct { fn func(context.Context, WaitStatisticsResultList) (WaitStatisticsResultList, error) wsrl WaitStatisticsResultList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. func (page *WaitStatisticsResultListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsResultListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } next, err := page.fn(ctx, page.wsrl) if err != nil { return err } page.wsrl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. func (page *WaitStatisticsResultListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. func (page WaitStatisticsResultListPage) NotDone() bool { return !page.wsrl.IsEmpty() } // Response returns the raw server response from the last page request. func (page WaitStatisticsResultListPage) Response() WaitStatisticsResultList { return page.wsrl } // Values returns the slice of values for the current page or nil if there are no values. func (page WaitStatisticsResultListPage) Values() []WaitStatistic { if page.wsrl.IsEmpty() { return nil } return *page.wsrl.Value } // Creates a new instance of the WaitStatisticsResultListPage type. func NewWaitStatisticsResultListPage(getNextPage func(context.Context, WaitStatisticsResultList) (WaitStatisticsResultList, error)) WaitStatisticsResultListPage { return WaitStatisticsResultListPage{fn: getNextPage} }