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.
 
 
 

4898 lines
174 KiB

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