Embed the ProviderClient struct in ServiceClient.
This lets us inherit the AuthenticatedHeaders method, rather than
having to walk the references all the time.
diff --git a/service_client.go b/service_client.go
index 55d3b98..3490da0 100644
--- a/service_client.go
+++ b/service_client.go
@@ -5,8 +5,8 @@
// ServiceClient stores details required to interact with a specific service API implemented by a provider.
// Generally, you'll acquire these by calling the appropriate `New` method on a ProviderClient.
type ServiceClient struct {
- // Provider is a reference to the provider that implements this service.
- Provider *ProviderClient
+ // ProviderClient is a reference to the provider that implements this service.
+ *ProviderClient
// Endpoint is the base URL of the service's API, acquired from a service catalog.
// It MUST end with a /.
@@ -30,9 +30,3 @@
func (client *ServiceClient) ServiceURL(parts ...string) string {
return client.ResourceBaseURL() + strings.Join(parts, "/")
}
-
-// AuthenticatedHeaders returns a collection of HTTP request headers that mark a request as
-// belonging to the currently authenticated user.
-func (client *ServiceClient) AuthenticatedHeaders() map[string]string {
- return client.Provider.AuthenticatedHeaders()
-}