You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

4769 lines
170 KiB

  1. // Package people provides access to the People API.
  2. //
  3. // See https://developers.google.com/people/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/people/v1"
  8. // ...
  9. // peopleService, err := people.New(oauthHttpClient)
  10. package people // import "google.golang.org/api/people/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "people:v1"
  41. const apiName = "people"
  42. const apiVersion = "v1"
  43. const basePath = "https://people.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your contacts
  47. ContactsScope = "https://www.googleapis.com/auth/contacts"
  48. // View your contacts
  49. ContactsReadonlyScope = "https://www.googleapis.com/auth/contacts.readonly"
  50. // Know the list of people in your circles, your age range, and language
  51. PlusLoginScope = "https://www.googleapis.com/auth/plus.login"
  52. // View your street addresses
  53. UserAddressesReadScope = "https://www.googleapis.com/auth/user.addresses.read"
  54. // View your complete date of birth
  55. UserBirthdayReadScope = "https://www.googleapis.com/auth/user.birthday.read"
  56. // View your email addresses
  57. UserEmailsReadScope = "https://www.googleapis.com/auth/user.emails.read"
  58. // View your phone numbers
  59. UserPhonenumbersReadScope = "https://www.googleapis.com/auth/user.phonenumbers.read"
  60. // View your email address
  61. UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
  62. // View your basic profile info
  63. UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile"
  64. )
  65. func New(client *http.Client) (*Service, error) {
  66. if client == nil {
  67. return nil, errors.New("client is nil")
  68. }
  69. s := &Service{client: client, BasePath: basePath}
  70. s.ContactGroups = NewContactGroupsService(s)
  71. s.People = NewPeopleService(s)
  72. return s, nil
  73. }
  74. type Service struct {
  75. client *http.Client
  76. BasePath string // API endpoint base URL
  77. UserAgent string // optional additional User-Agent fragment
  78. ContactGroups *ContactGroupsService
  79. People *PeopleService
  80. }
  81. func (s *Service) userAgent() string {
  82. if s.UserAgent == "" {
  83. return googleapi.UserAgent
  84. }
  85. return googleapi.UserAgent + " " + s.UserAgent
  86. }
  87. func NewContactGroupsService(s *Service) *ContactGroupsService {
  88. rs := &ContactGroupsService{s: s}
  89. rs.Members = NewContactGroupsMembersService(s)
  90. return rs
  91. }
  92. type ContactGroupsService struct {
  93. s *Service
  94. Members *ContactGroupsMembersService
  95. }
  96. func NewContactGroupsMembersService(s *Service) *ContactGroupsMembersService {
  97. rs := &ContactGroupsMembersService{s: s}
  98. return rs
  99. }
  100. type ContactGroupsMembersService struct {
  101. s *Service
  102. }
  103. func NewPeopleService(s *Service) *PeopleService {
  104. rs := &PeopleService{s: s}
  105. rs.Connections = NewPeopleConnectionsService(s)
  106. return rs
  107. }
  108. type PeopleService struct {
  109. s *Service
  110. Connections *PeopleConnectionsService
  111. }
  112. func NewPeopleConnectionsService(s *Service) *PeopleConnectionsService {
  113. rs := &PeopleConnectionsService{s: s}
  114. return rs
  115. }
  116. type PeopleConnectionsService struct {
  117. s *Service
  118. }
  119. // Address: A person's physical address. May be a P.O. box or street
  120. // address. All fields
  121. // are optional.
  122. type Address struct {
  123. // City: The city of the address.
  124. City string `json:"city,omitempty"`
  125. // Country: The country of the address.
  126. Country string `json:"country,omitempty"`
  127. // CountryCode: The [ISO 3166-1
  128. // alpha-2](http://www.iso.org/iso/country_codes.htm) country
  129. // code of the address.
  130. CountryCode string `json:"countryCode,omitempty"`
  131. // ExtendedAddress: The extended address of the address; for example,
  132. // the apartment number.
  133. ExtendedAddress string `json:"extendedAddress,omitempty"`
  134. // FormattedType: The read-only type of the address translated and
  135. // formatted in the viewer's
  136. // account locale or the `Accept-Language` HTTP header locale.
  137. FormattedType string `json:"formattedType,omitempty"`
  138. // FormattedValue: The unstructured value of the address. If this is not
  139. // set by the user it
  140. // will be automatically constructed from structured values.
  141. FormattedValue string `json:"formattedValue,omitempty"`
  142. // Metadata: Metadata about the address.
  143. Metadata *FieldMetadata `json:"metadata,omitempty"`
  144. // PoBox: The P.O. box of the address.
  145. PoBox string `json:"poBox,omitempty"`
  146. // PostalCode: The postal code of the address.
  147. PostalCode string `json:"postalCode,omitempty"`
  148. // Region: The region of the address; for example, the state or
  149. // province.
  150. Region string `json:"region,omitempty"`
  151. // StreetAddress: The street address.
  152. StreetAddress string `json:"streetAddress,omitempty"`
  153. // Type: The type of the address. The type can be custom or one of these
  154. // predefined
  155. // values:
  156. //
  157. // * `home`
  158. // * `work`
  159. // * `other`
  160. Type string `json:"type,omitempty"`
  161. // ForceSendFields is a list of field names (e.g. "City") to
  162. // unconditionally include in API requests. By default, fields with
  163. // empty values are omitted from API requests. However, any non-pointer,
  164. // non-interface field appearing in ForceSendFields will be sent to the
  165. // server regardless of whether the field is empty or not. This may be
  166. // used to include empty fields in Patch requests.
  167. ForceSendFields []string `json:"-"`
  168. // NullFields is a list of field names (e.g. "City") to include in API
  169. // requests with the JSON null value. By default, fields with empty
  170. // values are omitted from API requests. However, any field with an
  171. // empty value appearing in NullFields will be sent to the server as
  172. // null. It is an error if a field in this list has a non-empty value.
  173. // This may be used to include null fields in Patch requests.
  174. NullFields []string `json:"-"`
  175. }
  176. func (s *Address) MarshalJSON() ([]byte, error) {
  177. type NoMethod Address
  178. raw := NoMethod(*s)
  179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  180. }
  181. // AgeRangeType: A person's age range.
  182. type AgeRangeType struct {
  183. // AgeRange: The age range.
  184. //
  185. // Possible values:
  186. // "AGE_RANGE_UNSPECIFIED" - Unspecified.
  187. // "LESS_THAN_EIGHTEEN" - Younger than eighteen.
  188. // "EIGHTEEN_TO_TWENTY" - Between eighteen and twenty.
  189. // "TWENTY_ONE_OR_OLDER" - Twenty-one and older.
  190. AgeRange string `json:"ageRange,omitempty"`
  191. // Metadata: Metadata about the age range.
  192. Metadata *FieldMetadata `json:"metadata,omitempty"`
  193. // ForceSendFields is a list of field names (e.g. "AgeRange") to
  194. // unconditionally include in API requests. By default, fields with
  195. // empty values are omitted from API requests. However, any non-pointer,
  196. // non-interface field appearing in ForceSendFields will be sent to the
  197. // server regardless of whether the field is empty or not. This may be
  198. // used to include empty fields in Patch requests.
  199. ForceSendFields []string `json:"-"`
  200. // NullFields is a list of field names (e.g. "AgeRange") to include in
  201. // API requests with the JSON null value. By default, fields with empty
  202. // values are omitted from API requests. However, any field with an
  203. // empty value appearing in NullFields will be sent to the server as
  204. // null. It is an error if a field in this list has a non-empty value.
  205. // This may be used to include null fields in Patch requests.
  206. NullFields []string `json:"-"`
  207. }
  208. func (s *AgeRangeType) MarshalJSON() ([]byte, error) {
  209. type NoMethod AgeRangeType
  210. raw := NoMethod(*s)
  211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  212. }
  213. // BatchGetContactGroupsResponse: The response to a batch get contact
  214. // groups request.
  215. type BatchGetContactGroupsResponse struct {
  216. // Responses: The list of responses for each requested contact group
  217. // resource.
  218. Responses []*ContactGroupResponse `json:"responses,omitempty"`
  219. // ServerResponse contains the HTTP response code and headers from the
  220. // server.
  221. googleapi.ServerResponse `json:"-"`
  222. // ForceSendFields is a list of field names (e.g. "Responses") to
  223. // unconditionally include in API requests. By default, fields with
  224. // empty values are omitted from API requests. However, any non-pointer,
  225. // non-interface field appearing in ForceSendFields will be sent to the
  226. // server regardless of whether the field is empty or not. This may be
  227. // used to include empty fields in Patch requests.
  228. ForceSendFields []string `json:"-"`
  229. // NullFields is a list of field names (e.g. "Responses") to include in
  230. // API requests with the JSON null value. By default, fields with empty
  231. // values are omitted from API requests. However, any field with an
  232. // empty value appearing in NullFields will be sent to the server as
  233. // null. It is an error if a field in this list has a non-empty value.
  234. // This may be used to include null fields in Patch requests.
  235. NullFields []string `json:"-"`
  236. }
  237. func (s *BatchGetContactGroupsResponse) MarshalJSON() ([]byte, error) {
  238. type NoMethod BatchGetContactGroupsResponse
  239. raw := NoMethod(*s)
  240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  241. }
  242. // Biography: A person's short biography.
  243. type Biography struct {
  244. // ContentType: The content type of the biography.
  245. //
  246. // Possible values:
  247. // "CONTENT_TYPE_UNSPECIFIED" - Unspecified.
  248. // "TEXT_PLAIN" - Plain text.
  249. // "TEXT_HTML" - HTML text.
  250. ContentType string `json:"contentType,omitempty"`
  251. // Metadata: Metadata about the biography.
  252. Metadata *FieldMetadata `json:"metadata,omitempty"`
  253. // Value: The short biography.
  254. Value string `json:"value,omitempty"`
  255. // ForceSendFields is a list of field names (e.g. "ContentType") to
  256. // unconditionally include in API requests. By default, fields with
  257. // empty values are omitted from API requests. However, any non-pointer,
  258. // non-interface field appearing in ForceSendFields will be sent to the
  259. // server regardless of whether the field is empty or not. This may be
  260. // used to include empty fields in Patch requests.
  261. ForceSendFields []string `json:"-"`
  262. // NullFields is a list of field names (e.g. "ContentType") to include
  263. // in API requests with the JSON null value. By default, fields with
  264. // empty values are omitted from API requests. However, any field with
  265. // an empty value appearing in NullFields will be sent to the server as
  266. // null. It is an error if a field in this list has a non-empty value.
  267. // This may be used to include null fields in Patch requests.
  268. NullFields []string `json:"-"`
  269. }
  270. func (s *Biography) MarshalJSON() ([]byte, error) {
  271. type NoMethod Biography
  272. raw := NoMethod(*s)
  273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  274. }
  275. // Birthday: A person's birthday. At least one of the `date` and `text`
  276. // fields are
  277. // specified. The `date` and `text` fields typically represent the
  278. // same
  279. // date, but are not guaranteed to.
  280. type Birthday struct {
  281. // Date: The date of the birthday.
  282. Date *Date `json:"date,omitempty"`
  283. // Metadata: Metadata about the birthday.
  284. Metadata *FieldMetadata `json:"metadata,omitempty"`
  285. // Text: A free-form string representing the user's birthday.
  286. Text string `json:"text,omitempty"`
  287. // ForceSendFields is a list of field names (e.g. "Date") to
  288. // unconditionally include in API requests. By default, fields with
  289. // empty values are omitted from API requests. However, any non-pointer,
  290. // non-interface field appearing in ForceSendFields will be sent to the
  291. // server regardless of whether the field is empty or not. This may be
  292. // used to include empty fields in Patch requests.
  293. ForceSendFields []string `json:"-"`
  294. // NullFields is a list of field names (e.g. "Date") to include in API
  295. // requests with the JSON null value. By default, fields with empty
  296. // values are omitted from API requests. However, any field with an
  297. // empty value appearing in NullFields will be sent to the server as
  298. // null. It is an error if a field in this list has a non-empty value.
  299. // This may be used to include null fields in Patch requests.
  300. NullFields []string `json:"-"`
  301. }
  302. func (s *Birthday) MarshalJSON() ([]byte, error) {
  303. type NoMethod Birthday
  304. raw := NoMethod(*s)
  305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  306. }
  307. // BraggingRights: A person's bragging rights.
  308. type BraggingRights struct {
  309. // Metadata: Metadata about the bragging rights.
  310. Metadata *FieldMetadata `json:"metadata,omitempty"`
  311. // Value: The bragging rights; for example, `climbed mount everest`.
  312. Value string `json:"value,omitempty"`
  313. // ForceSendFields is a list of field names (e.g. "Metadata") to
  314. // unconditionally include in API requests. By default, fields with
  315. // empty values are omitted from API requests. However, any non-pointer,
  316. // non-interface field appearing in ForceSendFields will be sent to the
  317. // server regardless of whether the field is empty or not. This may be
  318. // used to include empty fields in Patch requests.
  319. ForceSendFields []string `json:"-"`
  320. // NullFields is a list of field names (e.g. "Metadata") to include in
  321. // API requests with the JSON null value. By default, fields with empty
  322. // values are omitted from API requests. However, any field with an
  323. // empty value appearing in NullFields will be sent to the server as
  324. // null. It is an error if a field in this list has a non-empty value.
  325. // This may be used to include null fields in Patch requests.
  326. NullFields []string `json:"-"`
  327. }
  328. func (s *BraggingRights) MarshalJSON() ([]byte, error) {
  329. type NoMethod BraggingRights
  330. raw := NoMethod(*s)
  331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  332. }
  333. // ContactGroup: A contact group.
  334. type ContactGroup struct {
  335. // Etag: The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag)
  336. // of the
  337. // resource. Used for web cache validation.
  338. Etag string `json:"etag,omitempty"`
  339. // FormattedName: The read-only name translated and formatted in the
  340. // viewer's account locale
  341. // or the `Accept-Language` HTTP header locale for system groups
  342. // names.
  343. // Group names set by the owner are the same as name.
  344. FormattedName string `json:"formattedName,omitempty"`
  345. // GroupType: The read-only contact group type.
  346. //
  347. // Possible values:
  348. // "GROUP_TYPE_UNSPECIFIED" - Unspecified.
  349. // "USER_CONTACT_GROUP" - User defined contact group.
  350. // "SYSTEM_CONTACT_GROUP" - System defined contact group.
  351. GroupType string `json:"groupType,omitempty"`
  352. // MemberCount: The total number of contacts in the group irrespective
  353. // of max members in
  354. // specified in the request.
  355. MemberCount int64 `json:"memberCount,omitempty"`
  356. // MemberResourceNames: The list of contact person resource names that
  357. // are members of the contact
  358. // group. The field is not populated for LIST requests and can only be
  359. // updated
  360. // through
  361. // the
  362. // [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/memb
  363. // ers/modify).
  364. MemberResourceNames []string `json:"memberResourceNames,omitempty"`
  365. // Metadata: Metadata about the contact group.
  366. Metadata *ContactGroupMetadata `json:"metadata,omitempty"`
  367. // Name: The contact group name set by the group owner or a system
  368. // provided name
  369. // for system groups.
  370. Name string `json:"name,omitempty"`
  371. // ResourceName: The resource name for the contact group, assigned by
  372. // the server. An ASCII
  373. // string, in the form of `contactGroups/`<var>contact_group_id</var>.
  374. ResourceName string `json:"resourceName,omitempty"`
  375. // ServerResponse contains the HTTP response code and headers from the
  376. // server.
  377. googleapi.ServerResponse `json:"-"`
  378. // ForceSendFields is a list of field names (e.g. "Etag") to
  379. // unconditionally include in API requests. By default, fields with
  380. // empty values are omitted from API requests. However, any non-pointer,
  381. // non-interface field appearing in ForceSendFields will be sent to the
  382. // server regardless of whether the field is empty or not. This may be
  383. // used to include empty fields in Patch requests.
  384. ForceSendFields []string `json:"-"`
  385. // NullFields is a list of field names (e.g. "Etag") to include in API
  386. // requests with the JSON null value. By default, fields with empty
  387. // values are omitted from API requests. However, any field with an
  388. // empty value appearing in NullFields will be sent to the server as
  389. // null. It is an error if a field in this list has a non-empty value.
  390. // This may be used to include null fields in Patch requests.
  391. NullFields []string `json:"-"`
  392. }
  393. func (s *ContactGroup) MarshalJSON() ([]byte, error) {
  394. type NoMethod ContactGroup
  395. raw := NoMethod(*s)
  396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  397. }
  398. // ContactGroupMembership: A Google contact group membership.
  399. type ContactGroupMembership struct {
  400. // ContactGroupId: The contact group ID for the contact group
  401. // membership. The contact group
  402. // ID can be custom or one of these predefined values:
  403. //
  404. // * `myContacts`
  405. // * `starred`
  406. // * A numerical ID for user-created groups.
  407. ContactGroupId string `json:"contactGroupId,omitempty"`
  408. // ForceSendFields is a list of field names (e.g. "ContactGroupId") to
  409. // unconditionally include in API requests. By default, fields with
  410. // empty values are omitted from API requests. However, any non-pointer,
  411. // non-interface field appearing in ForceSendFields will be sent to the
  412. // server regardless of whether the field is empty or not. This may be
  413. // used to include empty fields in Patch requests.
  414. ForceSendFields []string `json:"-"`
  415. // NullFields is a list of field names (e.g. "ContactGroupId") to
  416. // include in API requests with the JSON null value. By default, fields
  417. // with empty values are omitted from API requests. However, any field
  418. // with an empty value appearing in NullFields will be sent to the
  419. // server as null. It is an error if a field in this list has a
  420. // non-empty value. This may be used to include null fields in Patch
  421. // requests.
  422. NullFields []string `json:"-"`
  423. }
  424. func (s *ContactGroupMembership) MarshalJSON() ([]byte, error) {
  425. type NoMethod ContactGroupMembership
  426. raw := NoMethod(*s)
  427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  428. }
  429. // ContactGroupMetadata: The read-only metadata about a contact group.
  430. type ContactGroupMetadata struct {
  431. // Deleted: True if the contact group resource has been deleted.
  432. // Populated only
  433. // for
  434. // [`ListContactGroups`](/people/api/rest/v1/contactgroups/list)
  435. // requests
  436. // that include a sync token.
  437. Deleted bool `json:"deleted,omitempty"`
  438. // UpdateTime: The time the group was last updated.
  439. UpdateTime string `json:"updateTime,omitempty"`
  440. // ForceSendFields is a list of field names (e.g. "Deleted") to
  441. // unconditionally include in API requests. By default, fields with
  442. // empty values are omitted from API requests. However, any non-pointer,
  443. // non-interface field appearing in ForceSendFields will be sent to the
  444. // server regardless of whether the field is empty or not. This may be
  445. // used to include empty fields in Patch requests.
  446. ForceSendFields []string `json:"-"`
  447. // NullFields is a list of field names (e.g. "Deleted") to include in
  448. // API requests with the JSON null value. By default, fields with empty
  449. // values are omitted from API requests. However, any field with an
  450. // empty value appearing in NullFields will be sent to the server as
  451. // null. It is an error if a field in this list has a non-empty value.
  452. // This may be used to include null fields in Patch requests.
  453. NullFields []string `json:"-"`
  454. }
  455. func (s *ContactGroupMetadata) MarshalJSON() ([]byte, error) {
  456. type NoMethod ContactGroupMetadata
  457. raw := NoMethod(*s)
  458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  459. }
  460. // ContactGroupResponse: The response for a specific contact group.
  461. type ContactGroupResponse struct {
  462. // ContactGroup: The contact group.
  463. ContactGroup *ContactGroup `json:"contactGroup,omitempty"`
  464. // RequestedResourceName: The original requested resource name.
  465. RequestedResourceName string `json:"requestedResourceName,omitempty"`
  466. // Status: The status of the response.
  467. Status *Status `json:"status,omitempty"`
  468. // ForceSendFields is a list of field names (e.g. "ContactGroup") to
  469. // unconditionally include in API requests. By default, fields with
  470. // empty values are omitted from API requests. However, any non-pointer,
  471. // non-interface field appearing in ForceSendFields will be sent to the
  472. // server regardless of whether the field is empty or not. This may be
  473. // used to include empty fields in Patch requests.
  474. ForceSendFields []string `json:"-"`
  475. // NullFields is a list of field names (e.g. "ContactGroup") to include
  476. // in API requests with the JSON null value. By default, fields with
  477. // empty values are omitted from API requests. However, any field with
  478. // an empty value appearing in NullFields will be sent to the server as
  479. // null. It is an error if a field in this list has a non-empty value.
  480. // This may be used to include null fields in Patch requests.
  481. NullFields []string `json:"-"`
  482. }
  483. func (s *ContactGroupResponse) MarshalJSON() ([]byte, error) {
  484. type NoMethod ContactGroupResponse
  485. raw := NoMethod(*s)
  486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  487. }
  488. // CoverPhoto: A person's read-only cover photo. A large image shown on
  489. // the person's
  490. // profile page that represents who they are or what they care about.
  491. type CoverPhoto struct {
  492. // Default: True if the cover photo is the default cover photo;
  493. // false if the cover photo is a user-provided cover photo.
  494. Default bool `json:"default,omitempty"`
  495. // Metadata: Metadata about the cover photo.
  496. Metadata *FieldMetadata `json:"metadata,omitempty"`
  497. // Url: The URL of the cover photo.
  498. Url string `json:"url,omitempty"`
  499. // ForceSendFields is a list of field names (e.g. "Default") to
  500. // unconditionally include in API requests. By default, fields with
  501. // empty values are omitted from API requests. However, any non-pointer,
  502. // non-interface field appearing in ForceSendFields will be sent to the
  503. // server regardless of whether the field is empty or not. This may be
  504. // used to include empty fields in Patch requests.
  505. ForceSendFields []string `json:"-"`
  506. // NullFields is a list of field names (e.g. "Default") to include in
  507. // API requests with the JSON null value. By default, fields with empty
  508. // values are omitted from API requests. However, any field with an
  509. // empty value appearing in NullFields will be sent to the server as
  510. // null. It is an error if a field in this list has a non-empty value.
  511. // This may be used to include null fields in Patch requests.
  512. NullFields []string `json:"-"`
  513. }
  514. func (s *CoverPhoto) MarshalJSON() ([]byte, error) {
  515. type NoMethod CoverPhoto
  516. raw := NoMethod(*s)
  517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  518. }
  519. // CreateContactGroupRequest: A request to create a new contact group.
  520. type CreateContactGroupRequest struct {
  521. // ContactGroup: The contact group to create.
  522. ContactGroup *ContactGroup `json:"contactGroup,omitempty"`
  523. // ForceSendFields is a list of field names (e.g. "ContactGroup") to
  524. // unconditionally include in API requests. By default, fields with
  525. // empty values are omitted from API requests. However, any non-pointer,
  526. // non-interface field appearing in ForceSendFields will be sent to the
  527. // server regardless of whether the field is empty or not. This may be
  528. // used to include empty fields in Patch requests.
  529. ForceSendFields []string `json:"-"`
  530. // NullFields is a list of field names (e.g. "ContactGroup") to include
  531. // in API requests with the JSON null value. By default, fields with
  532. // empty values are omitted from API requests. However, any field with
  533. // an empty value appearing in NullFields will be sent to the server as
  534. // null. It is an error if a field in this list has a non-empty value.
  535. // This may be used to include null fields in Patch requests.
  536. NullFields []string `json:"-"`
  537. }
  538. func (s *CreateContactGroupRequest) MarshalJSON() ([]byte, error) {
  539. type NoMethod CreateContactGroupRequest
  540. raw := NoMethod(*s)
  541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  542. }
  543. // Date: Represents a whole calendar date, for example a date of birth.
  544. // The time
  545. // of day and time zone are either specified elsewhere or are
  546. // not
  547. // significant. The date is relative to the
  548. // [Proleptic Gregorian
  549. // Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar).
  550. //
  551. // The day may be 0 to represent a year and month where the day is
  552. // not
  553. // significant. The year may be 0 to represent a month and day
  554. // independent
  555. // of year; for example, anniversary date.
  556. type Date struct {
  557. // Day: Day of month. Must be from 1 to 31 and valid for the year and
  558. // month, or 0
  559. // if specifying a year/month where the day is not significant.
  560. Day int64 `json:"day,omitempty"`
  561. // Month: Month of year. Must be from 1 to 12, or 0 if specifying a date
  562. // without a
  563. // month.
  564. Month int64 `json:"month,omitempty"`
  565. // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
  566. // without
  567. // a year.
  568. Year int64 `json:"year,omitempty"`
  569. // ForceSendFields is a list of field names (e.g. "Day") to
  570. // unconditionally include in API requests. By default, fields with
  571. // empty values are omitted from API requests. However, any non-pointer,
  572. // non-interface field appearing in ForceSendFields will be sent to the
  573. // server regardless of whether the field is empty or not. This may be
  574. // used to include empty fields in Patch requests.
  575. ForceSendFields []string `json:"-"`
  576. // NullFields is a list of field names (e.g. "Day") to include in API
  577. // requests with the JSON null value. By default, fields with empty
  578. // values are omitted from API requests. However, any field with an
  579. // empty value appearing in NullFields will be sent to the server as
  580. // null. It is an error if a field in this list has a non-empty value.
  581. // This may be used to include null fields in Patch requests.
  582. NullFields []string `json:"-"`
  583. }
  584. func (s *Date) MarshalJSON() ([]byte, error) {
  585. type NoMethod Date
  586. raw := NoMethod(*s)
  587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  588. }
  589. // DomainMembership: A Google Apps Domain membership.
  590. type DomainMembership struct {
  591. // InViewerDomain: True if the person is in the viewer's Google Apps
  592. // domain.
  593. InViewerDomain bool `json:"inViewerDomain,omitempty"`
  594. // ForceSendFields is a list of field names (e.g. "InViewerDomain") to
  595. // unconditionally include in API requests. By default, fields with
  596. // empty values are omitted from API requests. However, any non-pointer,
  597. // non-interface field appearing in ForceSendFields will be sent to the
  598. // server regardless of whether the field is empty or not. This may be
  599. // used to include empty fields in Patch requests.
  600. ForceSendFields []string `json:"-"`
  601. // NullFields is a list of field names (e.g. "InViewerDomain") to
  602. // include in API requests with the JSON null value. By default, fields
  603. // with empty values are omitted from API requests. However, any field
  604. // with an empty value appearing in NullFields will be sent to the
  605. // server as null. It is an error if a field in this list has a
  606. // non-empty value. This may be used to include null fields in Patch
  607. // requests.
  608. NullFields []string `json:"-"`
  609. }
  610. func (s *DomainMembership) MarshalJSON() ([]byte, error) {
  611. type NoMethod DomainMembership
  612. raw := NoMethod(*s)
  613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  614. }
  615. // EmailAddress: A person's email address.
  616. type EmailAddress struct {
  617. // DisplayName: The display name of the email.
  618. DisplayName string `json:"displayName,omitempty"`
  619. // FormattedType: The read-only type of the email address translated and
  620. // formatted in the
  621. // viewer's account locale or the `Accept-Language` HTTP header locale.
  622. FormattedType string `json:"formattedType,omitempty"`
  623. // Metadata: Metadata about the email address.
  624. Metadata *FieldMetadata `json:"metadata,omitempty"`
  625. // Type: The type of the email address. The type can be custom or one of
  626. // these
  627. // predefined values:
  628. //
  629. // * `home`
  630. // * `work`
  631. // * `other`
  632. Type string `json:"type,omitempty"`
  633. // Value: The email address.
  634. Value string `json:"value,omitempty"`
  635. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  636. // unconditionally include in API requests. By default, fields with
  637. // empty values are omitted from API requests. However, any non-pointer,
  638. // non-interface field appearing in ForceSendFields will be sent to the
  639. // server regardless of whether the field is empty or not. This may be
  640. // used to include empty fields in Patch requests.
  641. ForceSendFields []string `json:"-"`
  642. // NullFields is a list of field names (e.g. "DisplayName") to include
  643. // in API requests with the JSON null value. By default, fields with
  644. // empty values are omitted from API requests. However, any field with
  645. // an empty value appearing in NullFields will be sent to the server as
  646. // null. It is an error if a field in this list has a non-empty value.
  647. // This may be used to include null fields in Patch requests.
  648. NullFields []string `json:"-"`
  649. }
  650. func (s *EmailAddress) MarshalJSON() ([]byte, error) {
  651. type NoMethod EmailAddress
  652. raw := NoMethod(*s)
  653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  654. }
  655. // Empty: A generic empty message that you can re-use to avoid defining
  656. // duplicated
  657. // empty messages in your APIs. A typical example is to use it as the
  658. // request
  659. // or the response type of an API method. For instance:
  660. //
  661. // service Foo {
  662. // rpc Bar(google.protobuf.Empty) returns
  663. // (google.protobuf.Empty);
  664. // }
  665. //
  666. // The JSON representation for `Empty` is empty JSON object `{}`.
  667. type Empty struct {
  668. // ServerResponse contains the HTTP response code and headers from the
  669. // server.
  670. googleapi.ServerResponse `json:"-"`
  671. }
  672. // Event: An event related to the person.
  673. type Event struct {
  674. // Date: The date of the event.
  675. Date *Date `json:"date,omitempty"`
  676. // FormattedType: The read-only type of the event translated and
  677. // formatted in the
  678. // viewer's account locale or the `Accept-Language` HTTP header locale.
  679. FormattedType string `json:"formattedType,omitempty"`
  680. // Metadata: Metadata about the event.
  681. Metadata *FieldMetadata `json:"metadata,omitempty"`
  682. // Type: The type of the event. The type can be custom or one of these
  683. // predefined
  684. // values:
  685. //
  686. // * `anniversary`
  687. // * `other`
  688. Type string `json:"type,omitempty"`
  689. // ForceSendFields is a list of field names (e.g. "Date") to
  690. // unconditionally include in API requests. By default, fields with
  691. // empty values are omitted from API requests. However, any non-pointer,
  692. // non-interface field appearing in ForceSendFields will be sent to the
  693. // server regardless of whether the field is empty or not. This may be
  694. // used to include empty fields in Patch requests.
  695. ForceSendFields []string `json:"-"`
  696. // NullFields is a list of field names (e.g. "Date") to include in API
  697. // requests with the JSON null value. By default, fields with empty
  698. // values are omitted from API requests. However, any field with an
  699. // empty value appearing in NullFields will be sent to the server as
  700. // null. It is an error if a field in this list has a non-empty value.
  701. // This may be used to include null fields in Patch requests.
  702. NullFields []string `json:"-"`
  703. }
  704. func (s *Event) MarshalJSON() ([]byte, error) {
  705. type NoMethod Event
  706. raw := NoMethod(*s)
  707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  708. }
  709. // FieldMetadata: Metadata about a field.
  710. type FieldMetadata struct {
  711. // Primary: True if the field is the primary field; false if the field
  712. // is a secondary
  713. // field.
  714. Primary bool `json:"primary,omitempty"`
  715. // Source: The source of the field.
  716. Source *Source `json:"source,omitempty"`
  717. // Verified: True if the field is verified; false if the field is
  718. // unverified. A
  719. // verified field is typically a name, email address, phone number,
  720. // or
  721. // website that has been confirmed to be owned by the person.
  722. Verified bool `json:"verified,omitempty"`
  723. // ForceSendFields is a list of field names (e.g. "Primary") to
  724. // unconditionally include in API requests. By default, fields with
  725. // empty values are omitted from API requests. However, any non-pointer,
  726. // non-interface field appearing in ForceSendFields will be sent to the
  727. // server regardless of whether the field is empty or not. This may be
  728. // used to include empty fields in Patch requests.
  729. ForceSendFields []string `json:"-"`
  730. // NullFields is a list of field names (e.g. "Primary") to include in
  731. // API requests with the JSON null value. By default, fields with empty
  732. // values are omitted from API requests. However, any field with an
  733. // empty value appearing in NullFields will be sent to the server as
  734. // null. It is an error if a field in this list has a non-empty value.
  735. // This may be used to include null fields in Patch requests.
  736. NullFields []string `json:"-"`
  737. }
  738. func (s *FieldMetadata) MarshalJSON() ([]byte, error) {
  739. type NoMethod FieldMetadata
  740. raw := NoMethod(*s)
  741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  742. }
  743. // Gender: A person's gender.
  744. type Gender struct {
  745. // FormattedValue: The read-only value of the gender translated and
  746. // formatted in the viewer's
  747. // account locale or the `Accept-Language` HTTP header locale.
  748. FormattedValue string `json:"formattedValue,omitempty"`
  749. // Metadata: Metadata about the gender.
  750. Metadata *FieldMetadata `json:"metadata,omitempty"`
  751. // Value: The gender for the person. The gender can be custom or one of
  752. // these
  753. // predefined values:
  754. //
  755. // * `male`
  756. // * `female`
  757. // * `other`
  758. // * `unknown`
  759. Value string `json:"value,omitempty"`
  760. // ForceSendFields is a list of field names (e.g. "FormattedValue") to
  761. // unconditionally include in API requests. By default, fields with
  762. // empty values are omitted from API requests. However, any non-pointer,
  763. // non-interface field appearing in ForceSendFields will be sent to the
  764. // server regardless of whether the field is empty or not. This may be
  765. // used to include empty fields in Patch requests.
  766. ForceSendFields []string `json:"-"`
  767. // NullFields is a list of field names (e.g. "FormattedValue") to
  768. // include in API requests with the JSON null value. By default, fields
  769. // with empty values are omitted from API requests. However, any field
  770. // with an empty value appearing in NullFields will be sent to the
  771. // server as null. It is an error if a field in this list has a
  772. // non-empty value. This may be used to include null fields in Patch
  773. // requests.
  774. NullFields []string `json:"-"`
  775. }
  776. func (s *Gender) MarshalJSON() ([]byte, error) {
  777. type NoMethod Gender
  778. raw := NoMethod(*s)
  779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  780. }
  781. type GetPeopleResponse struct {
  782. // Responses: The response for each requested resource name.
  783. Responses []*PersonResponse `json:"responses,omitempty"`
  784. // ServerResponse contains the HTTP response code and headers from the
  785. // server.
  786. googleapi.ServerResponse `json:"-"`
  787. // ForceSendFields is a list of field names (e.g. "Responses") to
  788. // unconditionally include in API requests. By default, fields with
  789. // empty values are omitted from API requests. However, any non-pointer,
  790. // non-interface field appearing in ForceSendFields will be sent to the
  791. // server regardless of whether the field is empty or not. This may be
  792. // used to include empty fields in Patch requests.
  793. ForceSendFields []string `json:"-"`
  794. // NullFields is a list of field names (e.g. "Responses") to include in
  795. // API requests with the JSON null value. By default, fields with empty
  796. // values are omitted from API requests. However, any field with an
  797. // empty value appearing in NullFields will be sent to the server as
  798. // null. It is an error if a field in this list has a non-empty value.
  799. // This may be used to include null fields in Patch requests.
  800. NullFields []string `json:"-"`
  801. }
  802. func (s *GetPeopleResponse) MarshalJSON() ([]byte, error) {
  803. type NoMethod GetPeopleResponse
  804. raw := NoMethod(*s)
  805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  806. }
  807. // ImClient: A person's instant messaging client.
  808. type ImClient struct {
  809. // FormattedProtocol: The read-only protocol of the IM client formatted
  810. // in the viewer's account
  811. // locale or the `Accept-Language` HTTP header locale.
  812. FormattedProtocol string `json:"formattedProtocol,omitempty"`
  813. // FormattedType: The read-only type of the IM client translated and
  814. // formatted in the
  815. // viewer's account locale or the `Accept-Language` HTTP header locale.
  816. FormattedType string `json:"formattedType,omitempty"`
  817. // Metadata: Metadata about the IM client.
  818. Metadata *FieldMetadata `json:"metadata,omitempty"`
  819. // Protocol: The protocol of the IM client. The protocol can be custom
  820. // or one of these
  821. // predefined values:
  822. //
  823. // * `aim`
  824. // * `msn`
  825. // * `yahoo`
  826. // * `skype`
  827. // * `qq`
  828. // * `googleTalk`
  829. // * `icq`
  830. // * `jabber`
  831. // * `netMeeting`
  832. Protocol string `json:"protocol,omitempty"`
  833. // Type: The type of the IM client. The type can be custom or one of
  834. // these
  835. // predefined values:
  836. //
  837. // * `home`
  838. // * `work`
  839. // * `other`
  840. Type string `json:"type,omitempty"`
  841. // Username: The user name used in the IM client.
  842. Username string `json:"username,omitempty"`
  843. // ForceSendFields is a list of field names (e.g. "FormattedProtocol")
  844. // to unconditionally include in API requests. By default, fields with
  845. // empty values are omitted from API requests. However, any non-pointer,
  846. // non-interface field appearing in ForceSendFields will be sent to the
  847. // server regardless of whether the field is empty or not. This may be
  848. // used to include empty fields in Patch requests.
  849. ForceSendFields []string `json:"-"`
  850. // NullFields is a list of field names (e.g. "FormattedProtocol") to
  851. // include in API requests with the JSON null value. By default, fields
  852. // with empty values are omitted from API requests. However, any field
  853. // with an empty value appearing in NullFields will be sent to the
  854. // server as null. It is an error if a field in this list has a
  855. // non-empty value. This may be used to include null fields in Patch
  856. // requests.
  857. NullFields []string `json:"-"`
  858. }
  859. func (s *ImClient) MarshalJSON() ([]byte, error) {
  860. type NoMethod ImClient
  861. raw := NoMethod(*s)
  862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  863. }
  864. // Interest: One of the person's interests.
  865. type Interest struct {
  866. // Metadata: Metadata about the interest.
  867. Metadata *FieldMetadata `json:"metadata,omitempty"`
  868. // Value: The interest; for example, `stargazing`.
  869. Value string `json:"value,omitempty"`
  870. // ForceSendFields is a list of field names (e.g. "Metadata") to
  871. // unconditionally include in API requests. By default, fields with
  872. // empty values are omitted from API requests. However, any non-pointer,
  873. // non-interface field appearing in ForceSendFields will be sent to the
  874. // server regardless of whether the field is empty or not. This may be
  875. // used to include empty fields in Patch requests.
  876. ForceSendFields []string `json:"-"`
  877. // NullFields is a list of field names (e.g. "Metadata") to include in
  878. // API requests with the JSON null value. By default, fields with empty
  879. // values are omitted from API requests. However, any field with an
  880. // empty value appearing in NullFields will be sent to the server as
  881. // null. It is an error if a field in this list has a non-empty value.
  882. // This may be used to include null fields in Patch requests.
  883. NullFields []string `json:"-"`
  884. }
  885. func (s *Interest) MarshalJSON() ([]byte, error) {
  886. type NoMethod Interest
  887. raw := NoMethod(*s)
  888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  889. }
  890. type ListConnectionsResponse struct {
  891. // Connections: The list of people that the requestor is connected to.
  892. Connections []*Person `json:"connections,omitempty"`
  893. // NextPageToken: The token that can be used to retrieve the next page
  894. // of results.
  895. NextPageToken string `json:"nextPageToken,omitempty"`
  896. // NextSyncToken: The token that can be used to retrieve changes since
  897. // the last request.
  898. NextSyncToken string `json:"nextSyncToken,omitempty"`
  899. // TotalItems: The total number of items in the list without pagination.
  900. TotalItems int64 `json:"totalItems,omitempty"`
  901. // TotalPeople: **DEPRECATED** (Please use totalItems)
  902. // The total number of people in the list without pagination.
  903. TotalPeople int64 `json:"totalPeople,omitempty"`
  904. // ServerResponse contains the HTTP response code and headers from the
  905. // server.
  906. googleapi.ServerResponse `json:"-"`
  907. // ForceSendFields is a list of field names (e.g. "Connections") to
  908. // unconditionally include in API requests. By default, fields with
  909. // empty values are omitted from API requests. However, any non-pointer,
  910. // non-interface field appearing in ForceSendFields will be sent to the
  911. // server regardless of whether the field is empty or not. This may be
  912. // used to include empty fields in Patch requests.
  913. ForceSendFields []string `json:"-"`
  914. // NullFields is a list of field names (e.g. "Connections") to include
  915. // in API requests with the JSON null value. By default, fields with
  916. // empty values are omitted from API requests. However, any field with
  917. // an empty value appearing in NullFields will be sent to the server as
  918. // null. It is an error if a field in this list has a non-empty value.
  919. // This may be used to include null fields in Patch requests.
  920. NullFields []string `json:"-"`
  921. }
  922. func (s *ListConnectionsResponse) MarshalJSON() ([]byte, error) {
  923. type NoMethod ListConnectionsResponse
  924. raw := NoMethod(*s)
  925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  926. }
  927. // ListContactGroupsResponse: The response to a list contact groups
  928. // request.
  929. type ListContactGroupsResponse struct {
  930. // ContactGroups: The list of contact groups. Members of the contact
  931. // groups are not
  932. // populated.
  933. ContactGroups []*ContactGroup `json:"contactGroups,omitempty"`
  934. // NextPageToken: The token that can be used to retrieve the next page
  935. // of results.
  936. NextPageToken string `json:"nextPageToken,omitempty"`
  937. // NextSyncToken: The token that can be used to retrieve changes since
  938. // the last request.
  939. NextSyncToken string `json:"nextSyncToken,omitempty"`
  940. // TotalItems: The total number of items in the list without pagination.
  941. TotalItems int64 `json:"totalItems,omitempty"`
  942. // ServerResponse contains the HTTP response code and headers from the
  943. // server.
  944. googleapi.ServerResponse `json:"-"`
  945. // ForceSendFields is a list of field names (e.g. "ContactGroups") to
  946. // unconditionally include in API requests. By default, fields with
  947. // empty values are omitted from API requests. However, any non-pointer,
  948. // non-interface field appearing in ForceSendFields will be sent to the
  949. // server regardless of whether the field is empty or not. This may be
  950. // used to include empty fields in Patch requests.
  951. ForceSendFields []string `json:"-"`
  952. // NullFields is a list of field names (e.g. "ContactGroups") to include
  953. // in API requests with the JSON null value. By default, fields with
  954. // empty values are omitted from API requests. However, any field with
  955. // an empty value appearing in NullFields will be sent to the server as
  956. // null. It is an error if a field in this list has a non-empty value.
  957. // This may be used to include null fields in Patch requests.
  958. NullFields []string `json:"-"`
  959. }
  960. func (s *ListContactGroupsResponse) MarshalJSON() ([]byte, error) {
  961. type NoMethod ListContactGroupsResponse
  962. raw := NoMethod(*s)
  963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  964. }
  965. // Locale: A person's locale preference.
  966. type Locale struct {
  967. // Metadata: Metadata about the locale.
  968. Metadata *FieldMetadata `json:"metadata,omitempty"`
  969. // Value: The well-formed [IETF BCP
  970. // 47](https://tools.ietf.org/html/bcp47)
  971. // language tag representing the locale.
  972. Value string `json:"value,omitempty"`
  973. // ForceSendFields is a list of field names (e.g. "Metadata") to
  974. // unconditionally include in API requests. By default, fields with
  975. // empty values are omitted from API requests. However, any non-pointer,
  976. // non-interface field appearing in ForceSendFields will be sent to the
  977. // server regardless of whether the field is empty or not. This may be
  978. // used to include empty fields in Patch requests.
  979. ForceSendFields []string `json:"-"`
  980. // NullFields is a list of field names (e.g. "Metadata") to include in
  981. // API requests with the JSON null value. By default, fields with empty
  982. // values are omitted from API requests. However, any field with an
  983. // empty value appearing in NullFields will be sent to the server as
  984. // null. It is an error if a field in this list has a non-empty value.
  985. // This may be used to include null fields in Patch requests.
  986. NullFields []string `json:"-"`
  987. }
  988. func (s *Locale) MarshalJSON() ([]byte, error) {
  989. type NoMethod Locale
  990. raw := NoMethod(*s)
  991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  992. }
  993. // Membership: A person's read-only membership in a group.
  994. type Membership struct {
  995. // ContactGroupMembership: The contact group membership.
  996. ContactGroupMembership *ContactGroupMembership `json:"contactGroupMembership,omitempty"`
  997. // DomainMembership: The domain membership.
  998. DomainMembership *DomainMembership `json:"domainMembership,omitempty"`
  999. // Metadata: Metadata about the membership.
  1000. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1001. // ForceSendFields is a list of field names (e.g.
  1002. // "ContactGroupMembership") to unconditionally include in API requests.
  1003. // By default, fields with empty values are omitted from API requests.
  1004. // However, any non-pointer, non-interface field appearing in
  1005. // ForceSendFields will be sent to the server regardless of whether the
  1006. // field is empty or not. This may be used to include empty fields in
  1007. // Patch requests.
  1008. ForceSendFields []string `json:"-"`
  1009. // NullFields is a list of field names (e.g. "ContactGroupMembership")
  1010. // to include in API requests with the JSON null value. By default,
  1011. // fields with empty values are omitted from API requests. However, any
  1012. // field with an empty value appearing in NullFields will be sent to the
  1013. // server as null. It is an error if a field in this list has a
  1014. // non-empty value. This may be used to include null fields in Patch
  1015. // requests.
  1016. NullFields []string `json:"-"`
  1017. }
  1018. func (s *Membership) MarshalJSON() ([]byte, error) {
  1019. type NoMethod Membership
  1020. raw := NoMethod(*s)
  1021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1022. }
  1023. // ModifyContactGroupMembersRequest: A request to modify an existing
  1024. // contact group's members. Contacts can be
  1025. // removed from any group but they can only be added to a user group
  1026. // or
  1027. // myContacts or starred system groups.
  1028. type ModifyContactGroupMembersRequest struct {
  1029. // ResourceNamesToAdd: The resource names of the contact people to add
  1030. // in the form of in the form
  1031. // `people/`<var>person_id</var>.
  1032. ResourceNamesToAdd []string `json:"resourceNamesToAdd,omitempty"`
  1033. // ResourceNamesToRemove: The resource names of the contact people to
  1034. // remove in the form of in the
  1035. // form of `people/`<var>person_id</var>.
  1036. ResourceNamesToRemove []string `json:"resourceNamesToRemove,omitempty"`
  1037. // ForceSendFields is a list of field names (e.g. "ResourceNamesToAdd")
  1038. // to unconditionally include in API requests. By default, fields with
  1039. // empty values are omitted from API requests. However, any non-pointer,
  1040. // non-interface field appearing in ForceSendFields will be sent to the
  1041. // server regardless of whether the field is empty or not. This may be
  1042. // used to include empty fields in Patch requests.
  1043. ForceSendFields []string `json:"-"`
  1044. // NullFields is a list of field names (e.g. "ResourceNamesToAdd") to
  1045. // include in API requests with the JSON null value. By default, fields
  1046. // with empty values are omitted from API requests. However, any field
  1047. // with an empty value appearing in NullFields will be sent to the
  1048. // server as null. It is an error if a field in this list has a
  1049. // non-empty value. This may be used to include null fields in Patch
  1050. // requests.
  1051. NullFields []string `json:"-"`
  1052. }
  1053. func (s *ModifyContactGroupMembersRequest) MarshalJSON() ([]byte, error) {
  1054. type NoMethod ModifyContactGroupMembersRequest
  1055. raw := NoMethod(*s)
  1056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1057. }
  1058. // ModifyContactGroupMembersResponse: The response to a modify contact
  1059. // group members request.
  1060. type ModifyContactGroupMembersResponse struct {
  1061. // NotFoundResourceNames: The contact people resource names that were
  1062. // not found.
  1063. NotFoundResourceNames []string `json:"notFoundResourceNames,omitempty"`
  1064. // ServerResponse contains the HTTP response code and headers from the
  1065. // server.
  1066. googleapi.ServerResponse `json:"-"`
  1067. // ForceSendFields is a list of field names (e.g.
  1068. // "NotFoundResourceNames") to unconditionally include in API requests.
  1069. // By default, fields with empty values are omitted from API requests.
  1070. // However, any non-pointer, non-interface field appearing in
  1071. // ForceSendFields will be sent to the server regardless of whether the
  1072. // field is empty or not. This may be used to include empty fields in
  1073. // Patch requests.
  1074. ForceSendFields []string `json:"-"`
  1075. // NullFields is a list of field names (e.g. "NotFoundResourceNames") to
  1076. // include in API requests with the JSON null value. By default, fields
  1077. // with empty values are omitted from API requests. However, any field
  1078. // with an empty value appearing in NullFields will be sent to the
  1079. // server as null. It is an error if a field in this list has a
  1080. // non-empty value. This may be used to include null fields in Patch
  1081. // requests.
  1082. NullFields []string `json:"-"`
  1083. }
  1084. func (s *ModifyContactGroupMembersResponse) MarshalJSON() ([]byte, error) {
  1085. type NoMethod ModifyContactGroupMembersResponse
  1086. raw := NoMethod(*s)
  1087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1088. }
  1089. // Name: A person's name. If the name is a mononym, the family name is
  1090. // empty.
  1091. type Name struct {
  1092. // DisplayName: The read-only display name formatted according to the
  1093. // locale specified by
  1094. // the viewer's account or the `Accept-Language` HTTP header.
  1095. DisplayName string `json:"displayName,omitempty"`
  1096. // DisplayNameLastFirst: The read-only display name with the last name
  1097. // first formatted according to
  1098. // the locale specified by the viewer's account or the
  1099. // `Accept-Language` HTTP header.
  1100. DisplayNameLastFirst string `json:"displayNameLastFirst,omitempty"`
  1101. // FamilyName: The family name.
  1102. FamilyName string `json:"familyName,omitempty"`
  1103. // GivenName: The given name.
  1104. GivenName string `json:"givenName,omitempty"`
  1105. // HonorificPrefix: The honorific prefixes, such as `Mrs.` or `Dr.`
  1106. HonorificPrefix string `json:"honorificPrefix,omitempty"`
  1107. // HonorificSuffix: The honorific suffixes, such as `Jr.`
  1108. HonorificSuffix string `json:"honorificSuffix,omitempty"`
  1109. // Metadata: Metadata about the name.
  1110. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1111. // MiddleName: The middle name(s).
  1112. MiddleName string `json:"middleName,omitempty"`
  1113. // PhoneticFamilyName: The family name spelled as it sounds.
  1114. PhoneticFamilyName string `json:"phoneticFamilyName,omitempty"`
  1115. // PhoneticFullName: The full name spelled as it sounds.
  1116. PhoneticFullName string `json:"phoneticFullName,omitempty"`
  1117. // PhoneticGivenName: The given name spelled as it sounds.
  1118. PhoneticGivenName string `json:"phoneticGivenName,omitempty"`
  1119. // PhoneticHonorificPrefix: The honorific prefixes spelled as they
  1120. // sound.
  1121. PhoneticHonorificPrefix string `json:"phoneticHonorificPrefix,omitempty"`
  1122. // PhoneticHonorificSuffix: The honorific suffixes spelled as they
  1123. // sound.
  1124. PhoneticHonorificSuffix string `json:"phoneticHonorificSuffix,omitempty"`
  1125. // PhoneticMiddleName: The middle name(s) spelled as they sound.
  1126. PhoneticMiddleName string `json:"phoneticMiddleName,omitempty"`
  1127. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  1128. // unconditionally include in API requests. By default, fields with
  1129. // empty values are omitted from API requests. However, any non-pointer,
  1130. // non-interface field appearing in ForceSendFields will be sent to the
  1131. // server regardless of whether the field is empty or not. This may be
  1132. // used to include empty fields in Patch requests.
  1133. ForceSendFields []string `json:"-"`
  1134. // NullFields is a list of field names (e.g. "DisplayName") to include
  1135. // in API requests with the JSON null value. By default, fields with
  1136. // empty values are omitted from API requests. However, any field with
  1137. // an empty value appearing in NullFields will be sent to the server as
  1138. // null. It is an error if a field in this list has a non-empty value.
  1139. // This may be used to include null fields in Patch requests.
  1140. NullFields []string `json:"-"`
  1141. }
  1142. func (s *Name) MarshalJSON() ([]byte, error) {
  1143. type NoMethod Name
  1144. raw := NoMethod(*s)
  1145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1146. }
  1147. // Nickname: A person's nickname.
  1148. type Nickname struct {
  1149. // Metadata: Metadata about the nickname.
  1150. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1151. // Type: The type of the nickname.
  1152. //
  1153. // Possible values:
  1154. // "DEFAULT" - Generic nickname.
  1155. // "MAIDEN_NAME" - Maiden name or birth family name. Used when the
  1156. // person's family name has
  1157. // changed as a result of marriage.
  1158. // "INITIALS" - Initials.
  1159. // "GPLUS" - Google+ profile nickname.
  1160. // "OTHER_NAME" - A professional affiliation or other name; for
  1161. // example, `Dr. Smith.`
  1162. Type string `json:"type,omitempty"`
  1163. // Value: The nickname.
  1164. Value string `json:"value,omitempty"`
  1165. // ForceSendFields is a list of field names (e.g. "Metadata") to
  1166. // unconditionally include in API requests. By default, fields with
  1167. // empty values are omitted from API requests. However, any non-pointer,
  1168. // non-interface field appearing in ForceSendFields will be sent to the
  1169. // server regardless of whether the field is empty or not. This may be
  1170. // used to include empty fields in Patch requests.
  1171. ForceSendFields []string `json:"-"`
  1172. // NullFields is a list of field names (e.g. "Metadata") to include in
  1173. // API requests with the JSON null value. By default, fields with empty
  1174. // values are omitted from API requests. However, any field with an
  1175. // empty value appearing in NullFields will be sent to the server as
  1176. // null. It is an error if a field in this list has a non-empty value.
  1177. // This may be used to include null fields in Patch requests.
  1178. NullFields []string `json:"-"`
  1179. }
  1180. func (s *Nickname) MarshalJSON() ([]byte, error) {
  1181. type NoMethod Nickname
  1182. raw := NoMethod(*s)
  1183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1184. }
  1185. // Occupation: A person's occupation.
  1186. type Occupation struct {
  1187. // Metadata: Metadata about the occupation.
  1188. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1189. // Value: The occupation; for example, `carpenter`.
  1190. Value string `json:"value,omitempty"`
  1191. // ForceSendFields is a list of field names (e.g. "Metadata") to
  1192. // unconditionally include in API requests. By default, fields with
  1193. // empty values are omitted from API requests. However, any non-pointer,
  1194. // non-interface field appearing in ForceSendFields will be sent to the
  1195. // server regardless of whether the field is empty or not. This may be
  1196. // used to include empty fields in Patch requests.
  1197. ForceSendFields []string `json:"-"`
  1198. // NullFields is a list of field names (e.g. "Metadata") to include in
  1199. // API requests with the JSON null value. By default, fields with empty
  1200. // values are omitted from API requests. However, any field with an
  1201. // empty value appearing in NullFields will be sent to the server as
  1202. // null. It is an error if a field in this list has a non-empty value.
  1203. // This may be used to include null fields in Patch requests.
  1204. NullFields []string `json:"-"`
  1205. }
  1206. func (s *Occupation) MarshalJSON() ([]byte, error) {
  1207. type NoMethod Occupation
  1208. raw := NoMethod(*s)
  1209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1210. }
  1211. // Organization: A person's past or current organization. Overlapping
  1212. // date ranges are
  1213. // permitted.
  1214. type Organization struct {
  1215. // Current: True if the organization is the person's current
  1216. // organization;
  1217. // false if the organization is a past organization.
  1218. Current bool `json:"current,omitempty"`
  1219. // Department: The person's department at the organization.
  1220. Department string `json:"department,omitempty"`
  1221. // Domain: The domain name associated with the organization; for
  1222. // example, `google.com`.
  1223. Domain string `json:"domain,omitempty"`
  1224. // EndDate: The end date when the person left the organization.
  1225. EndDate *Date `json:"endDate,omitempty"`
  1226. // FormattedType: The read-only type of the organization translated and
  1227. // formatted in the
  1228. // viewer's account locale or the `Accept-Language` HTTP header locale.
  1229. FormattedType string `json:"formattedType,omitempty"`
  1230. // JobDescription: The person's job description at the organization.
  1231. JobDescription string `json:"jobDescription,omitempty"`
  1232. // Location: The location of the organization office the person works
  1233. // at.
  1234. Location string `json:"location,omitempty"`
  1235. // Metadata: Metadata about the organization.
  1236. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1237. // Name: The name of the organization.
  1238. Name string `json:"name,omitempty"`
  1239. // PhoneticName: The phonetic name of the organization.
  1240. PhoneticName string `json:"phoneticName,omitempty"`
  1241. // StartDate: The start date when the person joined the organization.
  1242. StartDate *Date `json:"startDate,omitempty"`
  1243. // Symbol: The symbol associated with the organization; for example, a
  1244. // stock ticker
  1245. // symbol, abbreviation, or acronym.
  1246. Symbol string `json:"symbol,omitempty"`
  1247. // Title: The person's job title at the organization.
  1248. Title string `json:"title,omitempty"`
  1249. // Type: The type of the organization. The type can be custom or one of
  1250. // these
  1251. // predefined values:
  1252. //
  1253. // * `work`
  1254. // * `school`
  1255. Type string `json:"type,omitempty"`
  1256. // ForceSendFields is a list of field names (e.g. "Current") to
  1257. // unconditionally include in API requests. By default, fields with
  1258. // empty values are omitted from API requests. However, any non-pointer,
  1259. // non-interface field appearing in ForceSendFields will be sent to the
  1260. // server regardless of whether the field is empty or not. This may be
  1261. // used to include empty fields in Patch requests.
  1262. ForceSendFields []string `json:"-"`
  1263. // NullFields is a list of field names (e.g. "Current") to include in
  1264. // API requests with the JSON null value. By default, fields with empty
  1265. // values are omitted from API requests. However, any field with an
  1266. // empty value appearing in NullFields will be sent to the server as
  1267. // null. It is an error if a field in this list has a non-empty value.
  1268. // This may be used to include null fields in Patch requests.
  1269. NullFields []string `json:"-"`
  1270. }
  1271. func (s *Organization) MarshalJSON() ([]byte, error) {
  1272. type NoMethod Organization
  1273. raw := NoMethod(*s)
  1274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1275. }
  1276. // Person: Information about a person merged from various data sources
  1277. // such as the
  1278. // authenticated user's contacts and profile data.
  1279. //
  1280. // Most fields can have multiple items. The items in a field have no
  1281. // guaranteed
  1282. // order, but each non-empty field is guaranteed to have exactly one
  1283. // field with
  1284. // `metadata.primary` set to true.
  1285. type Person struct {
  1286. // Addresses: The person's street addresses.
  1287. Addresses []*Address `json:"addresses,omitempty"`
  1288. // AgeRange: **DEPRECATED** (Please use `person.ageRanges`
  1289. // instead)**
  1290. //
  1291. // The person's read-only age range.
  1292. //
  1293. // Possible values:
  1294. // "AGE_RANGE_UNSPECIFIED" - Unspecified.
  1295. // "LESS_THAN_EIGHTEEN" - Younger than eighteen.
  1296. // "EIGHTEEN_TO_TWENTY" - Between eighteen and twenty.
  1297. // "TWENTY_ONE_OR_OLDER" - Twenty-one and older.
  1298. AgeRange string `json:"ageRange,omitempty"`
  1299. // AgeRanges: The person's read-only age ranges.
  1300. AgeRanges []*AgeRangeType `json:"ageRanges,omitempty"`
  1301. // Biographies: The person's biographies.
  1302. Biographies []*Biography `json:"biographies,omitempty"`
  1303. // Birthdays: The person's birthdays.
  1304. Birthdays []*Birthday `json:"birthdays,omitempty"`
  1305. // BraggingRights: The person's bragging rights.
  1306. BraggingRights []*BraggingRights `json:"braggingRights,omitempty"`
  1307. // CoverPhotos: The person's read-only cover photos.
  1308. CoverPhotos []*CoverPhoto `json:"coverPhotos,omitempty"`
  1309. // EmailAddresses: The person's email addresses.
  1310. EmailAddresses []*EmailAddress `json:"emailAddresses,omitempty"`
  1311. // Etag: The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag)
  1312. // of the
  1313. // resource. Used for web cache validation.
  1314. Etag string `json:"etag,omitempty"`
  1315. // Events: The person's events.
  1316. Events []*Event `json:"events,omitempty"`
  1317. // Genders: The person's genders.
  1318. Genders []*Gender `json:"genders,omitempty"`
  1319. // ImClients: The person's instant messaging clients.
  1320. ImClients []*ImClient `json:"imClients,omitempty"`
  1321. // Interests: The person's interests.
  1322. Interests []*Interest `json:"interests,omitempty"`
  1323. // Locales: The person's locale preferences.
  1324. Locales []*Locale `json:"locales,omitempty"`
  1325. // Memberships: The person's read-only group memberships.
  1326. Memberships []*Membership `json:"memberships,omitempty"`
  1327. // Metadata: Read-only metadata about the person.
  1328. Metadata *PersonMetadata `json:"metadata,omitempty"`
  1329. // Names: The person's names.
  1330. Names []*Name `json:"names,omitempty"`
  1331. // Nicknames: The person's nicknames.
  1332. Nicknames []*Nickname `json:"nicknames,omitempty"`
  1333. // Occupations: The person's occupations.
  1334. Occupations []*Occupation `json:"occupations,omitempty"`
  1335. // Organizations: The person's past or current organizations.
  1336. Organizations []*Organization `json:"organizations,omitempty"`
  1337. // PhoneNumbers: The person's phone numbers.
  1338. PhoneNumbers []*PhoneNumber `json:"phoneNumbers,omitempty"`
  1339. // Photos: The person's read-only photos.
  1340. Photos []*Photo `json:"photos,omitempty"`
  1341. // Relations: The person's relations.
  1342. Relations []*Relation `json:"relations,omitempty"`
  1343. // RelationshipInterests: The person's read-only relationship interests.
  1344. RelationshipInterests []*RelationshipInterest `json:"relationshipInterests,omitempty"`
  1345. // RelationshipStatuses: The person's read-only relationship statuses.
  1346. RelationshipStatuses []*RelationshipStatus `json:"relationshipStatuses,omitempty"`
  1347. // Residences: The person's residences.
  1348. Residences []*Residence `json:"residences,omitempty"`
  1349. // ResourceName: The resource name for the person, assigned by the
  1350. // server. An ASCII string
  1351. // with a max length of 27 characters, in the form
  1352. // of
  1353. // `people/`<var>person_id</var>.
  1354. ResourceName string `json:"resourceName,omitempty"`
  1355. // SipAddresses: The person's SIP addresses.
  1356. SipAddresses []*SipAddress `json:"sipAddresses,omitempty"`
  1357. // Skills: The person's skills.
  1358. Skills []*Skill `json:"skills,omitempty"`
  1359. // Taglines: The person's read-only taglines.
  1360. Taglines []*Tagline `json:"taglines,omitempty"`
  1361. // Urls: The person's associated URLs.
  1362. Urls []*Url `json:"urls,omitempty"`
  1363. // UserDefined: The person's user defined data.
  1364. UserDefined []*UserDefined `json:"userDefined,omitempty"`
  1365. // ServerResponse contains the HTTP response code and headers from the
  1366. // server.
  1367. googleapi.ServerResponse `json:"-"`
  1368. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1369. // unconditionally include in API requests. By default, fields with
  1370. // empty values are omitted from API requests. However, any non-pointer,
  1371. // non-interface field appearing in ForceSendFields will be sent to the
  1372. // server regardless of whether the field is empty or not. This may be
  1373. // used to include empty fields in Patch requests.
  1374. ForceSendFields []string `json:"-"`
  1375. // NullFields is a list of field names (e.g. "Addresses") to include in
  1376. // API requests with the JSON null value. By default, fields with empty
  1377. // values are omitted from API requests. However, any field with an
  1378. // empty value appearing in NullFields will be sent to the server as
  1379. // null. It is an error if a field in this list has a non-empty value.
  1380. // This may be used to include null fields in Patch requests.
  1381. NullFields []string `json:"-"`
  1382. }
  1383. func (s *Person) MarshalJSON() ([]byte, error) {
  1384. type NoMethod Person
  1385. raw := NoMethod(*s)
  1386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1387. }
  1388. // PersonMetadata: The read-only metadata about a person.
  1389. type PersonMetadata struct {
  1390. // Deleted: True if the person resource has been deleted. Populated only
  1391. // for
  1392. // [`connections.list`](/people/api/rest/v1/people.connections/list)
  1393. // requests
  1394. // that include a sync token.
  1395. Deleted bool `json:"deleted,omitempty"`
  1396. // LinkedPeopleResourceNames: Resource names of people linked to this
  1397. // resource.
  1398. LinkedPeopleResourceNames []string `json:"linkedPeopleResourceNames,omitempty"`
  1399. // ObjectType: **DEPRECATED** (Please
  1400. // use
  1401. // `person.metadata.sources.profileMetadata.objectType` instead)
  1402. //
  1403. // The type of the person object.
  1404. //
  1405. // Possible values:
  1406. // "OBJECT_TYPE_UNSPECIFIED" - Unspecified.
  1407. // "PERSON" - Person.
  1408. // "PAGE" - [Google+ Page.](http://www.google.com/+/brands/)
  1409. ObjectType string `json:"objectType,omitempty"`
  1410. // PreviousResourceNames: Any former resource names this person has had.
  1411. // Populated only
  1412. // for
  1413. // [`connections.list`](/people/api/rest/v1/people.connections/list)
  1414. // requests
  1415. // that include a sync token.
  1416. //
  1417. // The resource name may change when adding or removing fields that link
  1418. // a
  1419. // contact and profile such as a verified email, verified phone number,
  1420. // or
  1421. // profile URL.
  1422. PreviousResourceNames []string `json:"previousResourceNames,omitempty"`
  1423. // Sources: The sources of data for the person.
  1424. Sources []*Source `json:"sources,omitempty"`
  1425. // ForceSendFields is a list of field names (e.g. "Deleted") to
  1426. // unconditionally include in API requests. By default, fields with
  1427. // empty values are omitted from API requests. However, any non-pointer,
  1428. // non-interface field appearing in ForceSendFields will be sent to the
  1429. // server regardless of whether the field is empty or not. This may be
  1430. // used to include empty fields in Patch requests.
  1431. ForceSendFields []string `json:"-"`
  1432. // NullFields is a list of field names (e.g. "Deleted") to include in
  1433. // API requests with the JSON null value. By default, fields with empty
  1434. // values are omitted from API requests. However, any field with an
  1435. // empty value appearing in NullFields will be sent to the server as
  1436. // null. It is an error if a field in this list has a non-empty value.
  1437. // This may be used to include null fields in Patch requests.
  1438. NullFields []string `json:"-"`
  1439. }
  1440. func (s *PersonMetadata) MarshalJSON() ([]byte, error) {
  1441. type NoMethod PersonMetadata
  1442. raw := NoMethod(*s)
  1443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1444. }
  1445. // PersonResponse: The response for a single person
  1446. type PersonResponse struct {
  1447. // HttpStatusCode: **DEPRECATED** (Please use status instead)
  1448. //
  1449. // [HTTP 1.1 status
  1450. // code]
  1451. // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).
  1452. HttpStatusCode int64 `json:"httpStatusCode,omitempty"`
  1453. // Person: The person.
  1454. Person *Person `json:"person,omitempty"`
  1455. // RequestedResourceName: The original requested resource name. May be
  1456. // different than the resource
  1457. // name on the returned person.
  1458. //
  1459. // The resource name can change when adding or removing fields that link
  1460. // a
  1461. // contact and profile such as a verified email, verified phone number,
  1462. // or a
  1463. // profile URL.
  1464. RequestedResourceName string `json:"requestedResourceName,omitempty"`
  1465. // Status: The status of the response.
  1466. Status *Status `json:"status,omitempty"`
  1467. // ForceSendFields is a list of field names (e.g. "HttpStatusCode") to
  1468. // unconditionally include in API requests. By default, fields with
  1469. // empty values are omitted from API requests. However, any non-pointer,
  1470. // non-interface field appearing in ForceSendFields will be sent to the
  1471. // server regardless of whether the field is empty or not. This may be
  1472. // used to include empty fields in Patch requests.
  1473. ForceSendFields []string `json:"-"`
  1474. // NullFields is a list of field names (e.g. "HttpStatusCode") to
  1475. // include in API requests with the JSON null value. By default, fields
  1476. // with empty values are omitted from API requests. However, any field
  1477. // with an empty value appearing in NullFields will be sent to the
  1478. // server as null. It is an error if a field in this list has a
  1479. // non-empty value. This may be used to include null fields in Patch
  1480. // requests.
  1481. NullFields []string `json:"-"`
  1482. }
  1483. func (s *PersonResponse) MarshalJSON() ([]byte, error) {
  1484. type NoMethod PersonResponse
  1485. raw := NoMethod(*s)
  1486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1487. }
  1488. // PhoneNumber: A person's phone number.
  1489. type PhoneNumber struct {
  1490. // CanonicalForm: The read-only canonicalized [ITU-T
  1491. // E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.
  1492. // pdf)
  1493. // form of the phone number.
  1494. CanonicalForm string `json:"canonicalForm,omitempty"`
  1495. // FormattedType: The read-only type of the phone number translated and
  1496. // formatted in the
  1497. // viewer's account locale or the `Accept-Language` HTTP header locale.
  1498. FormattedType string `json:"formattedType,omitempty"`
  1499. // Metadata: Metadata about the phone number.
  1500. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1501. // Type: The type of the phone number. The type can be custom or one of
  1502. // these
  1503. // predefined values:
  1504. //
  1505. // * `home`
  1506. // * `work`
  1507. // * `mobile`
  1508. // * `homeFax`
  1509. // * `workFax`
  1510. // * `otherFax`
  1511. // * `pager`
  1512. // * `workMobile`
  1513. // * `workPager`
  1514. // * `main`
  1515. // * `googleVoice`
  1516. // * `other`
  1517. Type string `json:"type,omitempty"`
  1518. // Value: The phone number.
  1519. Value string `json:"value,omitempty"`
  1520. // ForceSendFields is a list of field names (e.g. "CanonicalForm") to
  1521. // unconditionally include in API requests. By default, fields with
  1522. // empty values are omitted from API requests. However, any non-pointer,
  1523. // non-interface field appearing in ForceSendFields will be sent to the
  1524. // server regardless of whether the field is empty or not. This may be
  1525. // used to include empty fields in Patch requests.
  1526. ForceSendFields []string `json:"-"`
  1527. // NullFields is a list of field names (e.g. "CanonicalForm") to include
  1528. // in API requests with the JSON null value. By default, fields with
  1529. // empty values are omitted from API requests. However, any field with
  1530. // an empty value appearing in NullFields will be sent to the server as
  1531. // null. It is an error if a field in this list has a non-empty value.
  1532. // This may be used to include null fields in Patch requests.
  1533. NullFields []string `json:"-"`
  1534. }
  1535. func (s *PhoneNumber) MarshalJSON() ([]byte, error) {
  1536. type NoMethod PhoneNumber
  1537. raw := NoMethod(*s)
  1538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1539. }
  1540. // Photo: A person's read-only photo. A picture shown next to the
  1541. // person's name to
  1542. // help others recognize the person.
  1543. type Photo struct {
  1544. // Default: True if the photo is a default photo;
  1545. // false if the photo is a user-provided photo.
  1546. Default bool `json:"default,omitempty"`
  1547. // Metadata: Metadata about the photo.
  1548. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1549. // Url: The URL of the photo. You can change the desired size by
  1550. // appending a query
  1551. // parameter `sz=`<var>size</var> at the end of the url.
  1552. // Example:
  1553. // `https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/A
  1554. // AAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50`
  1555. Url string `json:"url,omitempty"`
  1556. // ForceSendFields is a list of field names (e.g. "Default") to
  1557. // unconditionally include in API requests. By default, fields with
  1558. // empty values are omitted from API requests. However, any non-pointer,
  1559. // non-interface field appearing in ForceSendFields will be sent to the
  1560. // server regardless of whether the field is empty or not. This may be
  1561. // used to include empty fields in Patch requests.
  1562. ForceSendFields []string `json:"-"`
  1563. // NullFields is a list of field names (e.g. "Default") to include in
  1564. // API requests with the JSON null value. By default, fields with empty
  1565. // values are omitted from API requests. However, any field with an
  1566. // empty value appearing in NullFields will be sent to the server as
  1567. // null. It is an error if a field in this list has a non-empty value.
  1568. // This may be used to include null fields in Patch requests.
  1569. NullFields []string `json:"-"`
  1570. }
  1571. func (s *Photo) MarshalJSON() ([]byte, error) {
  1572. type NoMethod Photo
  1573. raw := NoMethod(*s)
  1574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1575. }
  1576. // ProfileMetadata: The read-only metadata about a profile.
  1577. type ProfileMetadata struct {
  1578. // ObjectType: The profile object type.
  1579. //
  1580. // Possible values:
  1581. // "OBJECT_TYPE_UNSPECIFIED" - Unspecified.
  1582. // "PERSON" - Person.
  1583. // "PAGE" - [Google+ Page.](http://www.google.com/+/brands/)
  1584. ObjectType string `json:"objectType,omitempty"`
  1585. // UserTypes: The user types.
  1586. //
  1587. // Possible values:
  1588. // "USER_TYPE_UNKNOWN" - The user type is not known.
  1589. // "GOOGLE_USER" - The user is a Google user.
  1590. // "GPLUS_USER" - The user is a Google+ user.
  1591. // "GOOGLE_APPS_USER" - The user is a Google Apps for Work user.
  1592. UserTypes []string `json:"userTypes,omitempty"`
  1593. // ForceSendFields is a list of field names (e.g. "ObjectType") to
  1594. // unconditionally include in API requests. By default, fields with
  1595. // empty values are omitted from API requests. However, any non-pointer,
  1596. // non-interface field appearing in ForceSendFields will be sent to the
  1597. // server regardless of whether the field is empty or not. This may be
  1598. // used to include empty fields in Patch requests.
  1599. ForceSendFields []string `json:"-"`
  1600. // NullFields is a list of field names (e.g. "ObjectType") to include in
  1601. // API requests with the JSON null value. By default, fields with empty
  1602. // values are omitted from API requests. However, any field with an
  1603. // empty value appearing in NullFields will be sent to the server as
  1604. // null. It is an error if a field in this list has a non-empty value.
  1605. // This may be used to include null fields in Patch requests.
  1606. NullFields []string `json:"-"`
  1607. }
  1608. func (s *ProfileMetadata) MarshalJSON() ([]byte, error) {
  1609. type NoMethod ProfileMetadata
  1610. raw := NoMethod(*s)
  1611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1612. }
  1613. // Relation: A person's relation to another person.
  1614. type Relation struct {
  1615. // FormattedType: The type of the relation translated and formatted in
  1616. // the viewer's account
  1617. // locale or the locale specified in the Accept-Language HTTP header.
  1618. FormattedType string `json:"formattedType,omitempty"`
  1619. // Metadata: Metadata about the relation.
  1620. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1621. // Person: The name of the other person this relation refers to.
  1622. Person string `json:"person,omitempty"`
  1623. // Type: The person's relation to the other person. The type can be
  1624. // custom or one of
  1625. // these predefined values:
  1626. //
  1627. // * `spouse`
  1628. // * `child`
  1629. // * `mother`
  1630. // * `father`
  1631. // * `parent`
  1632. // * `brother`
  1633. // * `sister`
  1634. // * `friend`
  1635. // * `relative`
  1636. // * `domesticPartner`
  1637. // * `manager`
  1638. // * `assistant`
  1639. // * `referredBy`
  1640. // * `partner`
  1641. Type string `json:"type,omitempty"`
  1642. // ForceSendFields is a list of field names (e.g. "FormattedType") to
  1643. // unconditionally include in API requests. By default, fields with
  1644. // empty values are omitted from API requests. However, any non-pointer,
  1645. // non-interface field appearing in ForceSendFields will be sent to the
  1646. // server regardless of whether the field is empty or not. This may be
  1647. // used to include empty fields in Patch requests.
  1648. ForceSendFields []string `json:"-"`
  1649. // NullFields is a list of field names (e.g. "FormattedType") to include
  1650. // in API requests with the JSON null value. By default, fields with
  1651. // empty values are omitted from API requests. However, any field with
  1652. // an empty value appearing in NullFields will be sent to the server as
  1653. // null. It is an error if a field in this list has a non-empty value.
  1654. // This may be used to include null fields in Patch requests.
  1655. NullFields []string `json:"-"`
  1656. }
  1657. func (s *Relation) MarshalJSON() ([]byte, error) {
  1658. type NoMethod Relation
  1659. raw := NoMethod(*s)
  1660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1661. }
  1662. // RelationshipInterest: A person's read-only relationship interest .
  1663. type RelationshipInterest struct {
  1664. // FormattedValue: The value of the relationship interest translated and
  1665. // formatted in the
  1666. // viewer's account locale or the locale specified in the
  1667. // Accept-Language
  1668. // HTTP header.
  1669. FormattedValue string `json:"formattedValue,omitempty"`
  1670. // Metadata: Metadata about the relationship interest.
  1671. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1672. // Value: The kind of relationship the person is looking for. The value
  1673. // can be custom
  1674. // or one of these predefined values:
  1675. //
  1676. // * `friend`
  1677. // * `date`
  1678. // * `relationship`
  1679. // * `networking`
  1680. Value string `json:"value,omitempty"`
  1681. // ForceSendFields is a list of field names (e.g. "FormattedValue") to
  1682. // unconditionally include in API requests. By default, fields with
  1683. // empty values are omitted from API requests. However, any non-pointer,
  1684. // non-interface field appearing in ForceSendFields will be sent to the
  1685. // server regardless of whether the field is empty or not. This may be
  1686. // used to include empty fields in Patch requests.
  1687. ForceSendFields []string `json:"-"`
  1688. // NullFields is a list of field names (e.g. "FormattedValue") to
  1689. // include in API requests with the JSON null value. By default, fields
  1690. // with empty values are omitted from API requests. However, any field
  1691. // with an empty value appearing in NullFields will be sent to the
  1692. // server as null. It is an error if a field in this list has a
  1693. // non-empty value. This may be used to include null fields in Patch
  1694. // requests.
  1695. NullFields []string `json:"-"`
  1696. }
  1697. func (s *RelationshipInterest) MarshalJSON() ([]byte, error) {
  1698. type NoMethod RelationshipInterest
  1699. raw := NoMethod(*s)
  1700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1701. }
  1702. // RelationshipStatus: A person's read-only relationship status.
  1703. type RelationshipStatus struct {
  1704. // FormattedValue: The read-only value of the relationship status
  1705. // translated and formatted in
  1706. // the viewer's account locale or the `Accept-Language` HTTP header
  1707. // locale.
  1708. FormattedValue string `json:"formattedValue,omitempty"`
  1709. // Metadata: Metadata about the relationship status.
  1710. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1711. // Value: The relationship status. The value can be custom or one of
  1712. // these
  1713. // predefined values:
  1714. //
  1715. // * `single`
  1716. // * `inARelationship`
  1717. // * `engaged`
  1718. // * `married`
  1719. // * `itsComplicated`
  1720. // * `openRelationship`
  1721. // * `widowed`
  1722. // * `inDomesticPartnership`
  1723. // * `inCivilUnion`
  1724. Value string `json:"value,omitempty"`
  1725. // ForceSendFields is a list of field names (e.g. "FormattedValue") to
  1726. // unconditionally include in API requests. By default, fields with
  1727. // empty values are omitted from API requests. However, any non-pointer,
  1728. // non-interface field appearing in ForceSendFields will be sent to the
  1729. // server regardless of whether the field is empty or not. This may be
  1730. // used to include empty fields in Patch requests.
  1731. ForceSendFields []string `json:"-"`
  1732. // NullFields is a list of field names (e.g. "FormattedValue") to
  1733. // include in API requests with the JSON null value. By default, fields
  1734. // with empty values are omitted from API requests. However, any field
  1735. // with an empty value appearing in NullFields will be sent to the
  1736. // server as null. It is an error if a field in this list has a
  1737. // non-empty value. This may be used to include null fields in Patch
  1738. // requests.
  1739. NullFields []string `json:"-"`
  1740. }
  1741. func (s *RelationshipStatus) MarshalJSON() ([]byte, error) {
  1742. type NoMethod RelationshipStatus
  1743. raw := NoMethod(*s)
  1744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1745. }
  1746. // Residence: A person's past or current residence.
  1747. type Residence struct {
  1748. // Current: True if the residence is the person's current
  1749. // residence;
  1750. // false if the residence is a past residence.
  1751. Current bool `json:"current,omitempty"`
  1752. // Metadata: Metadata about the residence.
  1753. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1754. // Value: The address of the residence.
  1755. Value string `json:"value,omitempty"`
  1756. // ForceSendFields is a list of field names (e.g. "Current") to
  1757. // unconditionally include in API requests. By default, fields with
  1758. // empty values are omitted from API requests. However, any non-pointer,
  1759. // non-interface field appearing in ForceSendFields will be sent to the
  1760. // server regardless of whether the field is empty or not. This may be
  1761. // used to include empty fields in Patch requests.
  1762. ForceSendFields []string `json:"-"`
  1763. // NullFields is a list of field names (e.g. "Current") to include in
  1764. // API requests with the JSON null value. By default, fields with empty
  1765. // values are omitted from API requests. However, any field with an
  1766. // empty value appearing in NullFields will be sent to the server as
  1767. // null. It is an error if a field in this list has a non-empty value.
  1768. // This may be used to include null fields in Patch requests.
  1769. NullFields []string `json:"-"`
  1770. }
  1771. func (s *Residence) MarshalJSON() ([]byte, error) {
  1772. type NoMethod Residence
  1773. raw := NoMethod(*s)
  1774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1775. }
  1776. // SipAddress: A person's SIP address. Session Initial Protocol
  1777. // addresses are used for VoIP
  1778. // communications to make voice or video calls over the internet.
  1779. type SipAddress struct {
  1780. // FormattedType: The read-only type of the SIP address translated and
  1781. // formatted in the
  1782. // viewer's account locale or the `Accept-Language` HTTP header locale.
  1783. FormattedType string `json:"formattedType,omitempty"`
  1784. // Metadata: Metadata about the SIP address.
  1785. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1786. // Type: The type of the SIP address. The type can be custom or or one
  1787. // of these
  1788. // predefined values:
  1789. //
  1790. // * `home`
  1791. // * `work`
  1792. // * `mobile`
  1793. // * `other`
  1794. Type string `json:"type,omitempty"`
  1795. // Value: The SIP address in the
  1796. // [RFC 3261 19.1](https://tools.ietf.org/html/rfc3261#section-19.1) SIP
  1797. // URI
  1798. // format.
  1799. Value string `json:"value,omitempty"`
  1800. // ForceSendFields is a list of field names (e.g. "FormattedType") to
  1801. // unconditionally include in API requests. By default, fields with
  1802. // empty values are omitted from API requests. However, any non-pointer,
  1803. // non-interface field appearing in ForceSendFields will be sent to the
  1804. // server regardless of whether the field is empty or not. This may be
  1805. // used to include empty fields in Patch requests.
  1806. ForceSendFields []string `json:"-"`
  1807. // NullFields is a list of field names (e.g. "FormattedType") to include
  1808. // in API requests with the JSON null value. By default, fields with
  1809. // empty values are omitted from API requests. However, any field with
  1810. // an empty value appearing in NullFields will be sent to the server as
  1811. // null. It is an error if a field in this list has a non-empty value.
  1812. // This may be used to include null fields in Patch requests.
  1813. NullFields []string `json:"-"`
  1814. }
  1815. func (s *SipAddress) MarshalJSON() ([]byte, error) {
  1816. type NoMethod SipAddress
  1817. raw := NoMethod(*s)
  1818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1819. }
  1820. // Skill: A skill that the person has.
  1821. type Skill struct {
  1822. // Metadata: Metadata about the skill.
  1823. Metadata *FieldMetadata `json:"metadata,omitempty"`
  1824. // Value: The skill; for example, `underwater basket weaving`.
  1825. Value string `json:"value,omitempty"`
  1826. // ForceSendFields is a list of field names (e.g. "Metadata") to
  1827. // unconditionally include in API requests. By default, fields with
  1828. // empty values are omitted from API requests. However, any non-pointer,
  1829. // non-interface field appearing in ForceSendFields will be sent to the
  1830. // server regardless of whether the field is empty or not. This may be
  1831. // used to include empty fields in Patch requests.
  1832. ForceSendFields []string `json:"-"`
  1833. // NullFields is a list of field names (e.g. "Metadata") to include in
  1834. // API requests with the JSON null value. By default, fields with empty
  1835. // values are omitted from API requests. However, any field with an
  1836. // empty value appearing in NullFields will be sent to the server as
  1837. // null. It is an error if a field in this list has a non-empty value.
  1838. // This may be used to include null fields in Patch requests.
  1839. NullFields []string `json:"-"`
  1840. }
  1841. func (s *Skill) MarshalJSON() ([]byte, error) {
  1842. type NoMethod Skill
  1843. raw := NoMethod(*s)
  1844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1845. }
  1846. // Source: The source of a field.
  1847. type Source struct {
  1848. // Etag: **Only populated in `person.metadata.sources`.**
  1849. //
  1850. // The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of
  1851. // the
  1852. // source. Used for web cache validation.
  1853. Etag string `json:"etag,omitempty"`
  1854. // Id: The unique identifier within the source type generated by the
  1855. // server.
  1856. Id string `json:"id,omitempty"`
  1857. // ProfileMetadata: **Only populated in
  1858. // `person.metadata.sources`.**
  1859. //
  1860. // Metadata about a source of type PROFILE.
  1861. ProfileMetadata *ProfileMetadata `json:"profileMetadata,omitempty"`
  1862. // Type: The source type.
  1863. //
  1864. // Possible values:
  1865. // "SOURCE_TYPE_UNSPECIFIED" - Unspecified.
  1866. // "ACCOUNT" - [Google Account](https://accounts.google.com).
  1867. // "PROFILE" - [Google profile](https://profiles.google.com). You can
  1868. // view the
  1869. // profile at https://profiles.google.com/<var>id</var>
  1870. // where
  1871. // <var>id</var> is the source id.
  1872. // "DOMAIN_PROFILE" - [Google Apps domain
  1873. // profile](https://admin.google.com).
  1874. // "CONTACT" - [Google contact](https://contacts.google.com). You can
  1875. // view the
  1876. // contact at https://contact.google.com/<var>id</var> where
  1877. // <var>id</var>
  1878. // is the source id.
  1879. Type string `json:"type,omitempty"`
  1880. // UpdateTime: **Only populated in `person.metadata.sources`.**
  1881. //
  1882. // Last update timestamp of this source.
  1883. UpdateTime string `json:"updateTime,omitempty"`
  1884. // ForceSendFields is a list of field names (e.g. "Etag") to
  1885. // unconditionally include in API requests. By default, fields with
  1886. // empty values are omitted from API requests. However, any non-pointer,
  1887. // non-interface field appearing in ForceSendFields will be sent to the
  1888. // server regardless of whether the field is empty or not. This may be
  1889. // used to include empty fields in Patch requests.
  1890. ForceSendFields []string `json:"-"`
  1891. // NullFields is a list of field names (e.g. "Etag") to include in API
  1892. // requests with the JSON null value. By default, fields with empty
  1893. // values are omitted from API requests. However, any field with an
  1894. // empty value appearing in NullFields will be sent to the server as
  1895. // null. It is an error if a field in this list has a non-empty value.
  1896. // This may be used to include null fields in Patch requests.
  1897. NullFields []string `json:"-"`
  1898. }
  1899. func (s *Source) MarshalJSON() ([]byte, error) {
  1900. type NoMethod Source
  1901. raw := NoMethod(*s)
  1902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1903. }
  1904. // Status: The `Status` type defines a logical error model that is
  1905. // suitable for different
  1906. // programming environments, including REST APIs and RPC APIs. It is
  1907. // used by
  1908. // [gRPC](https://github.com/grpc). The error model is designed to
  1909. // be:
  1910. //
  1911. // - Simple to use and understand for most users
  1912. // - Flexible enough to meet unexpected needs
  1913. //
  1914. // # Overview
  1915. //
  1916. // The `Status` message contains three pieces of data: error code, error
  1917. // message,
  1918. // and error details. The error code should be an enum value
  1919. // of
  1920. // google.rpc.Code, but it may accept additional error codes if needed.
  1921. // The
  1922. // error message should be a developer-facing English message that
  1923. // helps
  1924. // developers *understand* and *resolve* the error. If a localized
  1925. // user-facing
  1926. // error message is needed, put the localized message in the error
  1927. // details or
  1928. // localize it in the client. The optional error details may contain
  1929. // arbitrary
  1930. // information about the error. There is a predefined set of error
  1931. // detail types
  1932. // in the package `google.rpc` that can be used for common error
  1933. // conditions.
  1934. //
  1935. // # Language mapping
  1936. //
  1937. // The `Status` message is the logical representation of the error
  1938. // model, but it
  1939. // is not necessarily the actual wire format. When the `Status` message
  1940. // is
  1941. // exposed in different client libraries and different wire protocols,
  1942. // it can be
  1943. // mapped differently. For example, it will likely be mapped to some
  1944. // exceptions
  1945. // in Java, but more likely mapped to some error codes in C.
  1946. //
  1947. // # Other uses
  1948. //
  1949. // The error model and the `Status` message can be used in a variety
  1950. // of
  1951. // environments, either with or without APIs, to provide a
  1952. // consistent developer experience across different
  1953. // environments.
  1954. //
  1955. // Example uses of this error model include:
  1956. //
  1957. // - Partial errors. If a service needs to return partial errors to the
  1958. // client,
  1959. // it may embed the `Status` in the normal response to indicate the
  1960. // partial
  1961. // errors.
  1962. //
  1963. // - Workflow errors. A typical workflow has multiple steps. Each step
  1964. // may
  1965. // have a `Status` message for error reporting.
  1966. //
  1967. // - Batch operations. If a client uses batch request and batch
  1968. // response, the
  1969. // `Status` message should be used directly inside batch response,
  1970. // one for
  1971. // each error sub-response.
  1972. //
  1973. // - Asynchronous operations. If an API call embeds asynchronous
  1974. // operation
  1975. // results in its response, the status of those operations should
  1976. // be
  1977. // represented directly using the `Status` message.
  1978. //
  1979. // - Logging. If some API errors are stored in logs, the message
  1980. // `Status` could
  1981. // be used directly after any stripping needed for security/privacy
  1982. // reasons.
  1983. type Status struct {
  1984. // Code: The status code, which should be an enum value of
  1985. // google.rpc.Code.
  1986. Code int64 `json:"code,omitempty"`
  1987. // Details: A list of messages that carry the error details. There is a
  1988. // common set of
  1989. // message types for APIs to use.
  1990. Details []googleapi.RawMessage `json:"details,omitempty"`
  1991. // Message: A developer-facing error message, which should be in
  1992. // English. Any
  1993. // user-facing error message should be localized and sent in
  1994. // the
  1995. // google.rpc.Status.details field, or localized by the client.
  1996. Message string `json:"message,omitempty"`
  1997. // ForceSendFields is a list of field names (e.g. "Code") to
  1998. // unconditionally include in API requests. By default, fields with
  1999. // empty values are omitted from API requests. However, any non-pointer,
  2000. // non-interface field appearing in ForceSendFields will be sent to the
  2001. // server regardless of whether the field is empty or not. This may be
  2002. // used to include empty fields in Patch requests.
  2003. ForceSendFields []string `json:"-"`
  2004. // NullFields is a list of field names (e.g. "Code") to include in API
  2005. // requests with the JSON null value. By default, fields with empty
  2006. // values are omitted from API requests. However, any field with an
  2007. // empty value appearing in NullFields will be sent to the server as
  2008. // null. It is an error if a field in this list has a non-empty value.
  2009. // This may be used to include null fields in Patch requests.
  2010. NullFields []string `json:"-"`
  2011. }
  2012. func (s *Status) MarshalJSON() ([]byte, error) {
  2013. type NoMethod Status
  2014. raw := NoMethod(*s)
  2015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2016. }
  2017. // Tagline: A read-only brief one-line description of the person.
  2018. type Tagline struct {
  2019. // Metadata: Metadata about the tagline.
  2020. Metadata *FieldMetadata `json:"metadata,omitempty"`
  2021. // Value: The tagline.
  2022. Value string `json:"value,omitempty"`
  2023. // ForceSendFields is a list of field names (e.g. "Metadata") to
  2024. // unconditionally include in API requests. By default, fields with
  2025. // empty values are omitted from API requests. However, any non-pointer,
  2026. // non-interface field appearing in ForceSendFields will be sent to the
  2027. // server regardless of whether the field is empty or not. This may be
  2028. // used to include empty fields in Patch requests.
  2029. ForceSendFields []string `json:"-"`
  2030. // NullFields is a list of field names (e.g. "Metadata") to include in
  2031. // API requests with the JSON null value. By default, fields with empty
  2032. // values are omitted from API requests. However, any field with an
  2033. // empty value appearing in NullFields will be sent to the server as
  2034. // null. It is an error if a field in this list has a non-empty value.
  2035. // This may be used to include null fields in Patch requests.
  2036. NullFields []string `json:"-"`
  2037. }
  2038. func (s *Tagline) MarshalJSON() ([]byte, error) {
  2039. type NoMethod Tagline
  2040. raw := NoMethod(*s)
  2041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2042. }
  2043. // UpdateContactGroupRequest: A request to update an existing user
  2044. // contact group. All updated fields will
  2045. // be replaced.
  2046. type UpdateContactGroupRequest struct {
  2047. // ContactGroup: The contact group to update.
  2048. ContactGroup *ContactGroup `json:"contactGroup,omitempty"`
  2049. // ForceSendFields is a list of field names (e.g. "ContactGroup") to
  2050. // unconditionally include in API requests. By default, fields with
  2051. // empty values are omitted from API requests. However, any non-pointer,
  2052. // non-interface field appearing in ForceSendFields will be sent to the
  2053. // server regardless of whether the field is empty or not. This may be
  2054. // used to include empty fields in Patch requests.
  2055. ForceSendFields []string `json:"-"`
  2056. // NullFields is a list of field names (e.g. "ContactGroup") to include
  2057. // in API requests with the JSON null value. By default, fields with
  2058. // empty values are omitted from API requests. However, any field with
  2059. // an empty value appearing in NullFields will be sent to the server as
  2060. // null. It is an error if a field in this list has a non-empty value.
  2061. // This may be used to include null fields in Patch requests.
  2062. NullFields []string `json:"-"`
  2063. }
  2064. func (s *UpdateContactGroupRequest) MarshalJSON() ([]byte, error) {
  2065. type NoMethod UpdateContactGroupRequest
  2066. raw := NoMethod(*s)
  2067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2068. }
  2069. // Url: A person's associated URLs.
  2070. type Url struct {
  2071. // FormattedType: The read-only type of the URL translated and formatted
  2072. // in the viewer's
  2073. // account locale or the `Accept-Language` HTTP header locale.
  2074. FormattedType string `json:"formattedType,omitempty"`
  2075. // Metadata: Metadata about the URL.
  2076. Metadata *FieldMetadata `json:"metadata,omitempty"`
  2077. // Type: The type of the URL. The type can be custom or one of these
  2078. // predefined
  2079. // values:
  2080. //
  2081. // * `home`
  2082. // * `work`
  2083. // * `blog`
  2084. // * `profile`
  2085. // * `homePage`
  2086. // * `ftp`
  2087. // * `reservations`
  2088. // * `appInstallPage`: website for a Google+ application.
  2089. // * `other`
  2090. Type string `json:"type,omitempty"`
  2091. // Value: The URL.
  2092. Value string `json:"value,omitempty"`
  2093. // ForceSendFields is a list of field names (e.g. "FormattedType") to
  2094. // unconditionally include in API requests. By default, fields with
  2095. // empty values are omitted from API requests. However, any non-pointer,
  2096. // non-interface field appearing in ForceSendFields will be sent to the
  2097. // server regardless of whether the field is empty or not. This may be
  2098. // used to include empty fields in Patch requests.
  2099. ForceSendFields []string `json:"-"`
  2100. // NullFields is a list of field names (e.g. "FormattedType") to include
  2101. // in API requests with the JSON null value. By default, fields with
  2102. // empty values are omitted from API requests. However, any field with
  2103. // an empty value appearing in NullFields will be sent to the server as
  2104. // null. It is an error if a field in this list has a non-empty value.
  2105. // This may be used to include null fields in Patch requests.
  2106. NullFields []string `json:"-"`
  2107. }
  2108. func (s *Url) MarshalJSON() ([]byte, error) {
  2109. type NoMethod Url
  2110. raw := NoMethod(*s)
  2111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2112. }
  2113. // UserDefined: Arbitrary user data that is populated by the end users.
  2114. type UserDefined struct {
  2115. // Key: The end user specified key of the user defined data.
  2116. Key string `json:"key,omitempty"`
  2117. // Metadata: Metadata about the user defined data.
  2118. Metadata *FieldMetadata `json:"metadata,omitempty"`
  2119. // Value: The end user specified value of the user defined data.
  2120. Value string `json:"value,omitempty"`
  2121. // ForceSendFields is a list of field names (e.g. "Key") to
  2122. // unconditionally include in API requests. By default, fields with
  2123. // empty values are omitted from API requests. However, any non-pointer,
  2124. // non-interface field appearing in ForceSendFields will be sent to the
  2125. // server regardless of whether the field is empty or not. This may be
  2126. // used to include empty fields in Patch requests.
  2127. ForceSendFields []string `json:"-"`
  2128. // NullFields is a list of field names (e.g. "Key") to include in API
  2129. // requests with the JSON null value. By default, fields with empty
  2130. // values are omitted from API requests. However, any field with an
  2131. // empty value appearing in NullFields will be sent to the server as
  2132. // null. It is an error if a field in this list has a non-empty value.
  2133. // This may be used to include null fields in Patch requests.
  2134. NullFields []string `json:"-"`
  2135. }
  2136. func (s *UserDefined) MarshalJSON() ([]byte, error) {
  2137. type NoMethod UserDefined
  2138. raw := NoMethod(*s)
  2139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2140. }
  2141. // method id "people.contactGroups.batchGet":
  2142. type ContactGroupsBatchGetCall struct {
  2143. s *Service
  2144. urlParams_ gensupport.URLParams
  2145. ifNoneMatch_ string
  2146. ctx_ context.Context
  2147. header_ http.Header
  2148. }
  2149. // BatchGet: Get a list of contact groups owned by the authenticated
  2150. // user by specifying
  2151. // a list of contact group resource names.
  2152. func (r *ContactGroupsService) BatchGet() *ContactGroupsBatchGetCall {
  2153. c := &ContactGroupsBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2154. return c
  2155. }
  2156. // MaxMembers sets the optional parameter "maxMembers": Specifies the
  2157. // maximum number of members to return for each group.
  2158. func (c *ContactGroupsBatchGetCall) MaxMembers(maxMembers int64) *ContactGroupsBatchGetCall {
  2159. c.urlParams_.Set("maxMembers", fmt.Sprint(maxMembers))
  2160. return c
  2161. }
  2162. // ResourceNames sets the optional parameter "resourceNames": The
  2163. // resource names of the contact groups to get.
  2164. func (c *ContactGroupsBatchGetCall) ResourceNames(resourceNames ...string) *ContactGroupsBatchGetCall {
  2165. c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
  2166. return c
  2167. }
  2168. // Fields allows partial responses to be retrieved. See
  2169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2170. // for more information.
  2171. func (c *ContactGroupsBatchGetCall) Fields(s ...googleapi.Field) *ContactGroupsBatchGetCall {
  2172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2173. return c
  2174. }
  2175. // IfNoneMatch sets the optional parameter which makes the operation
  2176. // fail if the object's ETag matches the given value. This is useful for
  2177. // getting updates only after the object has changed since the last
  2178. // request. Use googleapi.IsNotModified to check whether the response
  2179. // error from Do is the result of In-None-Match.
  2180. func (c *ContactGroupsBatchGetCall) IfNoneMatch(entityTag string) *ContactGroupsBatchGetCall {
  2181. c.ifNoneMatch_ = entityTag
  2182. return c
  2183. }
  2184. // Context sets the context to be used in this call's Do method. Any
  2185. // pending HTTP request will be aborted if the provided context is
  2186. // canceled.
  2187. func (c *ContactGroupsBatchGetCall) Context(ctx context.Context) *ContactGroupsBatchGetCall {
  2188. c.ctx_ = ctx
  2189. return c
  2190. }
  2191. // Header returns an http.Header that can be modified by the caller to
  2192. // add HTTP headers to the request.
  2193. func (c *ContactGroupsBatchGetCall) Header() http.Header {
  2194. if c.header_ == nil {
  2195. c.header_ = make(http.Header)
  2196. }
  2197. return c.header_
  2198. }
  2199. func (c *ContactGroupsBatchGetCall) doRequest(alt string) (*http.Response, error) {
  2200. reqHeaders := make(http.Header)
  2201. for k, v := range c.header_ {
  2202. reqHeaders[k] = v
  2203. }
  2204. reqHeaders.Set("User-Agent", c.s.userAgent())
  2205. if c.ifNoneMatch_ != "" {
  2206. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2207. }
  2208. var body io.Reader = nil
  2209. c.urlParams_.Set("alt", alt)
  2210. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups:batchGet")
  2211. urls += "?" + c.urlParams_.Encode()
  2212. req, _ := http.NewRequest("GET", urls, body)
  2213. req.Header = reqHeaders
  2214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2215. }
  2216. // Do executes the "people.contactGroups.batchGet" call.
  2217. // Exactly one of *BatchGetContactGroupsResponse or error will be
  2218. // non-nil. Any non-2xx status code is an error. Response headers are in
  2219. // either *BatchGetContactGroupsResponse.ServerResponse.Header or (if a
  2220. // response was returned at all) in error.(*googleapi.Error).Header. Use
  2221. // googleapi.IsNotModified to check whether the returned error was
  2222. // because http.StatusNotModified was returned.
  2223. func (c *ContactGroupsBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetContactGroupsResponse, error) {
  2224. gensupport.SetOptions(c.urlParams_, opts...)
  2225. res, err := c.doRequest("json")
  2226. if res != nil && res.StatusCode == http.StatusNotModified {
  2227. if res.Body != nil {
  2228. res.Body.Close()
  2229. }
  2230. return nil, &googleapi.Error{
  2231. Code: res.StatusCode,
  2232. Header: res.Header,
  2233. }
  2234. }
  2235. if err != nil {
  2236. return nil, err
  2237. }
  2238. defer googleapi.CloseBody(res)
  2239. if err := googleapi.CheckResponse(res); err != nil {
  2240. return nil, err
  2241. }
  2242. ret := &BatchGetContactGroupsResponse{
  2243. ServerResponse: googleapi.ServerResponse{
  2244. Header: res.Header,
  2245. HTTPStatusCode: res.StatusCode,
  2246. },
  2247. }
  2248. target := &ret
  2249. if err := gensupport.DecodeResponse(target, res); err != nil {
  2250. return nil, err
  2251. }
  2252. return ret, nil
  2253. // {
  2254. // "description": "Get a list of contact groups owned by the authenticated user by specifying\na list of contact group resource names.",
  2255. // "flatPath": "v1/contactGroups:batchGet",
  2256. // "httpMethod": "GET",
  2257. // "id": "people.contactGroups.batchGet",
  2258. // "parameterOrder": [],
  2259. // "parameters": {
  2260. // "maxMembers": {
  2261. // "description": "Specifies the maximum number of members to return for each group.",
  2262. // "format": "int32",
  2263. // "location": "query",
  2264. // "type": "integer"
  2265. // },
  2266. // "resourceNames": {
  2267. // "description": "The resource names of the contact groups to get.",
  2268. // "location": "query",
  2269. // "repeated": true,
  2270. // "type": "string"
  2271. // }
  2272. // },
  2273. // "path": "v1/contactGroups:batchGet",
  2274. // "response": {
  2275. // "$ref": "BatchGetContactGroupsResponse"
  2276. // },
  2277. // "scopes": [
  2278. // "https://www.googleapis.com/auth/contacts",
  2279. // "https://www.googleapis.com/auth/contacts.readonly"
  2280. // ]
  2281. // }
  2282. }
  2283. // method id "people.contactGroups.create":
  2284. type ContactGroupsCreateCall struct {
  2285. s *Service
  2286. createcontactgrouprequest *CreateContactGroupRequest
  2287. urlParams_ gensupport.URLParams
  2288. ctx_ context.Context
  2289. header_ http.Header
  2290. }
  2291. // Create: Create a new contact group owned by the authenticated user.
  2292. func (r *ContactGroupsService) Create(createcontactgrouprequest *CreateContactGroupRequest) *ContactGroupsCreateCall {
  2293. c := &ContactGroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2294. c.createcontactgrouprequest = createcontactgrouprequest
  2295. return c
  2296. }
  2297. // Fields allows partial responses to be retrieved. See
  2298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2299. // for more information.
  2300. func (c *ContactGroupsCreateCall) Fields(s ...googleapi.Field) *ContactGroupsCreateCall {
  2301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2302. return c
  2303. }
  2304. // Context sets the context to be used in this call's Do method. Any
  2305. // pending HTTP request will be aborted if the provided context is
  2306. // canceled.
  2307. func (c *ContactGroupsCreateCall) Context(ctx context.Context) *ContactGroupsCreateCall {
  2308. c.ctx_ = ctx
  2309. return c
  2310. }
  2311. // Header returns an http.Header that can be modified by the caller to
  2312. // add HTTP headers to the request.
  2313. func (c *ContactGroupsCreateCall) Header() http.Header {
  2314. if c.header_ == nil {
  2315. c.header_ = make(http.Header)
  2316. }
  2317. return c.header_
  2318. }
  2319. func (c *ContactGroupsCreateCall) doRequest(alt string) (*http.Response, error) {
  2320. reqHeaders := make(http.Header)
  2321. for k, v := range c.header_ {
  2322. reqHeaders[k] = v
  2323. }
  2324. reqHeaders.Set("User-Agent", c.s.userAgent())
  2325. var body io.Reader = nil
  2326. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontactgrouprequest)
  2327. if err != nil {
  2328. return nil, err
  2329. }
  2330. reqHeaders.Set("Content-Type", "application/json")
  2331. c.urlParams_.Set("alt", alt)
  2332. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups")
  2333. urls += "?" + c.urlParams_.Encode()
  2334. req, _ := http.NewRequest("POST", urls, body)
  2335. req.Header = reqHeaders
  2336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2337. }
  2338. // Do executes the "people.contactGroups.create" call.
  2339. // Exactly one of *ContactGroup or error will be non-nil. Any non-2xx
  2340. // status code is an error. Response headers are in either
  2341. // *ContactGroup.ServerResponse.Header or (if a response was returned at
  2342. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2343. // to check whether the returned error was because
  2344. // http.StatusNotModified was returned.
  2345. func (c *ContactGroupsCreateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) {
  2346. gensupport.SetOptions(c.urlParams_, opts...)
  2347. res, err := c.doRequest("json")
  2348. if res != nil && res.StatusCode == http.StatusNotModified {
  2349. if res.Body != nil {
  2350. res.Body.Close()
  2351. }
  2352. return nil, &googleapi.Error{
  2353. Code: res.StatusCode,
  2354. Header: res.Header,
  2355. }
  2356. }
  2357. if err != nil {
  2358. return nil, err
  2359. }
  2360. defer googleapi.CloseBody(res)
  2361. if err := googleapi.CheckResponse(res); err != nil {
  2362. return nil, err
  2363. }
  2364. ret := &ContactGroup{
  2365. ServerResponse: googleapi.ServerResponse{
  2366. Header: res.Header,
  2367. HTTPStatusCode: res.StatusCode,
  2368. },
  2369. }
  2370. target := &ret
  2371. if err := gensupport.DecodeResponse(target, res); err != nil {
  2372. return nil, err
  2373. }
  2374. return ret, nil
  2375. // {
  2376. // "description": "Create a new contact group owned by the authenticated user.",
  2377. // "flatPath": "v1/contactGroups",
  2378. // "httpMethod": "POST",
  2379. // "id": "people.contactGroups.create",
  2380. // "parameterOrder": [],
  2381. // "parameters": {},
  2382. // "path": "v1/contactGroups",
  2383. // "request": {
  2384. // "$ref": "CreateContactGroupRequest"
  2385. // },
  2386. // "response": {
  2387. // "$ref": "ContactGroup"
  2388. // },
  2389. // "scopes": [
  2390. // "https://www.googleapis.com/auth/contacts"
  2391. // ]
  2392. // }
  2393. }
  2394. // method id "people.contactGroups.delete":
  2395. type ContactGroupsDeleteCall struct {
  2396. s *Service
  2397. resourceName string
  2398. urlParams_ gensupport.URLParams
  2399. ctx_ context.Context
  2400. header_ http.Header
  2401. }
  2402. // Delete: Delete an existing contact group owned by the authenticated
  2403. // user by
  2404. // specifying a contact group resource name.
  2405. func (r *ContactGroupsService) Delete(resourceName string) *ContactGroupsDeleteCall {
  2406. c := &ContactGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2407. c.resourceName = resourceName
  2408. return c
  2409. }
  2410. // DeleteContacts sets the optional parameter "deleteContacts": Set to
  2411. // true to also delete the contacts in the specified group.
  2412. func (c *ContactGroupsDeleteCall) DeleteContacts(deleteContacts bool) *ContactGroupsDeleteCall {
  2413. c.urlParams_.Set("deleteContacts", fmt.Sprint(deleteContacts))
  2414. return c
  2415. }
  2416. // Fields allows partial responses to be retrieved. See
  2417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2418. // for more information.
  2419. func (c *ContactGroupsDeleteCall) Fields(s ...googleapi.Field) *ContactGroupsDeleteCall {
  2420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2421. return c
  2422. }
  2423. // Context sets the context to be used in this call's Do method. Any
  2424. // pending HTTP request will be aborted if the provided context is
  2425. // canceled.
  2426. func (c *ContactGroupsDeleteCall) Context(ctx context.Context) *ContactGroupsDeleteCall {
  2427. c.ctx_ = ctx
  2428. return c
  2429. }
  2430. // Header returns an http.Header that can be modified by the caller to
  2431. // add HTTP headers to the request.
  2432. func (c *ContactGroupsDeleteCall) Header() http.Header {
  2433. if c.header_ == nil {
  2434. c.header_ = make(http.Header)
  2435. }
  2436. return c.header_
  2437. }
  2438. func (c *ContactGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2439. reqHeaders := make(http.Header)
  2440. for k, v := range c.header_ {
  2441. reqHeaders[k] = v
  2442. }
  2443. reqHeaders.Set("User-Agent", c.s.userAgent())
  2444. var body io.Reader = nil
  2445. c.urlParams_.Set("alt", alt)
  2446. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
  2447. urls += "?" + c.urlParams_.Encode()
  2448. req, _ := http.NewRequest("DELETE", urls, body)
  2449. req.Header = reqHeaders
  2450. googleapi.Expand(req.URL, map[string]string{
  2451. "resourceName": c.resourceName,
  2452. })
  2453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2454. }
  2455. // Do executes the "people.contactGroups.delete" call.
  2456. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2457. // code is an error. Response headers are in either
  2458. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2459. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2460. // check whether the returned error was because http.StatusNotModified
  2461. // was returned.
  2462. func (c *ContactGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2463. gensupport.SetOptions(c.urlParams_, opts...)
  2464. res, err := c.doRequest("json")
  2465. if res != nil && res.StatusCode == http.StatusNotModified {
  2466. if res.Body != nil {
  2467. res.Body.Close()
  2468. }
  2469. return nil, &googleapi.Error{
  2470. Code: res.StatusCode,
  2471. Header: res.Header,
  2472. }
  2473. }
  2474. if err != nil {
  2475. return nil, err
  2476. }
  2477. defer googleapi.CloseBody(res)
  2478. if err := googleapi.CheckResponse(res); err != nil {
  2479. return nil, err
  2480. }
  2481. ret := &Empty{
  2482. ServerResponse: googleapi.ServerResponse{
  2483. Header: res.Header,
  2484. HTTPStatusCode: res.StatusCode,
  2485. },
  2486. }
  2487. target := &ret
  2488. if err := gensupport.DecodeResponse(target, res); err != nil {
  2489. return nil, err
  2490. }
  2491. return ret, nil
  2492. // {
  2493. // "description": "Delete an existing contact group owned by the authenticated user by\nspecifying a contact group resource name.",
  2494. // "flatPath": "v1/contactGroups/{contactGroupsId}",
  2495. // "httpMethod": "DELETE",
  2496. // "id": "people.contactGroups.delete",
  2497. // "parameterOrder": [
  2498. // "resourceName"
  2499. // ],
  2500. // "parameters": {
  2501. // "deleteContacts": {
  2502. // "description": "Set to true to also delete the contacts in the specified group.",
  2503. // "location": "query",
  2504. // "type": "boolean"
  2505. // },
  2506. // "resourceName": {
  2507. // "description": "The resource name of the contact group to delete.",
  2508. // "location": "path",
  2509. // "pattern": "^contactGroups/[^/]+$",
  2510. // "required": true,
  2511. // "type": "string"
  2512. // }
  2513. // },
  2514. // "path": "v1/{+resourceName}",
  2515. // "response": {
  2516. // "$ref": "Empty"
  2517. // },
  2518. // "scopes": [
  2519. // "https://www.googleapis.com/auth/contacts"
  2520. // ]
  2521. // }
  2522. }
  2523. // method id "people.contactGroups.get":
  2524. type ContactGroupsGetCall struct {
  2525. s *Service
  2526. resourceName string
  2527. urlParams_ gensupport.URLParams
  2528. ifNoneMatch_ string
  2529. ctx_ context.Context
  2530. header_ http.Header
  2531. }
  2532. // Get: Get a specific contact group owned by the authenticated user by
  2533. // specifying
  2534. // a contact group resource name.
  2535. func (r *ContactGroupsService) Get(resourceName string) *ContactGroupsGetCall {
  2536. c := &ContactGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2537. c.resourceName = resourceName
  2538. return c
  2539. }
  2540. // MaxMembers sets the optional parameter "maxMembers": Specifies the
  2541. // maximum number of members to return.
  2542. func (c *ContactGroupsGetCall) MaxMembers(maxMembers int64) *ContactGroupsGetCall {
  2543. c.urlParams_.Set("maxMembers", fmt.Sprint(maxMembers))
  2544. return c
  2545. }
  2546. // Fields allows partial responses to be retrieved. See
  2547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2548. // for more information.
  2549. func (c *ContactGroupsGetCall) Fields(s ...googleapi.Field) *ContactGroupsGetCall {
  2550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2551. return c
  2552. }
  2553. // IfNoneMatch sets the optional parameter which makes the operation
  2554. // fail if the object's ETag matches the given value. This is useful for
  2555. // getting updates only after the object has changed since the last
  2556. // request. Use googleapi.IsNotModified to check whether the response
  2557. // error from Do is the result of In-None-Match.
  2558. func (c *ContactGroupsGetCall) IfNoneMatch(entityTag string) *ContactGroupsGetCall {
  2559. c.ifNoneMatch_ = entityTag
  2560. return c
  2561. }
  2562. // Context sets the context to be used in this call's Do method. Any
  2563. // pending HTTP request will be aborted if the provided context is
  2564. // canceled.
  2565. func (c *ContactGroupsGetCall) Context(ctx context.Context) *ContactGroupsGetCall {
  2566. c.ctx_ = ctx
  2567. return c
  2568. }
  2569. // Header returns an http.Header that can be modified by the caller to
  2570. // add HTTP headers to the request.
  2571. func (c *ContactGroupsGetCall) Header() http.Header {
  2572. if c.header_ == nil {
  2573. c.header_ = make(http.Header)
  2574. }
  2575. return c.header_
  2576. }
  2577. func (c *ContactGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  2578. reqHeaders := make(http.Header)
  2579. for k, v := range c.header_ {
  2580. reqHeaders[k] = v
  2581. }
  2582. reqHeaders.Set("User-Agent", c.s.userAgent())
  2583. if c.ifNoneMatch_ != "" {
  2584. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2585. }
  2586. var body io.Reader = nil
  2587. c.urlParams_.Set("alt", alt)
  2588. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
  2589. urls += "?" + c.urlParams_.Encode()
  2590. req, _ := http.NewRequest("GET", urls, body)
  2591. req.Header = reqHeaders
  2592. googleapi.Expand(req.URL, map[string]string{
  2593. "resourceName": c.resourceName,
  2594. })
  2595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2596. }
  2597. // Do executes the "people.contactGroups.get" call.
  2598. // Exactly one of *ContactGroup or error will be non-nil. Any non-2xx
  2599. // status code is an error. Response headers are in either
  2600. // *ContactGroup.ServerResponse.Header or (if a response was returned at
  2601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2602. // to check whether the returned error was because
  2603. // http.StatusNotModified was returned.
  2604. func (c *ContactGroupsGetCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) {
  2605. gensupport.SetOptions(c.urlParams_, opts...)
  2606. res, err := c.doRequest("json")
  2607. if res != nil && res.StatusCode == http.StatusNotModified {
  2608. if res.Body != nil {
  2609. res.Body.Close()
  2610. }
  2611. return nil, &googleapi.Error{
  2612. Code: res.StatusCode,
  2613. Header: res.Header,
  2614. }
  2615. }
  2616. if err != nil {
  2617. return nil, err
  2618. }
  2619. defer googleapi.CloseBody(res)
  2620. if err := googleapi.CheckResponse(res); err != nil {
  2621. return nil, err
  2622. }
  2623. ret := &ContactGroup{
  2624. ServerResponse: googleapi.ServerResponse{
  2625. Header: res.Header,
  2626. HTTPStatusCode: res.StatusCode,
  2627. },
  2628. }
  2629. target := &ret
  2630. if err := gensupport.DecodeResponse(target, res); err != nil {
  2631. return nil, err
  2632. }
  2633. return ret, nil
  2634. // {
  2635. // "description": "Get a specific contact group owned by the authenticated user by specifying\na contact group resource name.",
  2636. // "flatPath": "v1/contactGroups/{contactGroupsId}",
  2637. // "httpMethod": "GET",
  2638. // "id": "people.contactGroups.get",
  2639. // "parameterOrder": [
  2640. // "resourceName"
  2641. // ],
  2642. // "parameters": {
  2643. // "maxMembers": {
  2644. // "description": "Specifies the maximum number of members to return.",
  2645. // "format": "int32",
  2646. // "location": "query",
  2647. // "type": "integer"
  2648. // },
  2649. // "resourceName": {
  2650. // "description": "The resource name of the contact group to get.",
  2651. // "location": "path",
  2652. // "pattern": "^contactGroups/[^/]+$",
  2653. // "required": true,
  2654. // "type": "string"
  2655. // }
  2656. // },
  2657. // "path": "v1/{+resourceName}",
  2658. // "response": {
  2659. // "$ref": "ContactGroup"
  2660. // },
  2661. // "scopes": [
  2662. // "https://www.googleapis.com/auth/contacts",
  2663. // "https://www.googleapis.com/auth/contacts.readonly"
  2664. // ]
  2665. // }
  2666. }
  2667. // method id "people.contactGroups.list":
  2668. type ContactGroupsListCall struct {
  2669. s *Service
  2670. urlParams_ gensupport.URLParams
  2671. ifNoneMatch_ string
  2672. ctx_ context.Context
  2673. header_ http.Header
  2674. }
  2675. // List: List all contact groups owned by the authenticated user.
  2676. // Members of the
  2677. // contact groups are not populated.
  2678. func (r *ContactGroupsService) List() *ContactGroupsListCall {
  2679. c := &ContactGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2680. return c
  2681. }
  2682. // PageSize sets the optional parameter "pageSize": The maximum number
  2683. // of resources to return.
  2684. func (c *ContactGroupsListCall) PageSize(pageSize int64) *ContactGroupsListCall {
  2685. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2686. return c
  2687. }
  2688. // PageToken sets the optional parameter "pageToken": The
  2689. // next_page_token value returned from a previous call
  2690. // to
  2691. // [ListContactGroups](/people/api/rest/v1/contactgroups/list).
  2692. // Reques
  2693. // ts the next page of resources.
  2694. func (c *ContactGroupsListCall) PageToken(pageToken string) *ContactGroupsListCall {
  2695. c.urlParams_.Set("pageToken", pageToken)
  2696. return c
  2697. }
  2698. // SyncToken sets the optional parameter "syncToken": A sync token,
  2699. // returned by a previous call to `contactgroups.list`.
  2700. // Only resources changed since the sync token was created will be
  2701. // returned.
  2702. func (c *ContactGroupsListCall) SyncToken(syncToken string) *ContactGroupsListCall {
  2703. c.urlParams_.Set("syncToken", syncToken)
  2704. return c
  2705. }
  2706. // Fields allows partial responses to be retrieved. See
  2707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2708. // for more information.
  2709. func (c *ContactGroupsListCall) Fields(s ...googleapi.Field) *ContactGroupsListCall {
  2710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2711. return c
  2712. }
  2713. // IfNoneMatch sets the optional parameter which makes the operation
  2714. // fail if the object's ETag matches the given value. This is useful for
  2715. // getting updates only after the object has changed since the last
  2716. // request. Use googleapi.IsNotModified to check whether the response
  2717. // error from Do is the result of In-None-Match.
  2718. func (c *ContactGroupsListCall) IfNoneMatch(entityTag string) *ContactGroupsListCall {
  2719. c.ifNoneMatch_ = entityTag
  2720. return c
  2721. }
  2722. // Context sets the context to be used in this call's Do method. Any
  2723. // pending HTTP request will be aborted if the provided context is
  2724. // canceled.
  2725. func (c *ContactGroupsListCall) Context(ctx context.Context) *ContactGroupsListCall {
  2726. c.ctx_ = ctx
  2727. return c
  2728. }
  2729. // Header returns an http.Header that can be modified by the caller to
  2730. // add HTTP headers to the request.
  2731. func (c *ContactGroupsListCall) Header() http.Header {
  2732. if c.header_ == nil {
  2733. c.header_ = make(http.Header)
  2734. }
  2735. return c.header_
  2736. }
  2737. func (c *ContactGroupsListCall) doRequest(alt string) (*http.Response, error) {
  2738. reqHeaders := make(http.Header)
  2739. for k, v := range c.header_ {
  2740. reqHeaders[k] = v
  2741. }
  2742. reqHeaders.Set("User-Agent", c.s.userAgent())
  2743. if c.ifNoneMatch_ != "" {
  2744. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2745. }
  2746. var body io.Reader = nil
  2747. c.urlParams_.Set("alt", alt)
  2748. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/contactGroups")
  2749. urls += "?" + c.urlParams_.Encode()
  2750. req, _ := http.NewRequest("GET", urls, body)
  2751. req.Header = reqHeaders
  2752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2753. }
  2754. // Do executes the "people.contactGroups.list" call.
  2755. // Exactly one of *ListContactGroupsResponse or error will be non-nil.
  2756. // Any non-2xx status code is an error. Response headers are in either
  2757. // *ListContactGroupsResponse.ServerResponse.Header or (if a response
  2758. // was returned at all) in error.(*googleapi.Error).Header. Use
  2759. // googleapi.IsNotModified to check whether the returned error was
  2760. // because http.StatusNotModified was returned.
  2761. func (c *ContactGroupsListCall) Do(opts ...googleapi.CallOption) (*ListContactGroupsResponse, error) {
  2762. gensupport.SetOptions(c.urlParams_, opts...)
  2763. res, err := c.doRequest("json")
  2764. if res != nil && res.StatusCode == http.StatusNotModified {
  2765. if res.Body != nil {
  2766. res.Body.Close()
  2767. }
  2768. return nil, &googleapi.Error{
  2769. Code: res.StatusCode,
  2770. Header: res.Header,
  2771. }
  2772. }
  2773. if err != nil {
  2774. return nil, err
  2775. }
  2776. defer googleapi.CloseBody(res)
  2777. if err := googleapi.CheckResponse(res); err != nil {
  2778. return nil, err
  2779. }
  2780. ret := &ListContactGroupsResponse{
  2781. ServerResponse: googleapi.ServerResponse{
  2782. Header: res.Header,
  2783. HTTPStatusCode: res.StatusCode,
  2784. },
  2785. }
  2786. target := &ret
  2787. if err := gensupport.DecodeResponse(target, res); err != nil {
  2788. return nil, err
  2789. }
  2790. return ret, nil
  2791. // {
  2792. // "description": "List all contact groups owned by the authenticated user. Members of the\ncontact groups are not populated.",
  2793. // "flatPath": "v1/contactGroups",
  2794. // "httpMethod": "GET",
  2795. // "id": "people.contactGroups.list",
  2796. // "parameterOrder": [],
  2797. // "parameters": {
  2798. // "pageSize": {
  2799. // "description": "The maximum number of resources to return.",
  2800. // "format": "int32",
  2801. // "location": "query",
  2802. // "type": "integer"
  2803. // },
  2804. // "pageToken": {
  2805. // "description": "The next_page_token value returned from a previous call to\n[ListContactGroups](/people/api/rest/v1/contactgroups/list).\nRequests the next page of resources.",
  2806. // "location": "query",
  2807. // "type": "string"
  2808. // },
  2809. // "syncToken": {
  2810. // "description": "A sync token, returned by a previous call to `contactgroups.list`.\nOnly resources changed since the sync token was created will be returned.",
  2811. // "location": "query",
  2812. // "type": "string"
  2813. // }
  2814. // },
  2815. // "path": "v1/contactGroups",
  2816. // "response": {
  2817. // "$ref": "ListContactGroupsResponse"
  2818. // },
  2819. // "scopes": [
  2820. // "https://www.googleapis.com/auth/contacts",
  2821. // "https://www.googleapis.com/auth/contacts.readonly"
  2822. // ]
  2823. // }
  2824. }
  2825. // Pages invokes f for each page of results.
  2826. // A non-nil error returned from f will halt the iteration.
  2827. // The provided context supersedes any context provided to the Context method.
  2828. func (c *ContactGroupsListCall) Pages(ctx context.Context, f func(*ListContactGroupsResponse) error) error {
  2829. c.ctx_ = ctx
  2830. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2831. for {
  2832. x, err := c.Do()
  2833. if err != nil {
  2834. return err
  2835. }
  2836. if err := f(x); err != nil {
  2837. return err
  2838. }
  2839. if x.NextPageToken == "" {
  2840. return nil
  2841. }
  2842. c.PageToken(x.NextPageToken)
  2843. }
  2844. }
  2845. // method id "people.contactGroups.update":
  2846. type ContactGroupsUpdateCall struct {
  2847. s *Service
  2848. resourceName string
  2849. updatecontactgrouprequest *UpdateContactGroupRequest
  2850. urlParams_ gensupport.URLParams
  2851. ctx_ context.Context
  2852. header_ http.Header
  2853. }
  2854. // Update: Update the name of an existing contact group owned by the
  2855. // authenticated
  2856. // user.
  2857. func (r *ContactGroupsService) Update(resourceName string, updatecontactgrouprequest *UpdateContactGroupRequest) *ContactGroupsUpdateCall {
  2858. c := &ContactGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2859. c.resourceName = resourceName
  2860. c.updatecontactgrouprequest = updatecontactgrouprequest
  2861. return c
  2862. }
  2863. // Fields allows partial responses to be retrieved. See
  2864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2865. // for more information.
  2866. func (c *ContactGroupsUpdateCall) Fields(s ...googleapi.Field) *ContactGroupsUpdateCall {
  2867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2868. return c
  2869. }
  2870. // Context sets the context to be used in this call's Do method. Any
  2871. // pending HTTP request will be aborted if the provided context is
  2872. // canceled.
  2873. func (c *ContactGroupsUpdateCall) Context(ctx context.Context) *ContactGroupsUpdateCall {
  2874. c.ctx_ = ctx
  2875. return c
  2876. }
  2877. // Header returns an http.Header that can be modified by the caller to
  2878. // add HTTP headers to the request.
  2879. func (c *ContactGroupsUpdateCall) Header() http.Header {
  2880. if c.header_ == nil {
  2881. c.header_ = make(http.Header)
  2882. }
  2883. return c.header_
  2884. }
  2885. func (c *ContactGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2886. reqHeaders := make(http.Header)
  2887. for k, v := range c.header_ {
  2888. reqHeaders[k] = v
  2889. }
  2890. reqHeaders.Set("User-Agent", c.s.userAgent())
  2891. var body io.Reader = nil
  2892. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatecontactgrouprequest)
  2893. if err != nil {
  2894. return nil, err
  2895. }
  2896. reqHeaders.Set("Content-Type", "application/json")
  2897. c.urlParams_.Set("alt", alt)
  2898. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
  2899. urls += "?" + c.urlParams_.Encode()
  2900. req, _ := http.NewRequest("PUT", urls, body)
  2901. req.Header = reqHeaders
  2902. googleapi.Expand(req.URL, map[string]string{
  2903. "resourceName": c.resourceName,
  2904. })
  2905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2906. }
  2907. // Do executes the "people.contactGroups.update" call.
  2908. // Exactly one of *ContactGroup or error will be non-nil. Any non-2xx
  2909. // status code is an error. Response headers are in either
  2910. // *ContactGroup.ServerResponse.Header or (if a response was returned at
  2911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2912. // to check whether the returned error was because
  2913. // http.StatusNotModified was returned.
  2914. func (c *ContactGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*ContactGroup, error) {
  2915. gensupport.SetOptions(c.urlParams_, opts...)
  2916. res, err := c.doRequest("json")
  2917. if res != nil && res.StatusCode == http.StatusNotModified {
  2918. if res.Body != nil {
  2919. res.Body.Close()
  2920. }
  2921. return nil, &googleapi.Error{
  2922. Code: res.StatusCode,
  2923. Header: res.Header,
  2924. }
  2925. }
  2926. if err != nil {
  2927. return nil, err
  2928. }
  2929. defer googleapi.CloseBody(res)
  2930. if err := googleapi.CheckResponse(res); err != nil {
  2931. return nil, err
  2932. }
  2933. ret := &ContactGroup{
  2934. ServerResponse: googleapi.ServerResponse{
  2935. Header: res.Header,
  2936. HTTPStatusCode: res.StatusCode,
  2937. },
  2938. }
  2939. target := &ret
  2940. if err := gensupport.DecodeResponse(target, res); err != nil {
  2941. return nil, err
  2942. }
  2943. return ret, nil
  2944. // {
  2945. // "description": "Update the name of an existing contact group owned by the authenticated\nuser.",
  2946. // "flatPath": "v1/contactGroups/{contactGroupsId}",
  2947. // "httpMethod": "PUT",
  2948. // "id": "people.contactGroups.update",
  2949. // "parameterOrder": [
  2950. // "resourceName"
  2951. // ],
  2952. // "parameters": {
  2953. // "resourceName": {
  2954. // "description": "The resource name for the contact group, assigned by the server. An ASCII\nstring, in the form of `contactGroups/`\u003cvar\u003econtact_group_id\u003c/var\u003e.",
  2955. // "location": "path",
  2956. // "pattern": "^contactGroups/[^/]+$",
  2957. // "required": true,
  2958. // "type": "string"
  2959. // }
  2960. // },
  2961. // "path": "v1/{+resourceName}",
  2962. // "request": {
  2963. // "$ref": "UpdateContactGroupRequest"
  2964. // },
  2965. // "response": {
  2966. // "$ref": "ContactGroup"
  2967. // },
  2968. // "scopes": [
  2969. // "https://www.googleapis.com/auth/contacts"
  2970. // ]
  2971. // }
  2972. }
  2973. // method id "people.contactGroups.members.modify":
  2974. type ContactGroupsMembersModifyCall struct {
  2975. s *Service
  2976. resourceName string
  2977. modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest
  2978. urlParams_ gensupport.URLParams
  2979. ctx_ context.Context
  2980. header_ http.Header
  2981. }
  2982. // Modify: Modify the members of a contact group owned by the
  2983. // authenticated user.
  2984. func (r *ContactGroupsMembersService) Modify(resourceName string, modifycontactgroupmembersrequest *ModifyContactGroupMembersRequest) *ContactGroupsMembersModifyCall {
  2985. c := &ContactGroupsMembersModifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2986. c.resourceName = resourceName
  2987. c.modifycontactgroupmembersrequest = modifycontactgroupmembersrequest
  2988. return c
  2989. }
  2990. // Fields allows partial responses to be retrieved. See
  2991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2992. // for more information.
  2993. func (c *ContactGroupsMembersModifyCall) Fields(s ...googleapi.Field) *ContactGroupsMembersModifyCall {
  2994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2995. return c
  2996. }
  2997. // Context sets the context to be used in this call's Do method. Any
  2998. // pending HTTP request will be aborted if the provided context is
  2999. // canceled.
  3000. func (c *ContactGroupsMembersModifyCall) Context(ctx context.Context) *ContactGroupsMembersModifyCall {
  3001. c.ctx_ = ctx
  3002. return c
  3003. }
  3004. // Header returns an http.Header that can be modified by the caller to
  3005. // add HTTP headers to the request.
  3006. func (c *ContactGroupsMembersModifyCall) Header() http.Header {
  3007. if c.header_ == nil {
  3008. c.header_ = make(http.Header)
  3009. }
  3010. return c.header_
  3011. }
  3012. func (c *ContactGroupsMembersModifyCall) doRequest(alt string) (*http.Response, error) {
  3013. reqHeaders := make(http.Header)
  3014. for k, v := range c.header_ {
  3015. reqHeaders[k] = v
  3016. }
  3017. reqHeaders.Set("User-Agent", c.s.userAgent())
  3018. var body io.Reader = nil
  3019. body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycontactgroupmembersrequest)
  3020. if err != nil {
  3021. return nil, err
  3022. }
  3023. reqHeaders.Set("Content-Type", "application/json")
  3024. c.urlParams_.Set("alt", alt)
  3025. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/members:modify")
  3026. urls += "?" + c.urlParams_.Encode()
  3027. req, _ := http.NewRequest("POST", urls, body)
  3028. req.Header = reqHeaders
  3029. googleapi.Expand(req.URL, map[string]string{
  3030. "resourceName": c.resourceName,
  3031. })
  3032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3033. }
  3034. // Do executes the "people.contactGroups.members.modify" call.
  3035. // Exactly one of *ModifyContactGroupMembersResponse or error will be
  3036. // non-nil. Any non-2xx status code is an error. Response headers are in
  3037. // either *ModifyContactGroupMembersResponse.ServerResponse.Header or
  3038. // (if a response was returned at all) in
  3039. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3040. // whether the returned error was because http.StatusNotModified was
  3041. // returned.
  3042. func (c *ContactGroupsMembersModifyCall) Do(opts ...googleapi.CallOption) (*ModifyContactGroupMembersResponse, error) {
  3043. gensupport.SetOptions(c.urlParams_, opts...)
  3044. res, err := c.doRequest("json")
  3045. if res != nil && res.StatusCode == http.StatusNotModified {
  3046. if res.Body != nil {
  3047. res.Body.Close()
  3048. }
  3049. return nil, &googleapi.Error{
  3050. Code: res.StatusCode,
  3051. Header: res.Header,
  3052. }
  3053. }
  3054. if err != nil {
  3055. return nil, err
  3056. }
  3057. defer googleapi.CloseBody(res)
  3058. if err := googleapi.CheckResponse(res); err != nil {
  3059. return nil, err
  3060. }
  3061. ret := &ModifyContactGroupMembersResponse{
  3062. ServerResponse: googleapi.ServerResponse{
  3063. Header: res.Header,
  3064. HTTPStatusCode: res.StatusCode,
  3065. },
  3066. }
  3067. target := &ret
  3068. if err := gensupport.DecodeResponse(target, res); err != nil {
  3069. return nil, err
  3070. }
  3071. return ret, nil
  3072. // {
  3073. // "description": "Modify the members of a contact group owned by the authenticated user.",
  3074. // "flatPath": "v1/contactGroups/{contactGroupsId}/members:modify",
  3075. // "httpMethod": "POST",
  3076. // "id": "people.contactGroups.members.modify",
  3077. // "parameterOrder": [
  3078. // "resourceName"
  3079. // ],
  3080. // "parameters": {
  3081. // "resourceName": {
  3082. // "description": "The resource name of the contact group to modify.",
  3083. // "location": "path",
  3084. // "pattern": "^contactGroups/[^/]+$",
  3085. // "required": true,
  3086. // "type": "string"
  3087. // }
  3088. // },
  3089. // "path": "v1/{+resourceName}/members:modify",
  3090. // "request": {
  3091. // "$ref": "ModifyContactGroupMembersRequest"
  3092. // },
  3093. // "response": {
  3094. // "$ref": "ModifyContactGroupMembersResponse"
  3095. // },
  3096. // "scopes": [
  3097. // "https://www.googleapis.com/auth/contacts"
  3098. // ]
  3099. // }
  3100. }
  3101. // method id "people.people.createContact":
  3102. type PeopleCreateContactCall struct {
  3103. s *Service
  3104. person *Person
  3105. urlParams_ gensupport.URLParams
  3106. ctx_ context.Context
  3107. header_ http.Header
  3108. }
  3109. // CreateContact: Create a new contact and return the person resource
  3110. // for that contact.
  3111. func (r *PeopleService) CreateContact(person *Person) *PeopleCreateContactCall {
  3112. c := &PeopleCreateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3113. c.person = person
  3114. return c
  3115. }
  3116. // Parent sets the optional parameter "parent": The resource name of the
  3117. // owning person resource.
  3118. func (c *PeopleCreateContactCall) Parent(parent string) *PeopleCreateContactCall {
  3119. c.urlParams_.Set("parent", parent)
  3120. return c
  3121. }
  3122. // Fields allows partial responses to be retrieved. See
  3123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3124. // for more information.
  3125. func (c *PeopleCreateContactCall) Fields(s ...googleapi.Field) *PeopleCreateContactCall {
  3126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3127. return c
  3128. }
  3129. // Context sets the context to be used in this call's Do method. Any
  3130. // pending HTTP request will be aborted if the provided context is
  3131. // canceled.
  3132. func (c *PeopleCreateContactCall) Context(ctx context.Context) *PeopleCreateContactCall {
  3133. c.ctx_ = ctx
  3134. return c
  3135. }
  3136. // Header returns an http.Header that can be modified by the caller to
  3137. // add HTTP headers to the request.
  3138. func (c *PeopleCreateContactCall) Header() http.Header {
  3139. if c.header_ == nil {
  3140. c.header_ = make(http.Header)
  3141. }
  3142. return c.header_
  3143. }
  3144. func (c *PeopleCreateContactCall) doRequest(alt string) (*http.Response, error) {
  3145. reqHeaders := make(http.Header)
  3146. for k, v := range c.header_ {
  3147. reqHeaders[k] = v
  3148. }
  3149. reqHeaders.Set("User-Agent", c.s.userAgent())
  3150. var body io.Reader = nil
  3151. body, err := googleapi.WithoutDataWrapper.JSONReader(c.person)
  3152. if err != nil {
  3153. return nil, err
  3154. }
  3155. reqHeaders.Set("Content-Type", "application/json")
  3156. c.urlParams_.Set("alt", alt)
  3157. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:createContact")
  3158. urls += "?" + c.urlParams_.Encode()
  3159. req, _ := http.NewRequest("POST", urls, body)
  3160. req.Header = reqHeaders
  3161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3162. }
  3163. // Do executes the "people.people.createContact" call.
  3164. // Exactly one of *Person or error will be non-nil. Any non-2xx status
  3165. // code is an error. Response headers are in either
  3166. // *Person.ServerResponse.Header or (if a response was returned at all)
  3167. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3168. // check whether the returned error was because http.StatusNotModified
  3169. // was returned.
  3170. func (c *PeopleCreateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) {
  3171. gensupport.SetOptions(c.urlParams_, opts...)
  3172. res, err := c.doRequest("json")
  3173. if res != nil && res.StatusCode == http.StatusNotModified {
  3174. if res.Body != nil {
  3175. res.Body.Close()
  3176. }
  3177. return nil, &googleapi.Error{
  3178. Code: res.StatusCode,
  3179. Header: res.Header,
  3180. }
  3181. }
  3182. if err != nil {
  3183. return nil, err
  3184. }
  3185. defer googleapi.CloseBody(res)
  3186. if err := googleapi.CheckResponse(res); err != nil {
  3187. return nil, err
  3188. }
  3189. ret := &Person{
  3190. ServerResponse: googleapi.ServerResponse{
  3191. Header: res.Header,
  3192. HTTPStatusCode: res.StatusCode,
  3193. },
  3194. }
  3195. target := &ret
  3196. if err := gensupport.DecodeResponse(target, res); err != nil {
  3197. return nil, err
  3198. }
  3199. return ret, nil
  3200. // {
  3201. // "description": "Create a new contact and return the person resource for that contact.",
  3202. // "flatPath": "v1/people:createContact",
  3203. // "httpMethod": "POST",
  3204. // "id": "people.people.createContact",
  3205. // "parameterOrder": [],
  3206. // "parameters": {
  3207. // "parent": {
  3208. // "description": "The resource name of the owning person resource.",
  3209. // "location": "query",
  3210. // "type": "string"
  3211. // }
  3212. // },
  3213. // "path": "v1/people:createContact",
  3214. // "request": {
  3215. // "$ref": "Person"
  3216. // },
  3217. // "response": {
  3218. // "$ref": "Person"
  3219. // },
  3220. // "scopes": [
  3221. // "https://www.googleapis.com/auth/contacts"
  3222. // ]
  3223. // }
  3224. }
  3225. // method id "people.people.deleteContact":
  3226. type PeopleDeleteContactCall struct {
  3227. s *Service
  3228. resourceName string
  3229. urlParams_ gensupport.URLParams
  3230. ctx_ context.Context
  3231. header_ http.Header
  3232. }
  3233. // DeleteContact: Delete a contact person. Any non-contact data will not
  3234. // be deleted.
  3235. func (r *PeopleService) DeleteContact(resourceName string) *PeopleDeleteContactCall {
  3236. c := &PeopleDeleteContactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3237. c.resourceName = resourceName
  3238. return c
  3239. }
  3240. // Fields allows partial responses to be retrieved. See
  3241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3242. // for more information.
  3243. func (c *PeopleDeleteContactCall) Fields(s ...googleapi.Field) *PeopleDeleteContactCall {
  3244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3245. return c
  3246. }
  3247. // Context sets the context to be used in this call's Do method. Any
  3248. // pending HTTP request will be aborted if the provided context is
  3249. // canceled.
  3250. func (c *PeopleDeleteContactCall) Context(ctx context.Context) *PeopleDeleteContactCall {
  3251. c.ctx_ = ctx
  3252. return c
  3253. }
  3254. // Header returns an http.Header that can be modified by the caller to
  3255. // add HTTP headers to the request.
  3256. func (c *PeopleDeleteContactCall) Header() http.Header {
  3257. if c.header_ == nil {
  3258. c.header_ = make(http.Header)
  3259. }
  3260. return c.header_
  3261. }
  3262. func (c *PeopleDeleteContactCall) doRequest(alt string) (*http.Response, error) {
  3263. reqHeaders := make(http.Header)
  3264. for k, v := range c.header_ {
  3265. reqHeaders[k] = v
  3266. }
  3267. reqHeaders.Set("User-Agent", c.s.userAgent())
  3268. var body io.Reader = nil
  3269. c.urlParams_.Set("alt", alt)
  3270. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:deleteContact")
  3271. urls += "?" + c.urlParams_.Encode()
  3272. req, _ := http.NewRequest("DELETE", urls, body)
  3273. req.Header = reqHeaders
  3274. googleapi.Expand(req.URL, map[string]string{
  3275. "resourceName": c.resourceName,
  3276. })
  3277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3278. }
  3279. // Do executes the "people.people.deleteContact" call.
  3280. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3281. // code is an error. Response headers are in either
  3282. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3283. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3284. // check whether the returned error was because http.StatusNotModified
  3285. // was returned.
  3286. func (c *PeopleDeleteContactCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3287. gensupport.SetOptions(c.urlParams_, opts...)
  3288. res, err := c.doRequest("json")
  3289. if res != nil && res.StatusCode == http.StatusNotModified {
  3290. if res.Body != nil {
  3291. res.Body.Close()
  3292. }
  3293. return nil, &googleapi.Error{
  3294. Code: res.StatusCode,
  3295. Header: res.Header,
  3296. }
  3297. }
  3298. if err != nil {
  3299. return nil, err
  3300. }
  3301. defer googleapi.CloseBody(res)
  3302. if err := googleapi.CheckResponse(res); err != nil {
  3303. return nil, err
  3304. }
  3305. ret := &Empty{
  3306. ServerResponse: googleapi.ServerResponse{
  3307. Header: res.Header,
  3308. HTTPStatusCode: res.StatusCode,
  3309. },
  3310. }
  3311. target := &ret
  3312. if err := gensupport.DecodeResponse(target, res); err != nil {
  3313. return nil, err
  3314. }
  3315. return ret, nil
  3316. // {
  3317. // "description": "Delete a contact person. Any non-contact data will not be deleted.",
  3318. // "flatPath": "v1/people/{peopleId}:deleteContact",
  3319. // "httpMethod": "DELETE",
  3320. // "id": "people.people.deleteContact",
  3321. // "parameterOrder": [
  3322. // "resourceName"
  3323. // ],
  3324. // "parameters": {
  3325. // "resourceName": {
  3326. // "description": "The resource name of the contact to delete.",
  3327. // "location": "path",
  3328. // "pattern": "^people/[^/]+$",
  3329. // "required": true,
  3330. // "type": "string"
  3331. // }
  3332. // },
  3333. // "path": "v1/{+resourceName}:deleteContact",
  3334. // "response": {
  3335. // "$ref": "Empty"
  3336. // },
  3337. // "scopes": [
  3338. // "https://www.googleapis.com/auth/contacts"
  3339. // ]
  3340. // }
  3341. }
  3342. // method id "people.people.get":
  3343. type PeopleGetCall struct {
  3344. s *Service
  3345. resourceName string
  3346. urlParams_ gensupport.URLParams
  3347. ifNoneMatch_ string
  3348. ctx_ context.Context
  3349. header_ http.Header
  3350. }
  3351. // Get: Provides information about a person by specifying a resource
  3352. // name. Use
  3353. // `people/me` to indicate the authenticated user.
  3354. // <br>
  3355. // The request throws a 400 error if 'personFields' is not specified.
  3356. func (r *PeopleService) Get(resourceName string) *PeopleGetCall {
  3357. c := &PeopleGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3358. c.resourceName = resourceName
  3359. return c
  3360. }
  3361. // PersonFields sets the optional parameter "personFields":
  3362. // **Required.** A field mask to restrict which fields on the person
  3363. // are
  3364. // returned. Multiple fields can be specified by separating them with
  3365. // commas.
  3366. // Valid values are:
  3367. //
  3368. // * addresses
  3369. // * ageRanges
  3370. // * biographies
  3371. // * birthdays
  3372. // * braggingRights
  3373. // * coverPhotos
  3374. // * emailAddresses
  3375. // * events
  3376. // * genders
  3377. // * imClients
  3378. // * interests
  3379. // * locales
  3380. // * memberships
  3381. // * metadata
  3382. // * names
  3383. // * nicknames
  3384. // * occupations
  3385. // * organizations
  3386. // * phoneNumbers
  3387. // * photos
  3388. // * relations
  3389. // * relationshipInterests
  3390. // * relationshipStatuses
  3391. // * residences
  3392. // * sipAddresses
  3393. // * skills
  3394. // * taglines
  3395. // * urls
  3396. // * userDefined
  3397. func (c *PeopleGetCall) PersonFields(personFields string) *PeopleGetCall {
  3398. c.urlParams_.Set("personFields", personFields)
  3399. return c
  3400. }
  3401. // RequestMaskIncludeField sets the optional parameter
  3402. // "requestMask.includeField": **Required.** Comma-separated list of
  3403. // person fields to be included in the
  3404. // response. Each path should start with `person.`: for
  3405. // example,
  3406. // `person.names` or `person.photos`.
  3407. func (c *PeopleGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetCall {
  3408. c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField)
  3409. return c
  3410. }
  3411. // Fields allows partial responses to be retrieved. See
  3412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3413. // for more information.
  3414. func (c *PeopleGetCall) Fields(s ...googleapi.Field) *PeopleGetCall {
  3415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3416. return c
  3417. }
  3418. // IfNoneMatch sets the optional parameter which makes the operation
  3419. // fail if the object's ETag matches the given value. This is useful for
  3420. // getting updates only after the object has changed since the last
  3421. // request. Use googleapi.IsNotModified to check whether the response
  3422. // error from Do is the result of In-None-Match.
  3423. func (c *PeopleGetCall) IfNoneMatch(entityTag string) *PeopleGetCall {
  3424. c.ifNoneMatch_ = entityTag
  3425. return c
  3426. }
  3427. // Context sets the context to be used in this call's Do method. Any
  3428. // pending HTTP request will be aborted if the provided context is
  3429. // canceled.
  3430. func (c *PeopleGetCall) Context(ctx context.Context) *PeopleGetCall {
  3431. c.ctx_ = ctx
  3432. return c
  3433. }
  3434. // Header returns an http.Header that can be modified by the caller to
  3435. // add HTTP headers to the request.
  3436. func (c *PeopleGetCall) Header() http.Header {
  3437. if c.header_ == nil {
  3438. c.header_ = make(http.Header)
  3439. }
  3440. return c.header_
  3441. }
  3442. func (c *PeopleGetCall) doRequest(alt string) (*http.Response, error) {
  3443. reqHeaders := make(http.Header)
  3444. for k, v := range c.header_ {
  3445. reqHeaders[k] = v
  3446. }
  3447. reqHeaders.Set("User-Agent", c.s.userAgent())
  3448. if c.ifNoneMatch_ != "" {
  3449. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3450. }
  3451. var body io.Reader = nil
  3452. c.urlParams_.Set("alt", alt)
  3453. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}")
  3454. urls += "?" + c.urlParams_.Encode()
  3455. req, _ := http.NewRequest("GET", urls, body)
  3456. req.Header = reqHeaders
  3457. googleapi.Expand(req.URL, map[string]string{
  3458. "resourceName": c.resourceName,
  3459. })
  3460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3461. }
  3462. // Do executes the "people.people.get" call.
  3463. // Exactly one of *Person or error will be non-nil. Any non-2xx status
  3464. // code is an error. Response headers are in either
  3465. // *Person.ServerResponse.Header or (if a response was returned at all)
  3466. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3467. // check whether the returned error was because http.StatusNotModified
  3468. // was returned.
  3469. func (c *PeopleGetCall) Do(opts ...googleapi.CallOption) (*Person, error) {
  3470. gensupport.SetOptions(c.urlParams_, opts...)
  3471. res, err := c.doRequest("json")
  3472. if res != nil && res.StatusCode == http.StatusNotModified {
  3473. if res.Body != nil {
  3474. res.Body.Close()
  3475. }
  3476. return nil, &googleapi.Error{
  3477. Code: res.StatusCode,
  3478. Header: res.Header,
  3479. }
  3480. }
  3481. if err != nil {
  3482. return nil, err
  3483. }
  3484. defer googleapi.CloseBody(res)
  3485. if err := googleapi.CheckResponse(res); err != nil {
  3486. return nil, err
  3487. }
  3488. ret := &Person{
  3489. ServerResponse: googleapi.ServerResponse{
  3490. Header: res.Header,
  3491. HTTPStatusCode: res.StatusCode,
  3492. },
  3493. }
  3494. target := &ret
  3495. if err := gensupport.DecodeResponse(target, res); err != nil {
  3496. return nil, err
  3497. }
  3498. return ret, nil
  3499. // {
  3500. // "description": "Provides information about a person by specifying a resource name. Use\n`people/me` to indicate the authenticated user.\n\u003cbr\u003e\nThe request throws a 400 error if 'personFields' is not specified.",
  3501. // "flatPath": "v1/people/{peopleId}",
  3502. // "httpMethod": "GET",
  3503. // "id": "people.people.get",
  3504. // "parameterOrder": [
  3505. // "resourceName"
  3506. // ],
  3507. // "parameters": {
  3508. // "personFields": {
  3509. // "description": "**Required.** A field mask to restrict which fields on the person are\nreturned. Multiple fields can be specified by separating them with commas.\nValid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* braggingRights\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* relationshipInterests\n* relationshipStatuses\n* residences\n* sipAddresses\n* skills\n* taglines\n* urls\n* userDefined",
  3510. // "format": "google-fieldmask",
  3511. // "location": "query",
  3512. // "type": "string"
  3513. // },
  3514. // "requestMask.includeField": {
  3515. // "description": "**Required.** Comma-separated list of person fields to be included in the\nresponse. Each path should start with `person.`: for example,\n`person.names` or `person.photos`.",
  3516. // "format": "google-fieldmask",
  3517. // "location": "query",
  3518. // "type": "string"
  3519. // },
  3520. // "resourceName": {
  3521. // "description": "The resource name of the person to provide information about.\n\n- To get information about the authenticated user, specify `people/me`.\n- To get information about a google account, specify\n `people/`\u003cvar\u003eaccount_id\u003c/var\u003e.\n- To get information about a contact, specify the resource name that\n identifies the contact as returned by\n[`people.connections.list`](/people/api/rest/v1/people.connections/list).",
  3522. // "location": "path",
  3523. // "pattern": "^people/[^/]+$",
  3524. // "required": true,
  3525. // "type": "string"
  3526. // }
  3527. // },
  3528. // "path": "v1/{+resourceName}",
  3529. // "response": {
  3530. // "$ref": "Person"
  3531. // },
  3532. // "scopes": [
  3533. // "https://www.googleapis.com/auth/contacts",
  3534. // "https://www.googleapis.com/auth/contacts.readonly",
  3535. // "https://www.googleapis.com/auth/plus.login",
  3536. // "https://www.googleapis.com/auth/user.addresses.read",
  3537. // "https://www.googleapis.com/auth/user.birthday.read",
  3538. // "https://www.googleapis.com/auth/user.emails.read",
  3539. // "https://www.googleapis.com/auth/user.phonenumbers.read",
  3540. // "https://www.googleapis.com/auth/userinfo.email",
  3541. // "https://www.googleapis.com/auth/userinfo.profile"
  3542. // ]
  3543. // }
  3544. }
  3545. // method id "people.people.getBatchGet":
  3546. type PeopleGetBatchGetCall struct {
  3547. s *Service
  3548. urlParams_ gensupport.URLParams
  3549. ifNoneMatch_ string
  3550. ctx_ context.Context
  3551. header_ http.Header
  3552. }
  3553. // GetBatchGet: Provides information about a list of specific people by
  3554. // specifying a list
  3555. // of requested resource names. Use `people/me` to indicate the
  3556. // authenticated
  3557. // user.
  3558. // <br>
  3559. // The request throws a 400 error if 'personFields' is not specified.
  3560. func (r *PeopleService) GetBatchGet() *PeopleGetBatchGetCall {
  3561. c := &PeopleGetBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3562. return c
  3563. }
  3564. // PersonFields sets the optional parameter "personFields":
  3565. // **Required.** A field mask to restrict which fields on each person
  3566. // are
  3567. // returned. Multiple fields can be specified by separating them with
  3568. // commas.
  3569. // Valid values are:
  3570. //
  3571. // * addresses
  3572. // * ageRanges
  3573. // * biographies
  3574. // * birthdays
  3575. // * braggingRights
  3576. // * coverPhotos
  3577. // * emailAddresses
  3578. // * events
  3579. // * genders
  3580. // * imClients
  3581. // * interests
  3582. // * locales
  3583. // * memberships
  3584. // * metadata
  3585. // * names
  3586. // * nicknames
  3587. // * occupations
  3588. // * organizations
  3589. // * phoneNumbers
  3590. // * photos
  3591. // * relations
  3592. // * relationshipInterests
  3593. // * relationshipStatuses
  3594. // * residences
  3595. // * sipAddresses
  3596. // * skills
  3597. // * taglines
  3598. // * urls
  3599. // * userDefined
  3600. func (c *PeopleGetBatchGetCall) PersonFields(personFields string) *PeopleGetBatchGetCall {
  3601. c.urlParams_.Set("personFields", personFields)
  3602. return c
  3603. }
  3604. // RequestMaskIncludeField sets the optional parameter
  3605. // "requestMask.includeField": **Required.** Comma-separated list of
  3606. // person fields to be included in the
  3607. // response. Each path should start with `person.`: for
  3608. // example,
  3609. // `person.names` or `person.photos`.
  3610. func (c *PeopleGetBatchGetCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleGetBatchGetCall {
  3611. c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField)
  3612. return c
  3613. }
  3614. // ResourceNames sets the optional parameter "resourceNames": The
  3615. // resource names of the people to provide information about.
  3616. //
  3617. // - To get information about the authenticated user, specify
  3618. // `people/me`.
  3619. // - To get information about a google account, specify
  3620. // `people/`<var>account_id</var>.
  3621. // - To get information about a contact, specify the resource name that
  3622. // identifies the contact as returned
  3623. // by
  3624. // [`people.connections.list`](/people/api/rest/v1/people.connections/
  3625. // list).
  3626. //
  3627. // You can include up to 50 resource names in one request.
  3628. func (c *PeopleGetBatchGetCall) ResourceNames(resourceNames ...string) *PeopleGetBatchGetCall {
  3629. c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
  3630. return c
  3631. }
  3632. // Fields allows partial responses to be retrieved. See
  3633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3634. // for more information.
  3635. func (c *PeopleGetBatchGetCall) Fields(s ...googleapi.Field) *PeopleGetBatchGetCall {
  3636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3637. return c
  3638. }
  3639. // IfNoneMatch sets the optional parameter which makes the operation
  3640. // fail if the object's ETag matches the given value. This is useful for
  3641. // getting updates only after the object has changed since the last
  3642. // request. Use googleapi.IsNotModified to check whether the response
  3643. // error from Do is the result of In-None-Match.
  3644. func (c *PeopleGetBatchGetCall) IfNoneMatch(entityTag string) *PeopleGetBatchGetCall {
  3645. c.ifNoneMatch_ = entityTag
  3646. return c
  3647. }
  3648. // Context sets the context to be used in this call's Do method. Any
  3649. // pending HTTP request will be aborted if the provided context is
  3650. // canceled.
  3651. func (c *PeopleGetBatchGetCall) Context(ctx context.Context) *PeopleGetBatchGetCall {
  3652. c.ctx_ = ctx
  3653. return c
  3654. }
  3655. // Header returns an http.Header that can be modified by the caller to
  3656. // add HTTP headers to the request.
  3657. func (c *PeopleGetBatchGetCall) Header() http.Header {
  3658. if c.header_ == nil {
  3659. c.header_ = make(http.Header)
  3660. }
  3661. return c.header_
  3662. }
  3663. func (c *PeopleGetBatchGetCall) doRequest(alt string) (*http.Response, error) {
  3664. reqHeaders := make(http.Header)
  3665. for k, v := range c.header_ {
  3666. reqHeaders[k] = v
  3667. }
  3668. reqHeaders.Set("User-Agent", c.s.userAgent())
  3669. if c.ifNoneMatch_ != "" {
  3670. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3671. }
  3672. var body io.Reader = nil
  3673. c.urlParams_.Set("alt", alt)
  3674. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/people:batchGet")
  3675. urls += "?" + c.urlParams_.Encode()
  3676. req, _ := http.NewRequest("GET", urls, body)
  3677. req.Header = reqHeaders
  3678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3679. }
  3680. // Do executes the "people.people.getBatchGet" call.
  3681. // Exactly one of *GetPeopleResponse or error will be non-nil. Any
  3682. // non-2xx status code is an error. Response headers are in either
  3683. // *GetPeopleResponse.ServerResponse.Header or (if a response was
  3684. // returned at all) in error.(*googleapi.Error).Header. Use
  3685. // googleapi.IsNotModified to check whether the returned error was
  3686. // because http.StatusNotModified was returned.
  3687. func (c *PeopleGetBatchGetCall) Do(opts ...googleapi.CallOption) (*GetPeopleResponse, error) {
  3688. gensupport.SetOptions(c.urlParams_, opts...)
  3689. res, err := c.doRequest("json")
  3690. if res != nil && res.StatusCode == http.StatusNotModified {
  3691. if res.Body != nil {
  3692. res.Body.Close()
  3693. }
  3694. return nil, &googleapi.Error{
  3695. Code: res.StatusCode,
  3696. Header: res.Header,
  3697. }
  3698. }
  3699. if err != nil {
  3700. return nil, err
  3701. }
  3702. defer googleapi.CloseBody(res)
  3703. if err := googleapi.CheckResponse(res); err != nil {
  3704. return nil, err
  3705. }
  3706. ret := &GetPeopleResponse{
  3707. ServerResponse: googleapi.ServerResponse{
  3708. Header: res.Header,
  3709. HTTPStatusCode: res.StatusCode,
  3710. },
  3711. }
  3712. target := &ret
  3713. if err := gensupport.DecodeResponse(target, res); err != nil {
  3714. return nil, err
  3715. }
  3716. return ret, nil
  3717. // {
  3718. // "description": "Provides information about a list of specific people by specifying a list\nof requested resource names. Use `people/me` to indicate the authenticated\nuser.\n\u003cbr\u003e\nThe request throws a 400 error if 'personFields' is not specified.",
  3719. // "flatPath": "v1/people:batchGet",
  3720. // "httpMethod": "GET",
  3721. // "id": "people.people.getBatchGet",
  3722. // "parameterOrder": [],
  3723. // "parameters": {
  3724. // "personFields": {
  3725. // "description": "**Required.** A field mask to restrict which fields on each person are\nreturned. Multiple fields can be specified by separating them with commas.\nValid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* braggingRights\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* relationshipInterests\n* relationshipStatuses\n* residences\n* sipAddresses\n* skills\n* taglines\n* urls\n* userDefined",
  3726. // "format": "google-fieldmask",
  3727. // "location": "query",
  3728. // "type": "string"
  3729. // },
  3730. // "requestMask.includeField": {
  3731. // "description": "**Required.** Comma-separated list of person fields to be included in the\nresponse. Each path should start with `person.`: for example,\n`person.names` or `person.photos`.",
  3732. // "format": "google-fieldmask",
  3733. // "location": "query",
  3734. // "type": "string"
  3735. // },
  3736. // "resourceNames": {
  3737. // "description": "The resource names of the people to provide information about.\n\n- To get information about the authenticated user, specify `people/me`.\n- To get information about a google account, specify\n `people/`\u003cvar\u003eaccount_id\u003c/var\u003e.\n- To get information about a contact, specify the resource name that\n identifies the contact as returned by\n[`people.connections.list`](/people/api/rest/v1/people.connections/list).\n\nYou can include up to 50 resource names in one request.",
  3738. // "location": "query",
  3739. // "repeated": true,
  3740. // "type": "string"
  3741. // }
  3742. // },
  3743. // "path": "v1/people:batchGet",
  3744. // "response": {
  3745. // "$ref": "GetPeopleResponse"
  3746. // },
  3747. // "scopes": [
  3748. // "https://www.googleapis.com/auth/contacts",
  3749. // "https://www.googleapis.com/auth/contacts.readonly",
  3750. // "https://www.googleapis.com/auth/plus.login",
  3751. // "https://www.googleapis.com/auth/user.addresses.read",
  3752. // "https://www.googleapis.com/auth/user.birthday.read",
  3753. // "https://www.googleapis.com/auth/user.emails.read",
  3754. // "https://www.googleapis.com/auth/user.phonenumbers.read",
  3755. // "https://www.googleapis.com/auth/userinfo.email",
  3756. // "https://www.googleapis.com/auth/userinfo.profile"
  3757. // ]
  3758. // }
  3759. }
  3760. // method id "people.people.updateContact":
  3761. type PeopleUpdateContactCall struct {
  3762. s *Service
  3763. resourceName string
  3764. person *Person
  3765. urlParams_ gensupport.URLParams
  3766. ctx_ context.Context
  3767. header_ http.Header
  3768. }
  3769. // UpdateContact: Update contact data for an existing contact person.
  3770. // Any non-contact data
  3771. // will not be modified.
  3772. //
  3773. // The request throws a 400 error if `updatePersonFields` is not
  3774. // specified.
  3775. // <br>
  3776. // The request throws a 400 error if `person.metadata.sources` is
  3777. // not
  3778. // specified for the contact to be updated.
  3779. // <br>
  3780. // The request throws a 412 error if `person.metadata.sources.etag`
  3781. // is
  3782. // different than the contact's etag, which indicates the contact has
  3783. // changed
  3784. // since its data was read. Clients should get the latest person and
  3785. // re-apply
  3786. // their updates to the latest person.
  3787. func (r *PeopleService) UpdateContact(resourceName string, person *Person) *PeopleUpdateContactCall {
  3788. c := &PeopleUpdateContactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3789. c.resourceName = resourceName
  3790. c.person = person
  3791. return c
  3792. }
  3793. // UpdatePersonFields sets the optional parameter "updatePersonFields":
  3794. // **Required.** A field mask to restrict which fields on the person
  3795. // are
  3796. // updated. Multiple fields can be specified by separating them with
  3797. // commas.
  3798. // All updated fields will be replaced. Valid values are:
  3799. //
  3800. // * addresses
  3801. // * biographies
  3802. // * birthdays
  3803. // * emailAddresses
  3804. // * events
  3805. // * genders
  3806. // * imClients
  3807. // * interests
  3808. // * locales
  3809. // * names
  3810. // * nicknames
  3811. // * occupations
  3812. // * organizations
  3813. // * phoneNumbers
  3814. // * relations
  3815. // * residences
  3816. // * sipAddresses
  3817. // * urls
  3818. // * userDefined
  3819. func (c *PeopleUpdateContactCall) UpdatePersonFields(updatePersonFields string) *PeopleUpdateContactCall {
  3820. c.urlParams_.Set("updatePersonFields", updatePersonFields)
  3821. return c
  3822. }
  3823. // Fields allows partial responses to be retrieved. See
  3824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3825. // for more information.
  3826. func (c *PeopleUpdateContactCall) Fields(s ...googleapi.Field) *PeopleUpdateContactCall {
  3827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3828. return c
  3829. }
  3830. // Context sets the context to be used in this call's Do method. Any
  3831. // pending HTTP request will be aborted if the provided context is
  3832. // canceled.
  3833. func (c *PeopleUpdateContactCall) Context(ctx context.Context) *PeopleUpdateContactCall {
  3834. c.ctx_ = ctx
  3835. return c
  3836. }
  3837. // Header returns an http.Header that can be modified by the caller to
  3838. // add HTTP headers to the request.
  3839. func (c *PeopleUpdateContactCall) Header() http.Header {
  3840. if c.header_ == nil {
  3841. c.header_ = make(http.Header)
  3842. }
  3843. return c.header_
  3844. }
  3845. func (c *PeopleUpdateContactCall) doRequest(alt string) (*http.Response, error) {
  3846. reqHeaders := make(http.Header)
  3847. for k, v := range c.header_ {
  3848. reqHeaders[k] = v
  3849. }
  3850. reqHeaders.Set("User-Agent", c.s.userAgent())
  3851. var body io.Reader = nil
  3852. body, err := googleapi.WithoutDataWrapper.JSONReader(c.person)
  3853. if err != nil {
  3854. return nil, err
  3855. }
  3856. reqHeaders.Set("Content-Type", "application/json")
  3857. c.urlParams_.Set("alt", alt)
  3858. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}:updateContact")
  3859. urls += "?" + c.urlParams_.Encode()
  3860. req, _ := http.NewRequest("PATCH", urls, body)
  3861. req.Header = reqHeaders
  3862. googleapi.Expand(req.URL, map[string]string{
  3863. "resourceName": c.resourceName,
  3864. })
  3865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3866. }
  3867. // Do executes the "people.people.updateContact" call.
  3868. // Exactly one of *Person or error will be non-nil. Any non-2xx status
  3869. // code is an error. Response headers are in either
  3870. // *Person.ServerResponse.Header or (if a response was returned at all)
  3871. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3872. // check whether the returned error was because http.StatusNotModified
  3873. // was returned.
  3874. func (c *PeopleUpdateContactCall) Do(opts ...googleapi.CallOption) (*Person, error) {
  3875. gensupport.SetOptions(c.urlParams_, opts...)
  3876. res, err := c.doRequest("json")
  3877. if res != nil && res.StatusCode == http.StatusNotModified {
  3878. if res.Body != nil {
  3879. res.Body.Close()
  3880. }
  3881. return nil, &googleapi.Error{
  3882. Code: res.StatusCode,
  3883. Header: res.Header,
  3884. }
  3885. }
  3886. if err != nil {
  3887. return nil, err
  3888. }
  3889. defer googleapi.CloseBody(res)
  3890. if err := googleapi.CheckResponse(res); err != nil {
  3891. return nil, err
  3892. }
  3893. ret := &Person{
  3894. ServerResponse: googleapi.ServerResponse{
  3895. Header: res.Header,
  3896. HTTPStatusCode: res.StatusCode,
  3897. },
  3898. }
  3899. target := &ret
  3900. if err := gensupport.DecodeResponse(target, res); err != nil {
  3901. return nil, err
  3902. }
  3903. return ret, nil
  3904. // {
  3905. // "description": "Update contact data for an existing contact person. Any non-contact data\nwill not be modified.\n\nThe request throws a 400 error if `updatePersonFields` is not specified.\n\u003cbr\u003e\nThe request throws a 400 error if `person.metadata.sources` is not\nspecified for the contact to be updated.\n\u003cbr\u003e\nThe request throws a 412 error if `person.metadata.sources.etag` is\ndifferent than the contact's etag, which indicates the contact has changed\nsince its data was read. Clients should get the latest person and re-apply\ntheir updates to the latest person.",
  3906. // "flatPath": "v1/people/{peopleId}:updateContact",
  3907. // "httpMethod": "PATCH",
  3908. // "id": "people.people.updateContact",
  3909. // "parameterOrder": [
  3910. // "resourceName"
  3911. // ],
  3912. // "parameters": {
  3913. // "resourceName": {
  3914. // "description": "The resource name for the person, assigned by the server. An ASCII string\nwith a max length of 27 characters, in the form of\n`people/`\u003cvar\u003eperson_id\u003c/var\u003e.",
  3915. // "location": "path",
  3916. // "pattern": "^people/[^/]+$",
  3917. // "required": true,
  3918. // "type": "string"
  3919. // },
  3920. // "updatePersonFields": {
  3921. // "description": "**Required.** A field mask to restrict which fields on the person are\nupdated. Multiple fields can be specified by separating them with commas.\nAll updated fields will be replaced. Valid values are:\n\n* addresses\n* biographies\n* birthdays\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* relations\n* residences\n* sipAddresses\n* urls\n* userDefined",
  3922. // "format": "google-fieldmask",
  3923. // "location": "query",
  3924. // "type": "string"
  3925. // }
  3926. // },
  3927. // "path": "v1/{+resourceName}:updateContact",
  3928. // "request": {
  3929. // "$ref": "Person"
  3930. // },
  3931. // "response": {
  3932. // "$ref": "Person"
  3933. // },
  3934. // "scopes": [
  3935. // "https://www.googleapis.com/auth/contacts"
  3936. // ]
  3937. // }
  3938. }
  3939. // method id "people.people.connections.list":
  3940. type PeopleConnectionsListCall struct {
  3941. s *Service
  3942. resourceName string
  3943. urlParams_ gensupport.URLParams
  3944. ifNoneMatch_ string
  3945. ctx_ context.Context
  3946. header_ http.Header
  3947. }
  3948. // List: Provides a list of the authenticated user's contacts merged
  3949. // with any
  3950. // connected profiles.
  3951. // <br>
  3952. // The request throws a 400 error if 'personFields' is not specified.
  3953. func (r *PeopleConnectionsService) List(resourceName string) *PeopleConnectionsListCall {
  3954. c := &PeopleConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3955. c.resourceName = resourceName
  3956. return c
  3957. }
  3958. // PageSize sets the optional parameter "pageSize": The number of
  3959. // connections to include in the response. Valid values are
  3960. // between 1 and 2000, inclusive. Defaults to 100.
  3961. func (c *PeopleConnectionsListCall) PageSize(pageSize int64) *PeopleConnectionsListCall {
  3962. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3963. return c
  3964. }
  3965. // PageToken sets the optional parameter "pageToken": The token of the
  3966. // page to be returned.
  3967. func (c *PeopleConnectionsListCall) PageToken(pageToken string) *PeopleConnectionsListCall {
  3968. c.urlParams_.Set("pageToken", pageToken)
  3969. return c
  3970. }
  3971. // PersonFields sets the optional parameter "personFields":
  3972. // **Required.** A field mask to restrict which fields on each person
  3973. // are
  3974. // returned. Multiple fields can be specified by separating them with
  3975. // commas.
  3976. // Valid values are:
  3977. //
  3978. // * addresses
  3979. // * ageRanges
  3980. // * biographies
  3981. // * birthdays
  3982. // * braggingRights
  3983. // * coverPhotos
  3984. // * emailAddresses
  3985. // * events
  3986. // * genders
  3987. // * imClients
  3988. // * interests
  3989. // * locales
  3990. // * memberships
  3991. // * metadata
  3992. // * names
  3993. // * nicknames
  3994. // * occupations
  3995. // * organizations
  3996. // * phoneNumbers
  3997. // * photos
  3998. // * relations
  3999. // * relationshipInterests
  4000. // * relationshipStatuses
  4001. // * residences
  4002. // * sipAddresses
  4003. // * skills
  4004. // * taglines
  4005. // * urls
  4006. // * userDefined
  4007. func (c *PeopleConnectionsListCall) PersonFields(personFields string) *PeopleConnectionsListCall {
  4008. c.urlParams_.Set("personFields", personFields)
  4009. return c
  4010. }
  4011. // RequestMaskIncludeField sets the optional parameter
  4012. // "requestMask.includeField": **Required.** Comma-separated list of
  4013. // person fields to be included in the
  4014. // response. Each path should start with `person.`: for
  4015. // example,
  4016. // `person.names` or `person.photos`.
  4017. func (c *PeopleConnectionsListCall) RequestMaskIncludeField(requestMaskIncludeField string) *PeopleConnectionsListCall {
  4018. c.urlParams_.Set("requestMask.includeField", requestMaskIncludeField)
  4019. return c
  4020. }
  4021. // RequestSyncToken sets the optional parameter "requestSyncToken":
  4022. // Whether the response should include a sync token, which can be used
  4023. // to get
  4024. // all changes since the last request. For subsequent sync requests use
  4025. // the
  4026. // `sync_token` param instead. Initial sync requests that
  4027. // specify
  4028. // `request_sync_token` have an additional rate limit.
  4029. func (c *PeopleConnectionsListCall) RequestSyncToken(requestSyncToken bool) *PeopleConnectionsListCall {
  4030. c.urlParams_.Set("requestSyncToken", fmt.Sprint(requestSyncToken))
  4031. return c
  4032. }
  4033. // SortOrder sets the optional parameter "sortOrder": The order in which
  4034. // the connections should be sorted. Defaults
  4035. // to
  4036. // `LAST_MODIFIED_ASCENDING`.
  4037. //
  4038. // Possible values:
  4039. // "LAST_MODIFIED_ASCENDING"
  4040. // "FIRST_NAME_ASCENDING"
  4041. // "LAST_NAME_ASCENDING"
  4042. func (c *PeopleConnectionsListCall) SortOrder(sortOrder string) *PeopleConnectionsListCall {
  4043. c.urlParams_.Set("sortOrder", sortOrder)
  4044. return c
  4045. }
  4046. // SyncToken sets the optional parameter "syncToken": A sync token
  4047. // returned by a previous call to `people.connections.list`.
  4048. // Only resources changed since the sync token was created will be
  4049. // returned.
  4050. // Sync requests that specify `sync_token` have an additional rate
  4051. // limit.
  4052. func (c *PeopleConnectionsListCall) SyncToken(syncToken string) *PeopleConnectionsListCall {
  4053. c.urlParams_.Set("syncToken", syncToken)
  4054. return c
  4055. }
  4056. // Fields allows partial responses to be retrieved. See
  4057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4058. // for more information.
  4059. func (c *PeopleConnectionsListCall) Fields(s ...googleapi.Field) *PeopleConnectionsListCall {
  4060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4061. return c
  4062. }
  4063. // IfNoneMatch sets the optional parameter which makes the operation
  4064. // fail if the object's ETag matches the given value. This is useful for
  4065. // getting updates only after the object has changed since the last
  4066. // request. Use googleapi.IsNotModified to check whether the response
  4067. // error from Do is the result of In-None-Match.
  4068. func (c *PeopleConnectionsListCall) IfNoneMatch(entityTag string) *PeopleConnectionsListCall {
  4069. c.ifNoneMatch_ = entityTag
  4070. return c
  4071. }
  4072. // Context sets the context to be used in this call's Do method. Any
  4073. // pending HTTP request will be aborted if the provided context is
  4074. // canceled.
  4075. func (c *PeopleConnectionsListCall) Context(ctx context.Context) *PeopleConnectionsListCall {
  4076. c.ctx_ = ctx
  4077. return c
  4078. }
  4079. // Header returns an http.Header that can be modified by the caller to
  4080. // add HTTP headers to the request.
  4081. func (c *PeopleConnectionsListCall) Header() http.Header {
  4082. if c.header_ == nil {
  4083. c.header_ = make(http.Header)
  4084. }
  4085. return c.header_
  4086. }
  4087. func (c *PeopleConnectionsListCall) doRequest(alt string) (*http.Response, error) {
  4088. reqHeaders := make(http.Header)
  4089. for k, v := range c.header_ {
  4090. reqHeaders[k] = v
  4091. }
  4092. reqHeaders.Set("User-Agent", c.s.userAgent())
  4093. if c.ifNoneMatch_ != "" {
  4094. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4095. }
  4096. var body io.Reader = nil
  4097. c.urlParams_.Set("alt", alt)
  4098. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}/connections")
  4099. urls += "?" + c.urlParams_.Encode()
  4100. req, _ := http.NewRequest("GET", urls, body)
  4101. req.Header = reqHeaders
  4102. googleapi.Expand(req.URL, map[string]string{
  4103. "resourceName": c.resourceName,
  4104. })
  4105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4106. }
  4107. // Do executes the "people.people.connections.list" call.
  4108. // Exactly one of *ListConnectionsResponse or error will be non-nil. Any
  4109. // non-2xx status code is an error. Response headers are in either
  4110. // *ListConnectionsResponse.ServerResponse.Header or (if a response was
  4111. // returned at all) in error.(*googleapi.Error).Header. Use
  4112. // googleapi.IsNotModified to check whether the returned error was
  4113. // because http.StatusNotModified was returned.
  4114. func (c *PeopleConnectionsListCall) Do(opts ...googleapi.CallOption) (*ListConnectionsResponse, error) {
  4115. gensupport.SetOptions(c.urlParams_, opts...)
  4116. res, err := c.doRequest("json")
  4117. if res != nil && res.StatusCode == http.StatusNotModified {
  4118. if res.Body != nil {
  4119. res.Body.Close()
  4120. }
  4121. return nil, &googleapi.Error{
  4122. Code: res.StatusCode,
  4123. Header: res.Header,
  4124. }
  4125. }
  4126. if err != nil {
  4127. return nil, err
  4128. }
  4129. defer googleapi.CloseBody(res)
  4130. if err := googleapi.CheckResponse(res); err != nil {
  4131. return nil, err
  4132. }
  4133. ret := &ListConnectionsResponse{
  4134. ServerResponse: googleapi.ServerResponse{
  4135. Header: res.Header,
  4136. HTTPStatusCode: res.StatusCode,
  4137. },
  4138. }
  4139. target := &ret
  4140. if err := gensupport.DecodeResponse(target, res); err != nil {
  4141. return nil, err
  4142. }
  4143. return ret, nil
  4144. // {
  4145. // "description": "Provides a list of the authenticated user's contacts merged with any\nconnected profiles.\n\u003cbr\u003e\nThe request throws a 400 error if 'personFields' is not specified.",
  4146. // "flatPath": "v1/people/{peopleId}/connections",
  4147. // "httpMethod": "GET",
  4148. // "id": "people.people.connections.list",
  4149. // "parameterOrder": [
  4150. // "resourceName"
  4151. // ],
  4152. // "parameters": {
  4153. // "pageSize": {
  4154. // "description": "The number of connections to include in the response. Valid values are\nbetween 1 and 2000, inclusive. Defaults to 100.",
  4155. // "format": "int32",
  4156. // "location": "query",
  4157. // "type": "integer"
  4158. // },
  4159. // "pageToken": {
  4160. // "description": "The token of the page to be returned.",
  4161. // "location": "query",
  4162. // "type": "string"
  4163. // },
  4164. // "personFields": {
  4165. // "description": "**Required.** A field mask to restrict which fields on each person are\nreturned. Multiple fields can be specified by separating them with commas.\nValid values are:\n\n* addresses\n* ageRanges\n* biographies\n* birthdays\n* braggingRights\n* coverPhotos\n* emailAddresses\n* events\n* genders\n* imClients\n* interests\n* locales\n* memberships\n* metadata\n* names\n* nicknames\n* occupations\n* organizations\n* phoneNumbers\n* photos\n* relations\n* relationshipInterests\n* relationshipStatuses\n* residences\n* sipAddresses\n* skills\n* taglines\n* urls\n* userDefined",
  4166. // "format": "google-fieldmask",
  4167. // "location": "query",
  4168. // "type": "string"
  4169. // },
  4170. // "requestMask.includeField": {
  4171. // "description": "**Required.** Comma-separated list of person fields to be included in the\nresponse. Each path should start with `person.`: for example,\n`person.names` or `person.photos`.",
  4172. // "format": "google-fieldmask",
  4173. // "location": "query",
  4174. // "type": "string"
  4175. // },
  4176. // "requestSyncToken": {
  4177. // "description": "Whether the response should include a sync token, which can be used to get\nall changes since the last request. For subsequent sync requests use the\n`sync_token` param instead. Initial sync requests that specify\n`request_sync_token` have an additional rate limit.",
  4178. // "location": "query",
  4179. // "type": "boolean"
  4180. // },
  4181. // "resourceName": {
  4182. // "description": "The resource name to return connections for. Only `people/me` is valid.",
  4183. // "location": "path",
  4184. // "pattern": "^people/[^/]+$",
  4185. // "required": true,
  4186. // "type": "string"
  4187. // },
  4188. // "sortOrder": {
  4189. // "description": "The order in which the connections should be sorted. Defaults to\n`LAST_MODIFIED_ASCENDING`.",
  4190. // "enum": [
  4191. // "LAST_MODIFIED_ASCENDING",
  4192. // "FIRST_NAME_ASCENDING",
  4193. // "LAST_NAME_ASCENDING"
  4194. // ],
  4195. // "location": "query",
  4196. // "type": "string"
  4197. // },
  4198. // "syncToken": {
  4199. // "description": "A sync token returned by a previous call to `people.connections.list`.\nOnly resources changed since the sync token was created will be returned.\nSync requests that specify `sync_token` have an additional rate limit.",
  4200. // "location": "query",
  4201. // "type": "string"
  4202. // }
  4203. // },
  4204. // "path": "v1/{+resourceName}/connections",
  4205. // "response": {
  4206. // "$ref": "ListConnectionsResponse"
  4207. // },
  4208. // "scopes": [
  4209. // "https://www.googleapis.com/auth/contacts",
  4210. // "https://www.googleapis.com/auth/contacts.readonly"
  4211. // ]
  4212. // }
  4213. }
  4214. // Pages invokes f for each page of results.
  4215. // A non-nil error returned from f will halt the iteration.
  4216. // The provided context supersedes any context provided to the Context method.
  4217. func (c *PeopleConnectionsListCall) Pages(ctx context.Context, f func(*ListConnectionsResponse) error) error {
  4218. c.ctx_ = ctx
  4219. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4220. for {
  4221. x, err := c.Do()
  4222. if err != nil {
  4223. return err
  4224. }
  4225. if err := f(x); err != nil {
  4226. return err
  4227. }
  4228. if x.NextPageToken == "" {
  4229. return nil
  4230. }
  4231. c.PageToken(x.NextPageToken)
  4232. }
  4233. }