diff --git a/v3/client.go b/v3/client.go index 9a8d7d704..990083ce7 100755 --- a/v3/client.go +++ b/v3/client.go @@ -42,13 +42,13 @@ func (c Client) GetZoneName(ctx context.Context, endpoint Endpoint) (ZoneName, e return "", fmt.Errorf("get zone name: no matching zone for %s", endpoint) } -func (c Client) GetZoneAPIEndpoint(ctx context.Context, zoneName string) (Endpoint, error) { +func (c Client) GetZoneAPIEndpoint(ctx context.Context, zoneName ZoneName) (Endpoint, error) { resp, err := c.ListZones(ctx) if err != nil { return "", fmt.Errorf("get zone api endpoint: %w", err) } for _, zone := range resp.Zones { - if zone.Name == ZoneName(zoneName) { + if zone.Name == zoneName { return zone.APIEndpoint, nil } } diff --git a/v3/generator/client/client.tmpl b/v3/generator/client/client.tmpl index fad7b3618..1fb9dca87 100644 --- a/v3/generator/client/client.tmpl +++ b/v3/generator/client/client.tmpl @@ -19,13 +19,13 @@ func (c Client) GetZoneName(ctx context.Context, endpoint Endpoint) (ZoneName, e return "", fmt.Errorf("get zone name: no matching zone for %s", endpoint) } -func (c Client) GetZoneAPIEndpoint(ctx context.Context, zoneName string) (Endpoint, error) { +func (c Client) GetZoneAPIEndpoint(ctx context.Context, zoneName ZoneName) (Endpoint, error) { resp, err := c.ListZones(ctx) if err != nil { return "", fmt.Errorf("get zone api endpoint: %w", err) } for _, zone := range resp.Zones { - if zone.Name == ZoneName(zoneName) { + if zone.Name == zoneName { return zone.APIEndpoint, nil } }