Skip to content

Commit

Permalink
missing method mergeServiceKey added and used in the CreateServiceKey…
Browse files Browse the repository at this point in the history
… to fill key.Entity (#251)
  • Loading branch information
Aswin3405 committed Oct 30, 2020
1 parent 1b7f890 commit 4cf7741
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion service_keys.go
Expand Up @@ -155,7 +155,7 @@ func (c *Client) CreateServiceKey(csr CreateServiceKeyRequest) (ServiceKey, erro
return ServiceKey{}, err
}

return serviceKeyResource.Entity, nil
return c.mergeServiceKey(serviceKeyResource), nil
}

// DeleteServiceKey removes a service key instance
Expand All @@ -169,3 +169,11 @@ func (c *Client) DeleteServiceKey(guid string) error {
}
return nil
}

func (c *Client) mergeServiceKey(key ServiceKeyResource) ServiceKey {
key.Entity.Guid = key.Meta.Guid
key.Entity.CreatedAt = key.Meta.CreatedAt
key.Entity.UpdatedAt = key.Meta.UpdatedAt
key.Entity.c = c
return key.Entity
}

0 comments on commit 4cf7741

Please sign in to comment.