Skip to content

Commit e8ee22a

Browse files
committed
Add Endpoint and Protocol required fields to write datastore APIs
1 parent 0201ec2 commit e8ee22a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

workspace/converters.go

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ func toWriteDatastoreSchema(datastore *Datastore) *SchemaWrapper {
136136
StorageAccountName: datastore.StorageAccountName,
137137
StorageContainerName: datastore.StorageContainerName,
138138
Credentials: credentials,
139+
Endpoint: "core.windows.net",
140+
Protocol: "https",
139141
},
140142
},
141143
}

workspace/convertes_test.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ func TestToWriteDatastoreSchemaEmptyDatastore(t *testing.T) {
9494
a := assert.New(t)
9595
datastore := Datastore{}
9696
writeSchema := toWriteDatastoreSchema(&datastore)
97-
a.Equal(&SchemaWrapper{WriteDatastoreSchemaProperties{Contents: WriteDatastoreSchema{}}}, writeSchema)
97+
expected := WriteDatastoreSchemaProperties{Contents: WriteDatastoreSchema{
98+
Protocol: "https",
99+
Endpoint: "core.windows.net",
100+
}}
101+
a.Equal(&SchemaWrapper{expected}, writeSchema)
98102
}
99103

100104
func TestToWriteDatastoreSchema(t *testing.T) {
@@ -122,6 +126,8 @@ func TestToWriteDatastoreSchema(t *testing.T) {
122126
TenantId: datastore.Auth.TenantId,
123127
SqlUserName: datastore.Auth.SqlUserName,
124128
},
129+
Protocol: "https",
130+
Endpoint: "core.windows.net",
125131
},
126132
},
127133
}
@@ -151,6 +157,8 @@ func TestToWriteDatastoreSchema_NilAuth(t *testing.T) {
151157
StorageAccountName: datastore.StorageAccountName,
152158
StorageContainerName: datastore.StorageContainerName,
153159
Credentials: nil,
160+
Endpoint: "core.windows.net",
161+
Protocol: "https",
154162
},
155163
},
156164
}

workspace/schemas.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ type WriteDatastoreSchema struct {
2020
StorageAccountName string `json:"accountName,omitempty"`
2121
StorageContainerName string `json:"containerName,omitempty"`
2222
Credentials *WriteDatastoreCredentialsSchema `json:"credentials,omitempty"`
23+
Endpoint string `json:"endpoint"`
24+
Protocol string `json:"protocol"`
2325
}
2426

2527
type WriteDatastoreSchemaProperties struct {

0 commit comments

Comments
 (0)