microsoft

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package microsoft implement Microsoft's Live contact API v1.0.

Reference

- https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_contacts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportFromJSON

func ImportFromJSON(jsonb []byte) (
	contacts []*contact.Record,
	err error,
)

ImportFromJSON will parse Microsoft Live's JSON contact response and return list of contact on success.

func ImportWithOAuth

func ImportWithOAuth(client *http.Client) (contacts []*contact.Record, err error)

ImportWithOAuth get Microsoft Live contacts using OAuth HTTP client.

Types

type Address

type Address struct {
	Street     string `json:"street,omitempty"`
	City       string `json:"city,omitempty"`
	State      string `json:"state,omitempty"`
	Country    string `json:"countryOrRegion,omitempty"`
	PostalCode string `json:"postalCode,omitempty"`
}

Address format on response.

type Contact

type Contact struct {
	Birthday string `json:"birthday,omitempty"`

	DisplayName string `json:"displayName,omitempty"`
	GivenName   string `json:"givenName,omitempty"`
	Initials    string `json:"initials,omitempty"`
	MiddleName  string `json:"middleName,omitempty"`
	NickName    string `json:"nickName,omitempty"`
	SurName     string `json:"surname,omitempty"`
	Title       string `json:"title,omitempty"`
	Generation  string `json:"generation,omitempty"`

	IMAddresses []string `json:"imAddresses,omitempty"`

	JobTitle         string `json:"jobTitle,omitempty"`
	Company          string `json:"companyName,omitempty"`
	Department       string `json:"department,omitempty"`
	OfficeLocation   string `json:"officeLocation,omitempty"`
	Profession       string `json:"profession,omitempty"`
	BusinessHomePage string `json:"businessHomePage,omitempty"`
	AssistantName    string `json:"assistantName,omitempty"`
	Manager          string `json:"manager,omitempty"`

	HomePhones     []string `json:"homePhones,omitempty"`
	MobilePhone    string   `json:"mobilePhone,omitempty"`
	BusinessPhones []string `json:"businessPhones,omitempty"`

	SpouseName    string   `json:"spouseName,omitempty"`
	PersonalNotes string   `json:"personalNotes,omitempty"`
	Children      []string `json:"children,omitempty"`

	Emails []Email `json:"emailAddresses,omitempty"`

	HomeAddress     Address `json:"homeAddress,omitempty"`
	BusinessAddress Address `json:"businessAddress,omitempty"`
	OtherAddress    Address `json:"otherAddress,omitempty"`
}

Contact define Microsoft Live's contact format.

Some of the fields are disabled for speed up.

func (*Contact) Decode

func (c *Contact) Decode() (to *contact.Record)

Decode will convert Microsoft's Contact to our Contact format.

type Email

type Email struct {
	Name    string `json:"name,omitempty"`
	Address string `json:"address,omitempty"`
}

Email format on response.

type Root

type Root struct {
	Context  string    `json:"@odata.context"`
	Contacts []Contact `json:"value"`
}

Root of response.

Jump to

Keyboard shortcuts

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