Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Typo in filter[tls_certificate.id] (343) #344

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fastly/custom_tls_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (l *ListTLSDomainsInput) formatFilters() map[string]string {
result := map[string]string{}
pairings := map[string]interface{}{
"filter[in_use]": l.FilterInUse,
"filter[tls_certificate.id]": l.FilterTLSCertificateID,
"filter[tls_certificates.id]": l.FilterTLSCertificateID,
"filter[tls_subscriptions.id]": l.FilterTLSSubscriptionID,
"include": l.Include,
"page[number]": l.PageNumber,
Expand Down
23 changes: 23 additions & 0 deletions fastly/custom_tls_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,26 @@ func TestClient_ListTLSDomains(t *testing.T) {
}

}

func TestClient_ListTLSDomainsFilterCertificates(t *testing.T) {
t.Parallel()

fixtureBase := "custom_tls_domain/"

var err error

// List
var ldom []*TLSDomain
record(t, fixtureBase+"list", func(c *Client) {
ldom, err = c.ListTLSDomains(&ListTLSDomainsInput{
FilterTLSCertificateID: "6RltCYkOfFfzPVitOyLCnV",
})
})
if err != nil {
t.Fatal(err)
}
if len(ldom) != 1 {
t.Errorf("bad tls domains: %v", ldom)
}

}
41 changes: 41 additions & 0 deletions fastly/fixtures/custom_tls_domain/list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,44 @@ interactions:
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/vnd.api+json
User-Agent:
- FastlyGo/2.1.0 (+github.com/fastly/go-fastly; go1.15.4)
url: https://api.fastly.com/tls/domains?filter%5Btls_certificates.id%5D=6RltCYkOfFfzPVitOyLCnV
method: GET
response:
body: '{"data":[{"id":"a-real-tld.example","type":"tls_domain","relationships":{"tls_activations":{"data":[]},"tls_certificates":{"data":[{"id":"6RltCYkOfFfzPVitOyLCnV","type":"tls_certificate"}]},"tls_subscriptions":{"data":[]}}}],"links":{"self":"https://api.fastly.com/tls/domains?filter%5Btls_certificates.id%5D=6RltCYkOfFfzPVitOyLCnV&page%5Bnumber%5D=1&page%5Bsize%5D=20","first":"https://api.fastly.com/tls/domains?filter%5Btls_certificates.id%5D=6RltCYkOfFfzPVitOyLCnV&page%5Bnumber%5D=1&page%5Bsize%5D=20","prev":null,"next":null,"last":"https://api.fastly.com/tls/domains?filter%5Btls_certificates.id%5D=6RltCYkOfFfzPVitOyLCnV&page%5Bnumber%5D=1&page%5Bsize%5D=20"},"meta":{"record_count":1,"current_page":1,"per_page":20,"total_pages":1}}'
headers:
Accept-Ranges:
- bytes
Content-Length:
- "2599"
Content-Type:
- application/vnd.api+json
Date:
- Mon, 25 Jan 2021 15:02:43 GMT
Status:
- 200 OK
Strict-Transport-Security:
- max-age=31536000
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Content-Type-Options:
- nosniff
X-Served-By:
- cache-control-slwdc9035-CONTROL-SLWDC, cache-lcy19235-LCY
X-Timer:
- S1611586963.753130,VS0,VE572
status: 200 OK
code: 200
duration: ""