a5ebab63e7
* New Providers added and updated vendoring for go-discover * Vendor.json formatted using make vendorfmt * Docs/Agent/auto-join: Added documentation for the new providers introduced in this PR * Updated the golang.org/x/sys/unix in the vendor directory * Agent: TestGoDiscoverRegistration updated to reflect the addition of new providers * Deleted terraform.tfstate from vendor. * Deleted terraform.tfstate.backup Deleted terraform state file artifacts from unknown runs. * Updated x/sys/windows vendor for Windows binary compilation
38 lines
805 B
Go
38 lines
805 B
Go
package packngo
|
|
|
|
const emailBasePath = "/emails"
|
|
|
|
// EmailService interface defines available email methods
|
|
type EmailService interface {
|
|
Get(string) (*Email, *Response, error)
|
|
}
|
|
|
|
// Email represents a user's email address
|
|
type Email struct {
|
|
ID string `json:"id"`
|
|
Address string `json:"address"`
|
|
Default bool `json:"default,omitempty"`
|
|
URL string `json:"href,omitempty"`
|
|
}
|
|
|
|
func (e Email) String() string {
|
|
return Stringify(e)
|
|
}
|
|
|
|
// EmailServiceOp implements EmailService
|
|
type EmailServiceOp struct {
|
|
client *Client
|
|
}
|
|
|
|
// Get retrieves an email by id
|
|
func (s *EmailServiceOp) Get(emailID string) (*Email, *Response, error) {
|
|
email := new(Email)
|
|
|
|
resp, err := s.client.DoRequest("GET", emailBasePath, nil, email)
|
|
if err != nil {
|
|
return nil, resp, err
|
|
}
|
|
|
|
return email, resp, err
|
|
}
|