From 13df7a4b63c44310c9c392d4104c9dd9041d2d7a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 10 Jul 2019 18:51:38 +0000 Subject: [PATCH 1/2] Generated from f8bd523610424b4f132e310df45ccbec4e828e0c fixing Cosmos account keys response --- .../mgmt/2015-04-08/documentdb/models.go | 58 ++----------------- 1 file changed, 5 insertions(+), 53 deletions(-) diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go index 61cbc651fd19..3985cb7d6bf1 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go @@ -938,59 +938,11 @@ type DatabaseAccountListKeysResult struct { // PrimaryMasterKey - READ-ONLY; Base 64 encoded value of the primary read-write key. PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"` // SecondaryMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-write key. - SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` - *DatabaseAccountListReadOnlyKeysResult `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult. -func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dalkr.DatabaseAccountListReadOnlyKeysResult != nil { - objectMap["properties"] = dalkr.DatabaseAccountListReadOnlyKeysResult - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DatabaseAccountListKeysResult struct. -func (dalkr *DatabaseAccountListKeysResult) 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 "primaryMasterKey": - if v != nil { - var primaryMasterKey string - err = json.Unmarshal(*v, &primaryMasterKey) - if err != nil { - return err - } - dalkr.PrimaryMasterKey = &primaryMasterKey - } - case "secondaryMasterKey": - if v != nil { - var secondaryMasterKey string - err = json.Unmarshal(*v, &secondaryMasterKey) - if err != nil { - return err - } - dalkr.SecondaryMasterKey = &secondaryMasterKey - } - case "properties": - if v != nil { - var databaseAccountListReadOnlyKeysResult DatabaseAccountListReadOnlyKeysResult - err = json.Unmarshal(*v, &databaseAccountListReadOnlyKeysResult) - if err != nil { - return err - } - dalkr.DatabaseAccountListReadOnlyKeysResult = &databaseAccountListReadOnlyKeysResult - } - } - } - - return nil + SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` + // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. + PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` + // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. + SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` } // DatabaseAccountListReadOnlyKeysResult the read-only access keys for the given database account. From 26e4d764e59fdf19ca2108dde8c5c15645465c80 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 17 Jul 2019 17:24:33 +0000 Subject: [PATCH 2/2] Generated from f8bd523610424b4f132e310df45ccbec4e828e0c fixing Cosmos account keys response --- .../cosmos-db/mgmt/documentdb/models.go | 9 ++++++++ .../cosmos-db/mgmt/documentdb/models.go | 9 ++++++++ .../mgmt/2015-04-08/documentdb/models.go | 21 +++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/profiles/latest/cosmos-db/mgmt/documentdb/models.go b/profiles/latest/cosmos-db/mgmt/documentdb/models.go index 99c03d1769e6..c2dd112fa7dd 100644 --- a/profiles/latest/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/latest/cosmos-db/mgmt/documentdb/models.go @@ -36,6 +36,12 @@ const ( LastWriterWins ConflictResolutionMode = original.LastWriterWins ) +type ConnectorOffer = original.ConnectorOffer + +const ( + Small ConnectorOffer = original.Small +) + type DataType = original.DataType const ( @@ -385,6 +391,9 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleConflictResolutionModeValues() []ConflictResolutionMode { return original.PossibleConflictResolutionModeValues() } +func PossibleConnectorOfferValues() []ConnectorOffer { + return original.PossibleConnectorOfferValues() +} func PossibleDataTypeValues() []DataType { return original.PossibleDataTypeValues() } diff --git a/profiles/preview/cosmos-db/mgmt/documentdb/models.go b/profiles/preview/cosmos-db/mgmt/documentdb/models.go index 32ab1c7171ca..079c75b4b084 100644 --- a/profiles/preview/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/preview/cosmos-db/mgmt/documentdb/models.go @@ -36,6 +36,12 @@ const ( LastWriterWins ConflictResolutionMode = original.LastWriterWins ) +type ConnectorOffer = original.ConnectorOffer + +const ( + Small ConnectorOffer = original.Small +) + type DataType = original.DataType const ( @@ -385,6 +391,9 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleConflictResolutionModeValues() []ConflictResolutionMode { return original.PossibleConflictResolutionModeValues() } +func PossibleConnectorOfferValues() []ConnectorOffer { + return original.PossibleConnectorOfferValues() +} func PossibleDataTypeValues() []DataType { return original.PossibleDataTypeValues() } diff --git a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go index 3985cb7d6bf1..a5a9a238d4f1 100644 --- a/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go +++ b/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go @@ -46,6 +46,19 @@ func PossibleConflictResolutionModeValues() []ConflictResolutionMode { return []ConflictResolutionMode{Custom, LastWriterWins} } +// ConnectorOffer enumerates the values for connector offer. +type ConnectorOffer string + +const ( + // Small ... + Small ConnectorOffer = "Small" +) + +// PossibleConnectorOfferValues returns an array of possible values for the ConnectorOffer const type. +func PossibleConnectorOfferValues() []ConnectorOffer { + return []ConnectorOffer{Small} +} + // DatabaseAccountKind enumerates the values for database account kind. type DatabaseAccountKind string @@ -923,6 +936,10 @@ type DatabaseAccountCreateUpdateProperties struct { VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` // EnableMultipleWriteLocations - Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` } // DatabaseAccountListConnectionStringsResult the connection strings for the given database account. @@ -1038,6 +1055,10 @@ type DatabaseAccountProperties struct { VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` // EnableMultipleWriteLocations - Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account + EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` + // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` } // DatabaseAccountRegenerateKeyParameters parameters to regenerate the keys within the database account.