Skip to content

Commit

Permalink
Add Endpoint and Protocol required fields to write datastore APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Telemaco019 committed May 9, 2022
1 parent 0201ec2 commit e8ee22a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions workspace/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ func toWriteDatastoreSchema(datastore *Datastore) *SchemaWrapper {
StorageAccountName: datastore.StorageAccountName,
StorageContainerName: datastore.StorageContainerName,
Credentials: credentials,
Endpoint: "core.windows.net",
Protocol: "https",
},
},
}
Expand Down
10 changes: 9 additions & 1 deletion workspace/convertes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ func TestToWriteDatastoreSchemaEmptyDatastore(t *testing.T) {
a := assert.New(t)
datastore := Datastore{}
writeSchema := toWriteDatastoreSchema(&datastore)
a.Equal(&SchemaWrapper{WriteDatastoreSchemaProperties{Contents: WriteDatastoreSchema{}}}, writeSchema)
expected := WriteDatastoreSchemaProperties{Contents: WriteDatastoreSchema{
Protocol: "https",
Endpoint: "core.windows.net",
}}
a.Equal(&SchemaWrapper{expected}, writeSchema)
}

func TestToWriteDatastoreSchema(t *testing.T) {
Expand Down Expand Up @@ -122,6 +126,8 @@ func TestToWriteDatastoreSchema(t *testing.T) {
TenantId: datastore.Auth.TenantId,
SqlUserName: datastore.Auth.SqlUserName,
},
Protocol: "https",
Endpoint: "core.windows.net",
},
},
}
Expand Down Expand Up @@ -151,6 +157,8 @@ func TestToWriteDatastoreSchema_NilAuth(t *testing.T) {
StorageAccountName: datastore.StorageAccountName,
StorageContainerName: datastore.StorageContainerName,
Credentials: nil,
Endpoint: "core.windows.net",
Protocol: "https",
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions workspace/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type WriteDatastoreSchema struct {
StorageAccountName string `json:"accountName,omitempty"`
StorageContainerName string `json:"containerName,omitempty"`
Credentials *WriteDatastoreCredentialsSchema `json:"credentials,omitempty"`
Endpoint string `json:"endpoint"`
Protocol string `json:"protocol"`
}

type WriteDatastoreSchemaProperties struct {
Expand Down

0 comments on commit e8ee22a

Please sign in to comment.