Skip to content

Commit eecb578

Browse files
authored
Merge pull request #42 from serverscom/update-ssl-custom-input
update fields for custom ssl udpate input; update test
2 parents 3c77dee + 1e9f10c commit eecb578

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

pkg/fixtures/ssl_certificates/update_custom_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "LDdwpRe1",
3-
"name": "name156",
3+
"name": "newName",
44
"type": "custom",
55
"issuer": null,
66
"subject": "example-484.com",

pkg/ssl_certificates_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,18 @@ func TestSSLCertificatesUpdateCustom(t *testing.T) {
108108
ctx := context.TODO()
109109
newLabels := map[string]string{"env": "new-test"}
110110

111-
SSLCertificateCustom, err := client.SSLCertificates.UpdateCustom(ctx, sslCertID, SSLCertificateUpdateCustomInput{Labels: newLabels})
111+
SSLCertificateCustom, err := client.SSLCertificates.UpdateCustom(ctx, sslCertID, SSLCertificateUpdateCustomInput{
112+
Name: "newName",
113+
PublicKey: sslCertificateCustomPublicKey,
114+
PrivateKey: sslCertificateCustomPrivateKey,
115+
Labels: newLabels,
116+
})
112117

113118
g.Expect(err).To(BeNil())
114119
g.Expect(SSLCertificateCustom).ToNot(BeNil())
115120

116-
g.Expect(SSLCertificateCustom.Name).To(Equal("name156"))
121+
g.Expect(SSLCertificateCustom.Name).To(Equal("newName"))
122+
g.Expect(SSLCertificateCustom.Labels).To(Equal(newLabels))
117123
g.Expect(SSLCertificateCustom.Type).To(Equal("custom"))
118124
}
119125

pkg/types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ type SSLCertificateCreateCustomInput struct {
7676

7777
// SSLCertificateUpdateCustomInput represents custom ssl certificate update input
7878
type SSLCertificateUpdateCustomInput struct {
79-
Labels map[string]string `json:"labels,omitempty"`
79+
Name string `json:"name"`
80+
PublicKey string `json:"public_key"`
81+
PrivateKey string `json:"private_key"`
82+
ChainKey string `json:"chain_key,omitempty"`
83+
Labels map[string]string `json:"labels,omitempty"`
8084
}
8185

8286
// SSLCertificateUpdateLEInput represents let's encrypt ssl certificate update input

0 commit comments

Comments
 (0)