Documentation ¶
Index ¶
- Constants
- type Contact
- type ContactFeed
- type ContactFeedCall
- func (c *ContactFeedCall) Context(ctx context.Context) *ContactFeedCall
- func (c *ContactFeedCall) Do(opts ...googleapi.CallOption) (*ContactFeedResponse, error)
- func (c *ContactFeedCall) Group(group string) *ContactFeedCall
- func (c *ContactFeedCall) Header() http.Header
- func (c *ContactFeedCall) MaxResults(max int) *ContactFeedCall
- func (c *ContactFeedCall) Query(q string) *ContactFeedCall
- type ContactFeedResponse
- type ContactsService
- type EmailAddress
- type IDField
- type NameField
- type Organization
- type PhoneNumber
- type Service
- type TitleField
- type UpdatedField
Constants ¶
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/" )
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 ¶
func (c *ContactFeedCall) Context(ctx context.Context) *ContactFeedCall
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 ¶
func (c *ContactFeedCall) Do(opts ...googleapi.CallOption) (*ContactFeedResponse, error)
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 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.
type TitleField ¶
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.