Decode to both the struct and a map and add access (#349)

This will allow for better TF integration.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-09-11 00:51:55 -04:00
1 parent c689af4306
commit b7524f8cfb
25 files changed
+311 -4

No files matched your search

+12
View File
@@ -2,6 +2,7 @@
package users
import (
"bytes"
"context"
"errors"
"fmt"
@@ -24,6 +25,17 @@ type User struct {
CreatedTime time.Time `json:"created_time,omitempty"`
UpdatedTime time.Time `json:"updated_time,omitempty"`
Version uint32 `json:"version,omitempty"`
lastResponseBody *bytes.Buffer
lastResponseMap map[string]interface{}
}
func (n User) LastResponseBody() *bytes.Buffer {
return n.lastResponseBody
}
func (n User) LastResponseMap() map[string]interface{} {
return n.lastResponseMap
}
// Client is a client for this collection