contacts

package
v0.0.0-...-ca82998 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Version is the API version of the Google Contacts API
	Version = "3.0"
	// BasePath is the base URL of the Google Contacts API
	BasePath = "https://www.google.com/m8/feeds/"
)
View Source
const (
	// Manage your contacts
	ContactsScope = "https://www.googleapis.com/auth/contacts"

	// View your contacts
	ContactsReadonlyScope = "https://www.googleapis.com/auth/contacts.readonly"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	IDField        `json:"id"`
	UpdatedField   `json:"updated"`
	TitleField     `json:"title"`
	Organizations  []*Organization `json:"gd$organization,omitempty"`
	EmailAddresses []*EmailAddress `json:"gd$email,omitempty"`
	PhoneNumbers   []*PhoneNumber  `json:"gd$phoneNumber,omitempty"`
}

Contact represents an entity such as a person, venue or organization.

type ContactFeed

type ContactFeed struct {
	IDField      `json:"id"`
	UpdatedField `json:"updated"`
	Contacts     []*Contact `json:"entry"`
}

ContactFeed represents a contact feed.

type ContactFeedCall

type ContactFeedCall struct {
	// contains filtered or unexported fields
}

ContactFeedCall represents a call to the contact feed API.

func (*ContactFeedCall) Context

Context sets the context to be used in the call. Any pending HTTP request created during the call will be aborted if the provided context is canceled.

func (*ContactFeedCall) Do

Do performs the API call for the contacts feed and returns the response.

func (*ContactFeedCall) Group

func (c *ContactFeedCall) Group(group string) *ContactFeedCall

Group constrains the resulting contacts to members of the specified group.

func (*ContactFeedCall) Header

func (c *ContactFeedCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ContactFeedCall) MaxResults

func (c *ContactFeedCall) MaxResults(max int) *ContactFeedCall

MaxResults specifies the maximum number of results to retrieve. The default is 25.

func (*ContactFeedCall) Query

func (c *ContactFeedCall) Query(q string) *ContactFeedCall

Query sets the contact search query to be used in the call.

type ContactFeedResponse

type ContactFeedResponse struct {
	Version  string      `json:"version"`
	Encoding string      `json:"encoding"`
	Feed     ContactFeed `json:"feed"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`
}

ContactFeedResponse represents a response to a contact feed request.

type ContactsService

type ContactsService struct {
	// contains filtered or unexported fields
}

ContactsService provides access to contact feeds.

func NewContactsService

func NewContactsService(s *Service) *ContactsService

NewContactsService creates a new contacts service that operates via the given service root.

func (*ContactsService) Feed

func (cs *ContactsService) Feed(userID, projection string) *ContactFeedCall

Feed returns a contact feed for the given user.

type EmailAddress

type EmailAddress struct {
	Value       string `json:"address"`
	DisplayName string `json:"displayName,omitempty"`
	Label       string `json:"label,omitempty"`
	Primary     bool   `json:"primary,string"`
}

EmailAddress represents an email address of a contact.

type IDField

type IDField struct {
	ID string `json:"$t"`
}

IDField represents an ID field.

type NameField

type NameField struct {
	Name string `json:"$t"`
}

NameField represents a name field.

type Organization

type Organization struct {
	NameField  `json:"gd$orgName,omitempty"`
	TitleField `json:"gd$orgTitle,omitempty"`
}

Organization represents an organization that a contact is affiliated with.

type PhoneNumber

type PhoneNumber struct {
	Value string `json:"$t,omitempty"`
}

PhoneNumber represents the phone number of a contact.

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Contacts *ContactsService
	// contains filtered or unexported fields
}

Service represents the root of the contacts API.

func New

func New(client *http.Client) (*Service, error)

New returns a new service that will rely upon the provided HTTP client for authenticated transport.

type TitleField

type TitleField struct {
	Type  string `json:"type,omitempty"`
	Title string `json:"$t"`
}

TitleField represents a title field.

type UpdatedField

type UpdatedField struct {
	Updated string `json:"$t"` // Stored in ISO 8601 date and time representation
}

UpdatedField represents an update timestamp field.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL