diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go index bec098908268..bb952dcd8b00 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/enums.go @@ -301,7 +301,7 @@ const ( // ResourceIdentityTypeSystemAssigned ... ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned,UserAssigned" // ResourceIdentityTypeUserAssigned ... ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" ) diff --git a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go index 8b4e4583c395..faf92f651749 100644 --- a/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go +++ b/services/preview/cosmos-db/mgmt/2020-06-01-preview/documentdb/models.go @@ -1067,6 +1067,20 @@ func (cmbp ContinuousModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, return &cmbp, true } +// CorsPolicy the CORS policy for the Cosmos DB database account. +type CorsPolicy struct { + // AllowedOrigins - The origin domains that are permitted to make a request against the service via CORS. + AllowedOrigins *string `json:"allowedOrigins,omitempty"` + // AllowedMethods - The methods (HTTP request verbs) that the origin domain may use for a CORS request. + AllowedMethods *string `json:"allowedMethods,omitempty"` + // AllowedHeaders - The request headers that the origin domain may specify on the CORS request. + AllowedHeaders *string `json:"allowedHeaders,omitempty"` + // ExposedHeaders - The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + ExposedHeaders *string `json:"exposedHeaders,omitempty"` + // MaxAgeInSeconds - The maximum amount time that a browser should cache the preflight OPTIONS request. + MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"` +} + // CreateUpdateOptions createUpdateOptions are a list of key-value pairs that describe the resource. Supported // keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput" type CreateUpdateOptions struct { @@ -1251,6 +1265,8 @@ type DatabaseAccountCreateUpdateProperties struct { EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` // BackupPolicy - The object representing the policy for taking backups on an account. BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` // CreateMode - Possible values include: 'CreateModeDatabaseAccountCreateUpdateProperties', 'CreateModeDefault', 'CreateModeRestore' CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"` } @@ -1352,6 +1368,9 @@ func (dacup DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) objectMap["enableAnalyticalStorage"] = dacup.EnableAnalyticalStorage } objectMap["backupPolicy"] = dacup.BackupPolicy + if dacup.Cors != nil { + objectMap["cors"] = dacup.Cors + } if dacup.CreateMode != "" { objectMap["createMode"] = dacup.CreateMode } @@ -1548,6 +1567,15 @@ func (dacup *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) e } dacup.BackupPolicy = backupPolicy } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + dacup.Cors = &cors + } case "createMode": if v != nil { var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties @@ -1618,6 +1646,8 @@ type DatabaseAccountGetProperties struct { RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"` // BackupPolicy - The object representing the policy for taking backups on an account. BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` } // MarshalJSON is the custom marshaler for DatabaseAccountGetProperties. @@ -1678,6 +1708,9 @@ func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { objectMap["restoreParameters"] = dagp.RestoreParameters } objectMap["backupPolicy"] = dagp.BackupPolicy + if dagp.Cors != nil { + objectMap["cors"] = dagp.Cors + } return json.Marshal(objectMap) } @@ -1932,6 +1965,15 @@ func (dagp *DatabaseAccountGetProperties) UnmarshalJSON(body []byte) error { } dagp.BackupPolicy = backupPolicy } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + dagp.Cors = &cors + } } } @@ -2297,6 +2339,7 @@ type DatabaseAccountUpdateParameters struct { // Location - The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` *DatabaseAccountUpdateProperties `json:"properties,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for DatabaseAccountUpdateParameters. @@ -2311,6 +2354,9 @@ func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { if daup.DatabaseAccountUpdateProperties != nil { objectMap["properties"] = daup.DatabaseAccountUpdateProperties } + if daup.Identity != nil { + objectMap["identity"] = daup.Identity + } return json.Marshal(objectMap) } @@ -2350,6 +2396,15 @@ func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error { } daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + daup.Identity = &identity + } } } @@ -2392,6 +2447,8 @@ type DatabaseAccountUpdateProperties struct { EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` // BackupPolicy - The object representing the policy for taking backups on an account. BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateProperties struct. @@ -2555,6 +2612,15 @@ func (daup *DatabaseAccountUpdateProperties) UnmarshalJSON(body []byte) error { } daup.BackupPolicy = backupPolicy } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + daup.Cors = &cors + } } } @@ -2608,6 +2674,8 @@ type DefaultRequestDatabaseAccountCreateUpdateProperties struct { EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` // BackupPolicy - The object representing the policy for taking backups on an account. BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` // CreateMode - Possible values include: 'CreateModeDatabaseAccountCreateUpdateProperties', 'CreateModeDefault', 'CreateModeRestore' CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"` } @@ -2668,6 +2736,9 @@ func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) MarshalJSON() objectMap["enableAnalyticalStorage"] = drdacup.EnableAnalyticalStorage } objectMap["backupPolicy"] = drdacup.BackupPolicy + if drdacup.Cors != nil { + objectMap["cors"] = drdacup.Cors + } if drdacup.CreateMode != "" { objectMap["createMode"] = drdacup.CreateMode } @@ -2864,6 +2935,15 @@ func (drdacup *DefaultRequestDatabaseAccountCreateUpdateProperties) UnmarshalJSO } drdacup.BackupPolicy = backupPolicy } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + drdacup.Cors = &cors + } case "createMode": if v != nil { var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties @@ -3776,8 +3856,10 @@ type ManagedServiceIdentity struct { PrincipalID *string `json:"principalId,omitempty"` // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + // Type - The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` } // MarshalJSON is the custom marshaler for ManagedServiceIdentity. @@ -3786,9 +3868,20 @@ func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { if msi.Type != "" { objectMap["type"] = msi.Type } + if msi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities + } return json.Marshal(objectMap) } +// ManagedServiceIdentityUserAssignedIdentitiesValue ... +type ManagedServiceIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + // Metric metric data type Metric struct { // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). @@ -5713,6 +5806,8 @@ type RestoreReqeustDatabaseAccountCreateUpdateProperties struct { EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` // BackupPolicy - The object representing the policy for taking backups on an account. BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` + // Cors - The CORS policy for the Cosmos DB database account. + Cors *[]CorsPolicy `json:"cors,omitempty"` // CreateMode - Possible values include: 'CreateModeDatabaseAccountCreateUpdateProperties', 'CreateModeDefault', 'CreateModeRestore' CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"` } @@ -5776,6 +5871,9 @@ func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) MarshalJSON() objectMap["enableAnalyticalStorage"] = rrdacup.EnableAnalyticalStorage } objectMap["backupPolicy"] = rrdacup.BackupPolicy + if rrdacup.Cors != nil { + objectMap["cors"] = rrdacup.Cors + } if rrdacup.CreateMode != "" { objectMap["createMode"] = rrdacup.CreateMode } @@ -5981,6 +6079,15 @@ func (rrdacup *RestoreReqeustDatabaseAccountCreateUpdateProperties) UnmarshalJSO } rrdacup.BackupPolicy = backupPolicy } + case "cors": + if v != nil { + var cors []CorsPolicy + err = json.Unmarshal(*v, &cors) + if err != nil { + return err + } + rrdacup.Cors = &cors + } case "createMode": if v != nil { var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties