@@ -0,0 +1,2764 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
11+-- Module : Network.Google.People.Types.Product
12+-- Copyright : (c) 2015 Brendan Hay
13+-- License : Mozilla Public License, v. 2.0.
14+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
15+-- Stability : auto-generated
16+-- Portability : non-portable (GHC extensions)
18+module Network.Google.People.Types.Product where
20+import Network.Google.People.Types.Sum
21+import Network.Google.Prelude
23+-- | A person\'s photo. A picture shown next to the person\'s name to help
24+-- others recognize the person.
26+-- /See:/ 'photo' smart constructor.
28+ { _pURL :: !(Maybe Text)
29+ , _pMetadata :: !(Maybe FieldMetadata)
30+ } deriving (Eq,Show,Data,Typeable,Generic)
32+-- | Creates a value of 'Photo' with the minimum fields required to make a request.
34+-- Use one of the following lenses to modify other fields as desired:
44+ , _pMetadata = Nothing
47+-- | The URL of the photo.
48+pURL :: Lens' Photo (Maybe Text)
49+pURL = lens _pURL (\ s a -> s{_pURL = a})
51+-- | Metadata about the photo.
52+pMetadata :: Lens' Photo (Maybe FieldMetadata)
54+ = lens _pMetadata (\ s a -> s{_pMetadata = a})
56+instance FromJSON Photo where
60+ Photo <$> (o .:? "url") <*> (o .:? "metadata"))
62+instance ToJSON Photo where
66+ [("url" .=) <$> _pURL,
67+ ("metadata" .=) <$> _pMetadata])
69+-- | An event related to the person.
71+-- /See:/ 'event' smart constructor.
73+ { _eDate :: !(Maybe Date)
74+ , _eMetadata :: !(Maybe FieldMetadata)
75+ , _eType :: !(Maybe Text)
76+ , _eFormattedType :: !(Maybe Text)
77+ } deriving (Eq,Show,Data,Typeable,Generic)
79+-- | Creates a value of 'Event' with the minimum fields required to make a request.
81+-- Use one of the following lenses to modify other fields as desired:
95+ , _eMetadata = Nothing
97+ , _eFormattedType = Nothing
100+-- | The date of the event.
101+eDate :: Lens' Event (Maybe Date)
102+eDate = lens _eDate (\ s a -> s{_eDate = a})
104+-- | Metadata about the event.
105+eMetadata :: Lens' Event (Maybe FieldMetadata)
107+ = lens _eMetadata (\ s a -> s{_eMetadata = a})
109+-- | The type of the event. The type can be custom or predefined. Possible
110+-- values include, but are not limited to, the following: * \`anniversary\`
112+eType :: Lens' Event (Maybe Text)
113+eType = lens _eType (\ s a -> s{_eType = a})
115+-- | The read-only type of the event translated and formatted in the
116+-- viewer\'s account locale or the \`Accept-Language\` HTTP header locale.
117+eFormattedType :: Lens' Event (Maybe Text)
119+ = lens _eFormattedType
120+ (\ s a -> s{_eFormattedType = a})
122+instance FromJSON Event where
124+ = withObject "Event"
127+ (o .:? "date") <*> (o .:? "metadata") <*>
129+ <*> (o .:? "formattedType"))
131+instance ToJSON Event where
135+ [("date" .=) <$> _eDate,
136+ ("metadata" .=) <$> _eMetadata,
137+ ("type" .=) <$> _eType,
138+ ("formattedType" .=) <$> _eFormattedType])
141+-- /See:/ 'listConnectionsResponse' smart constructor.
142+data ListConnectionsResponse = ListConnectionsResponse
143+ { _lcrNextPageToken :: !(Maybe Text)
144+ , _lcrConnections :: !(Maybe [Person])
145+ , _lcrNextSyncToken :: !(Maybe Text)
146+ } deriving (Eq,Show,Data,Typeable,Generic)
148+-- | Creates a value of 'ListConnectionsResponse' with the minimum fields required to make a request.
150+-- Use one of the following lenses to modify other fields as desired:
152+-- * 'lcrNextPageToken'
154+-- * 'lcrConnections'
156+-- * 'lcrNextSyncToken'
157+listConnectionsResponse
158+ :: ListConnectionsResponse
159+listConnectionsResponse =
160+ ListConnectionsResponse
161+ { _lcrNextPageToken = Nothing
162+ , _lcrConnections = Nothing
163+ , _lcrNextSyncToken = Nothing
166+-- | The token that can be used to retrieve the next page of results.
167+lcrNextPageToken :: Lens' ListConnectionsResponse (Maybe Text)
169+ = lens _lcrNextPageToken
170+ (\ s a -> s{_lcrNextPageToken = a})
172+-- | The list of people that the requestor is connected to.
173+lcrConnections :: Lens' ListConnectionsResponse [Person]
175+ = lens _lcrConnections
176+ (\ s a -> s{_lcrConnections = a})
180+-- | The token that can be used to retrieve changes since the last request.
181+lcrNextSyncToken :: Lens' ListConnectionsResponse (Maybe Text)
183+ = lens _lcrNextSyncToken
184+ (\ s a -> s{_lcrNextSyncToken = a})
186+instance FromJSON ListConnectionsResponse where
188+ = withObject "ListConnectionsResponse"
190+ ListConnectionsResponse <$>
191+ (o .:? "nextPageToken") <*>
192+ (o .:? "connections" .!= mempty)
193+ <*> (o .:? "nextSyncToken"))
195+instance ToJSON ListConnectionsResponse where
196+ toJSON ListConnectionsResponse{..}
199+ [("nextPageToken" .=) <$> _lcrNextPageToken,
200+ ("connections" .=) <$> _lcrConnections,
201+ ("nextSyncToken" .=) <$> _lcrNextSyncToken])
203+-- | A Google Apps Domain membership.
205+-- /See:/ 'domainMembership' smart constructor.
206+newtype DomainMembership = DomainMembership
207+ { _dmInViewerDomain :: Maybe Bool
208+ } deriving (Eq,Show,Data,Typeable,Generic)
210+-- | Creates a value of 'DomainMembership' with the minimum fields required to make a request.
212+-- Use one of the following lenses to modify other fields as desired:
214+-- * 'dmInViewerDomain'
219+ { _dmInViewerDomain = Nothing
222+-- | True if the person is in the viewer\'s Google Apps domain.
223+dmInViewerDomain :: Lens' DomainMembership (Maybe Bool)
225+ = lens _dmInViewerDomain
226+ (\ s a -> s{_dmInViewerDomain = a})
228+instance FromJSON DomainMembership where
230+ = withObject "DomainMembership"
232+ DomainMembership <$> (o .:? "inViewerDomain"))
234+instance ToJSON DomainMembership where
235+ toJSON DomainMembership{..}
238+ [("inViewerDomain" .=) <$> _dmInViewerDomain])
240+-- | The kind of relationship the person is looking for.
242+-- /See:/ 'relationshipInterest' smart constructor.
243+data RelationshipInterest = RelationshipInterest
244+ { _riValue :: !(Maybe Text)
245+ , _riMetadata :: !(Maybe FieldMetadata)
246+ , _riFormattedValue :: !(Maybe Text)
247+ } deriving (Eq,Show,Data,Typeable,Generic)
249+-- | Creates a value of 'RelationshipInterest' with the minimum fields required to make a request.
251+-- Use one of the following lenses to modify other fields as desired:
257+-- * 'riFormattedValue'
259+ :: RelationshipInterest
260+relationshipInterest =
261+ RelationshipInterest
262+ { _riValue = Nothing
263+ , _riMetadata = Nothing
264+ , _riFormattedValue = Nothing
267+-- | The kind of relationship the person is looking for. The value can be
268+-- custom or predefined. Possible values include, but are not limited to,
269+-- the following values: * \`friend\` * \`date\` * \`relationship\` *
271+riValue :: Lens' RelationshipInterest (Maybe Text)
272+riValue = lens _riValue (\ s a -> s{_riValue = a})
274+-- | Metadata about the relationship interest.
275+riMetadata :: Lens' RelationshipInterest (Maybe FieldMetadata)
277+ = lens _riMetadata (\ s a -> s{_riMetadata = a})
279+-- | The value of the relationship interest translated and formatted in the
280+-- viewer\'s account locale or the locale specified in the Accept-Language
282+riFormattedValue :: Lens' RelationshipInterest (Maybe Text)
284+ = lens _riFormattedValue
285+ (\ s a -> s{_riFormattedValue = a})
287+instance FromJSON RelationshipInterest where
289+ = withObject "RelationshipInterest"
291+ RelationshipInterest <$>
292+ (o .:? "value") <*> (o .:? "metadata") <*>
293+ (o .:? "formattedValue"))
295+instance ToJSON RelationshipInterest where
296+ toJSON RelationshipInterest{..}
299+ [("value" .=) <$> _riValue,
300+ ("metadata" .=) <$> _riMetadata,
301+ ("formattedValue" .=) <$> _riFormattedValue])
303+-- | A person\'s bragging rights.
305+-- /See:/ 'braggingRights' smart constructor.
306+data BraggingRights = BraggingRights
307+ { _brValue :: !(Maybe Text)
308+ , _brMetadata :: !(Maybe FieldMetadata)
309+ } deriving (Eq,Show,Data,Typeable,Generic)
311+-- | Creates a value of 'BraggingRights' with the minimum fields required to make a request.
313+-- Use one of the following lenses to modify other fields as desired:
322+ { _brValue = Nothing
323+ , _brMetadata = Nothing
326+-- | The bragging rights; for example, \`climbed mount everest\`.
327+brValue :: Lens' BraggingRights (Maybe Text)
328+brValue = lens _brValue (\ s a -> s{_brValue = a})
330+-- | Metadata about the bragging rights.
331+brMetadata :: Lens' BraggingRights (Maybe FieldMetadata)
333+ = lens _brMetadata (\ s a -> s{_brMetadata = a})
335+instance FromJSON BraggingRights where
337+ = withObject "BraggingRights"
340+ (o .:? "value") <*> (o .:? "metadata"))
342+instance ToJSON BraggingRights where
343+ toJSON BraggingRights{..}
346+ [("value" .=) <$> _brValue,
347+ ("metadata" .=) <$> _brMetadata])
349+-- | A person\'s membership in a group.
351+-- /See:/ 'membership' smart constructor.
352+data Membership = Membership
353+ { _mDomainMembership :: !(Maybe DomainMembership)
354+ , _mContactGroupMembership :: !(Maybe ContactGroupMembership)
355+ , _mMetadata :: !(Maybe FieldMetadata)
356+ } deriving (Eq,Show,Data,Typeable,Generic)
358+-- | Creates a value of 'Membership' with the minimum fields required to make a request.
360+-- Use one of the following lenses to modify other fields as desired:
362+-- * 'mDomainMembership'
364+-- * 'mContactGroupMembership'
371+ { _mDomainMembership = Nothing
372+ , _mContactGroupMembership = Nothing
373+ , _mMetadata = Nothing
376+-- | The domain membership.
377+mDomainMembership :: Lens' Membership (Maybe DomainMembership)
379+ = lens _mDomainMembership
380+ (\ s a -> s{_mDomainMembership = a})
382+-- | The contact group membership.
383+mContactGroupMembership :: Lens' Membership (Maybe ContactGroupMembership)
384+mContactGroupMembership
385+ = lens _mContactGroupMembership
386+ (\ s a -> s{_mContactGroupMembership = a})
388+-- | Metadata about the membership.
389+mMetadata :: Lens' Membership (Maybe FieldMetadata)
391+ = lens _mMetadata (\ s a -> s{_mMetadata = a})
393+instance FromJSON Membership where
395+ = withObject "Membership"
398+ (o .:? "domainMembership") <*>
399+ (o .:? "contactGroupMembership")
400+ <*> (o .:? "metadata"))
402+instance ToJSON Membership where
403+ toJSON Membership{..}
406+ [("domainMembership" .=) <$> _mDomainMembership,
407+ ("contactGroupMembership" .=) <$>
408+ _mContactGroupMembership,
409+ ("metadata" .=) <$> _mMetadata])
411+-- | Information about a person merged from various data sources such as the
412+-- authenticated user\'s contacts and profile data. Fields other than IDs,
413+-- metadata, and group memberships are user-edited. Most fields can have
414+-- multiple items. The items in a field have no guaranteed order, but each
415+-- non-empty field is guaranteed to have exactly one field with
416+-- \`metadata.primary\` set to true.
418+-- /See:/ 'person' smart constructor.
420+ { _perEmailAddresses :: !(Maybe [EmailAddress])
421+ , _perAgeRange :: !(Maybe Text)
422+ , _perEtag :: !(Maybe Text)
423+ , _perResidences :: !(Maybe [Residence])
424+ , _perBiographies :: !(Maybe [Biography])
425+ , _perTaglines :: !(Maybe [Tagline])
426+ , _perBraggingRights :: !(Maybe [BraggingRights])
427+ , _perBirthdays :: !(Maybe [Birthday])
428+ , _perResourceName :: !(Maybe Text)
429+ , _perRelations :: !(Maybe [Relation])
430+ , _perURLs :: !(Maybe [URL])
431+ , _perAddresses :: !(Maybe [Address])
432+ , _perNicknames :: !(Maybe [Nickname])
433+ , _perRelationshipStatuses :: !(Maybe [RelationshipStatus])
434+ , _perImClients :: !(Maybe [ImClient])
435+ , _perPhoneNumbers :: !(Maybe [PhoneNumber])
436+ , _perOccupations :: !(Maybe [Occupation])
437+ , _perNames :: !(Maybe [Name])
438+ , _perGenders :: !(Maybe [Gender])
439+ , _perPhotos :: !(Maybe [Photo])
440+ , _perEvents :: !(Maybe [Event])
441+ , _perCoverPhotos :: !(Maybe [CoverPhoto])
442+ , _perSkills :: !(Maybe [Skill])
443+ , _perMetadata :: !(Maybe PersonMetadata)
444+ , _perInterests :: !(Maybe [Interest])
445+ , _perOrganizations :: !(Maybe [Organization])
446+ , _perLocales :: !(Maybe [Locale])
447+ , _perMemberships :: !(Maybe [Membership])
448+ , _perRelationshipInterests :: !(Maybe [RelationshipInterest])
449+ } deriving (Eq,Show,Data,Typeable,Generic)
451+-- | Creates a value of 'Person' with the minimum fields required to make a request.
453+-- Use one of the following lenses to modify other fields as desired:
455+-- * 'perEmailAddresses'
463+-- * 'perBiographies'
467+-- * 'perBraggingRights'
471+-- * 'perResourceName'
481+-- * 'perRelationshipStatuses'
485+-- * 'perPhoneNumbers'
487+-- * 'perOccupations'
497+-- * 'perCoverPhotos'
505+-- * 'perOrganizations'
509+-- * 'perMemberships'
511+-- * 'perRelationshipInterests'
516+ { _perEmailAddresses = Nothing
517+ , _perAgeRange = Nothing
518+ , _perEtag = Nothing
519+ , _perResidences = Nothing
520+ , _perBiographies = Nothing
521+ , _perTaglines = Nothing
522+ , _perBraggingRights = Nothing
523+ , _perBirthdays = Nothing
524+ , _perResourceName = Nothing
525+ , _perRelations = Nothing
526+ , _perURLs = Nothing
527+ , _perAddresses = Nothing
528+ , _perNicknames = Nothing
529+ , _perRelationshipStatuses = Nothing
530+ , _perImClients = Nothing
531+ , _perPhoneNumbers = Nothing
532+ , _perOccupations = Nothing
533+ , _perNames = Nothing
534+ , _perGenders = Nothing
535+ , _perPhotos = Nothing
536+ , _perEvents = Nothing
537+ , _perCoverPhotos = Nothing
538+ , _perSkills = Nothing
539+ , _perMetadata = Nothing
540+ , _perInterests = Nothing
541+ , _perOrganizations = Nothing
542+ , _perLocales = Nothing
543+ , _perMemberships = Nothing
544+ , _perRelationshipInterests = Nothing
547+-- | The person\'s email addresses.
548+perEmailAddresses :: Lens' Person [EmailAddress]
550+ = lens _perEmailAddresses
551+ (\ s a -> s{_perEmailAddresses = a})
555+-- | The person\'s age range.
556+perAgeRange :: Lens' Person (Maybe Text)
558+ = lens _perAgeRange (\ s a -> s{_perAgeRange = a})
560+-- | The [HTTP entity tag](https:\/\/en.wikipedia.org\/wiki\/HTTP_ETag) of
561+-- the resource. Used for web cache validation.
562+perEtag :: Lens' Person (Maybe Text)
563+perEtag = lens _perEtag (\ s a -> s{_perEtag = a})
565+-- | The person\'s residences.
566+perResidences :: Lens' Person [Residence]
568+ = lens _perResidences
569+ (\ s a -> s{_perResidences = a})
573+-- | The person\'s biographies.
574+perBiographies :: Lens' Person [Biography]
576+ = lens _perBiographies
577+ (\ s a -> s{_perBiographies = a})
581+-- | The person\'s taglines.
582+perTaglines :: Lens' Person [Tagline]
584+ = lens _perTaglines (\ s a -> s{_perTaglines = a}) .
588+-- | The person\'s bragging rights.
589+perBraggingRights :: Lens' Person [BraggingRights]
591+ = lens _perBraggingRights
592+ (\ s a -> s{_perBraggingRights = a})
596+-- | The person\'s birthdays.
597+perBirthdays :: Lens' Person [Birthday]
599+ = lens _perBirthdays (\ s a -> s{_perBirthdays = a})
603+-- | The resource name for the person, assigned by the server. An ASCII
604+-- string with a max length of 27 characters. Always starts with
606+perResourceName :: Lens' Person (Maybe Text)
608+ = lens _perResourceName
609+ (\ s a -> s{_perResourceName = a})
611+-- | The person\'s relations.
612+perRelations :: Lens' Person [Relation]
614+ = lens _perRelations (\ s a -> s{_perRelations = a})
618+-- | The person\'s associated URLs.
619+perURLs :: Lens' Person [URL]
621+ = lens _perURLs (\ s a -> s{_perURLs = a}) . _Default
624+-- | The person\'s street addresses.
625+perAddresses :: Lens' Person [Address]
627+ = lens _perAddresses (\ s a -> s{_perAddresses = a})
631+-- | The person\'s nicknames.
632+perNicknames :: Lens' Person [Nickname]
634+ = lens _perNicknames (\ s a -> s{_perNicknames = a})
638+-- | The person\'s relationship statuses.
639+perRelationshipStatuses :: Lens' Person [RelationshipStatus]
640+perRelationshipStatuses
641+ = lens _perRelationshipStatuses
642+ (\ s a -> s{_perRelationshipStatuses = a})
646+-- | The person\'s instant messaging clients.
647+perImClients :: Lens' Person [ImClient]
649+ = lens _perImClients (\ s a -> s{_perImClients = a})
653+-- | The person\'s phone numbers.
654+perPhoneNumbers :: Lens' Person [PhoneNumber]
656+ = lens _perPhoneNumbers
657+ (\ s a -> s{_perPhoneNumbers = a})
661+-- | The person\'s occupations.
662+perOccupations :: Lens' Person [Occupation]
664+ = lens _perOccupations
665+ (\ s a -> s{_perOccupations = a})
669+-- | The person\'s names.
670+perNames :: Lens' Person [Name]
672+ = lens _perNames (\ s a -> s{_perNames = a}) .
676+-- | The person\'s genders.
677+perGenders :: Lens' Person [Gender]
679+ = lens _perGenders (\ s a -> s{_perGenders = a}) .
683+-- | The person\'s photos.
684+perPhotos :: Lens' Person [Photo]
686+ = lens _perPhotos (\ s a -> s{_perPhotos = a}) .
690+-- | The person\'s events.
691+perEvents :: Lens' Person [Event]
693+ = lens _perEvents (\ s a -> s{_perEvents = a}) .
697+-- | The person\'s cover photos.
698+perCoverPhotos :: Lens' Person [CoverPhoto]
700+ = lens _perCoverPhotos
701+ (\ s a -> s{_perCoverPhotos = a})
705+-- | The person\'s skills.
706+perSkills :: Lens' Person [Skill]
708+ = lens _perSkills (\ s a -> s{_perSkills = a}) .
712+-- | Metadata about the person.
713+perMetadata :: Lens' Person (Maybe PersonMetadata)
715+ = lens _perMetadata (\ s a -> s{_perMetadata = a})
717+-- | The person\'s interests.
718+perInterests :: Lens' Person [Interest]
720+ = lens _perInterests (\ s a -> s{_perInterests = a})
724+-- | The person\'s past or current organizations.
725+perOrganizations :: Lens' Person [Organization]
727+ = lens _perOrganizations
728+ (\ s a -> s{_perOrganizations = a})
732+-- | The person\'s locale preferences.
733+perLocales :: Lens' Person [Locale]
735+ = lens _perLocales (\ s a -> s{_perLocales = a}) .
739+-- | The person\'s group memberships.
740+perMemberships :: Lens' Person [Membership]
742+ = lens _perMemberships
743+ (\ s a -> s{_perMemberships = a})
747+-- | The kind of relationship the person is looking for.
748+perRelationshipInterests :: Lens' Person [RelationshipInterest]
749+perRelationshipInterests
750+ = lens _perRelationshipInterests
751+ (\ s a -> s{_perRelationshipInterests = a})
755+instance FromJSON Person where
757+ = withObject "Person"
760+ (o .:? "emailAddresses" .!= mempty) <*>
763+ <*> (o .:? "residences" .!= mempty)
764+ <*> (o .:? "biographies" .!= mempty)
765+ <*> (o .:? "taglines" .!= mempty)
766+ <*> (o .:? "braggingRights" .!= mempty)
767+ <*> (o .:? "birthdays" .!= mempty)
768+ <*> (o .:? "resourceName")
769+ <*> (o .:? "relations" .!= mempty)
770+ <*> (o .:? "urls" .!= mempty)
771+ <*> (o .:? "addresses" .!= mempty)
772+ <*> (o .:? "nicknames" .!= mempty)
773+ <*> (o .:? "relationshipStatuses" .!= mempty)
774+ <*> (o .:? "imClients" .!= mempty)
775+ <*> (o .:? "phoneNumbers" .!= mempty)
776+ <*> (o .:? "occupations" .!= mempty)
777+ <*> (o .:? "names" .!= mempty)
778+ <*> (o .:? "genders" .!= mempty)
779+ <*> (o .:? "photos" .!= mempty)
780+ <*> (o .:? "events" .!= mempty)
781+ <*> (o .:? "coverPhotos" .!= mempty)
782+ <*> (o .:? "skills" .!= mempty)
783+ <*> (o .:? "metadata")
784+ <*> (o .:? "interests" .!= mempty)
785+ <*> (o .:? "organizations" .!= mempty)
786+ <*> (o .:? "locales" .!= mempty)
787+ <*> (o .:? "memberships" .!= mempty)
788+ <*> (o .:? "relationshipInterests" .!= mempty))
790+instance ToJSON Person where
794+ [("emailAddresses" .=) <$> _perEmailAddresses,
795+ ("ageRange" .=) <$> _perAgeRange,
796+ ("etag" .=) <$> _perEtag,
797+ ("residences" .=) <$> _perResidences,
798+ ("biographies" .=) <$> _perBiographies,
799+ ("taglines" .=) <$> _perTaglines,
800+ ("braggingRights" .=) <$> _perBraggingRights,
801+ ("birthdays" .=) <$> _perBirthdays,
802+ ("resourceName" .=) <$> _perResourceName,
803+ ("relations" .=) <$> _perRelations,
804+ ("urls" .=) <$> _perURLs,
805+ ("addresses" .=) <$> _perAddresses,
806+ ("nicknames" .=) <$> _perNicknames,
807+ ("relationshipStatuses" .=) <$>
808+ _perRelationshipStatuses,
809+ ("imClients" .=) <$> _perImClients,
810+ ("phoneNumbers" .=) <$> _perPhoneNumbers,
811+ ("occupations" .=) <$> _perOccupations,
812+ ("names" .=) <$> _perNames,
813+ ("genders" .=) <$> _perGenders,
814+ ("photos" .=) <$> _perPhotos,
815+ ("events" .=) <$> _perEvents,
816+ ("coverPhotos" .=) <$> _perCoverPhotos,
817+ ("skills" .=) <$> _perSkills,
818+ ("metadata" .=) <$> _perMetadata,
819+ ("interests" .=) <$> _perInterests,
820+ ("organizations" .=) <$> _perOrganizations,
821+ ("locales" .=) <$> _perLocales,
822+ ("memberships" .=) <$> _perMemberships,
823+ ("relationshipInterests" .=) <$>
824+ _perRelationshipInterests])
826+-- | A Google contact group membership.
828+-- /See:/ 'contactGroupMembership' smart constructor.
829+newtype ContactGroupMembership = ContactGroupMembership
830+ { _cgmContactGroupId :: Maybe Text
831+ } deriving (Eq,Show,Data,Typeable,Generic)
833+-- | Creates a value of 'ContactGroupMembership' with the minimum fields required to make a request.
835+-- Use one of the following lenses to modify other fields as desired:
837+-- * 'cgmContactGroupId'
838+contactGroupMembership
839+ :: ContactGroupMembership
840+contactGroupMembership =
841+ ContactGroupMembership
842+ { _cgmContactGroupId = Nothing
845+-- | The contact group ID for the contact group membership. The contact group
846+-- ID can be custom or predefined. Possible values include, but are not
847+-- limited to, the following: * \`myContacts\` * \`starred\` * A numerical
848+-- ID for user-created groups.
849+cgmContactGroupId :: Lens' ContactGroupMembership (Maybe Text)
851+ = lens _cgmContactGroupId
852+ (\ s a -> s{_cgmContactGroupId = a})
854+instance FromJSON ContactGroupMembership where
856+ = withObject "ContactGroupMembership"
858+ ContactGroupMembership <$> (o .:? "contactGroupId"))
860+instance ToJSON ContactGroupMembership where
861+ toJSON ContactGroupMembership{..}
864+ [("contactGroupId" .=) <$> _cgmContactGroupId])
866+-- | A person\'s locale preference.
868+-- /See:/ 'locale' smart constructor.
870+ { _lValue :: !(Maybe Text)
871+ , _lMetadata :: !(Maybe FieldMetadata)
872+ } deriving (Eq,Show,Data,Typeable,Generic)
874+-- | Creates a value of 'Locale' with the minimum fields required to make a request.
876+-- Use one of the following lenses to modify other fields as desired:
886+ , _lMetadata = Nothing
889+-- | The well-formed [IETF BCP 47](https:\/\/tools.ietf.org\/html\/bcp47)
890+-- language tag representing the locale.
891+lValue :: Lens' Locale (Maybe Text)
892+lValue = lens _lValue (\ s a -> s{_lValue = a})
894+-- | Metadata about the locale.
895+lMetadata :: Lens' Locale (Maybe FieldMetadata)
897+ = lens _lMetadata (\ s a -> s{_lMetadata = a})
899+instance FromJSON Locale where
901+ = withObject "Locale"
903+ Locale <$> (o .:? "value") <*> (o .:? "metadata"))
905+instance ToJSON Locale where
909+ [("value" .=) <$> _lValue,
910+ ("metadata" .=) <$> _lMetadata])
912+-- | A person\'s relationship status.
914+-- /See:/ 'relationshipStatus' smart constructor.
915+data RelationshipStatus = RelationshipStatus
916+ { _rsValue :: !(Maybe Text)
917+ , _rsMetadata :: !(Maybe FieldMetadata)
918+ , _rsFormattedValue :: !(Maybe Text)
919+ } deriving (Eq,Show,Data,Typeable,Generic)
921+-- | Creates a value of 'RelationshipStatus' with the minimum fields required to make a request.
923+-- Use one of the following lenses to modify other fields as desired:
929+-- * 'rsFormattedValue'
931+ :: RelationshipStatus
934+ { _rsValue = Nothing
935+ , _rsMetadata = Nothing
936+ , _rsFormattedValue = Nothing
939+-- | The relationship status. The value can be custom or predefined. Possible
940+-- values include, but are not limited to, the following: * \`single\` *
941+-- \`inARelationship\` * \`engaged\` * \`married\` * \`itsComplicated\` *
942+-- \`openRelationship\` * \`widowed\` * \`inDomesticPartnership\` *
944+rsValue :: Lens' RelationshipStatus (Maybe Text)
945+rsValue = lens _rsValue (\ s a -> s{_rsValue = a})
947+-- | Metadata about the relationship status.
948+rsMetadata :: Lens' RelationshipStatus (Maybe FieldMetadata)
950+ = lens _rsMetadata (\ s a -> s{_rsMetadata = a})
952+-- | The read-only value of the relationship status translated and formatted
953+-- in the viewer\'s account locale or the \`Accept-Language\` HTTP header
955+rsFormattedValue :: Lens' RelationshipStatus (Maybe Text)
957+ = lens _rsFormattedValue
958+ (\ s a -> s{_rsFormattedValue = a})
960+instance FromJSON RelationshipStatus where
962+ = withObject "RelationshipStatus"
964+ RelationshipStatus <$>
965+ (o .:? "value") <*> (o .:? "metadata") <*>
966+ (o .:? "formattedValue"))
968+instance ToJSON RelationshipStatus where
969+ toJSON RelationshipStatus{..}
972+ [("value" .=) <$> _rsValue,
973+ ("metadata" .=) <$> _rsMetadata,
974+ ("formattedValue" .=) <$> _rsFormattedValue])
976+-- | A person\'s associated URLs.
978+-- /See:/ 'url' smart constructor.
980+ { _uValue :: !(Maybe Text)
981+ , _uMetadata :: !(Maybe FieldMetadata)
982+ , _uType :: !(Maybe Text)
983+ , _uFormattedType :: !(Maybe Text)
984+ } deriving (Eq,Show,Data,Typeable,Generic)
986+-- | Creates a value of 'URL' with the minimum fields required to make a request.
988+-- Use one of the following lenses to modify other fields as desired:
996+-- * 'uFormattedType'
1001+ { _uValue = Nothing
1002+ , _uMetadata = Nothing
1004+ , _uFormattedType = Nothing
1008+uValue :: Lens' URL (Maybe Text)
1009+uValue = lens _uValue (\ s a -> s{_uValue = a})
1011+-- | Metadata about the URL.
1012+uMetadata :: Lens' URL (Maybe FieldMetadata)
1014+ = lens _uMetadata (\ s a -> s{_uMetadata = a})
1016+-- | The type of the URL. The type can be custom or predefined. Possible
1017+-- values include, but are not limited to, the following: * \`home\` *
1018+-- \`work\` * \`blog\` * \`profile\` * \`homePage\` * \`ftp\` *
1019+-- \`reservations\` * \`appInstallPage\`: website for a Google+
1020+-- application. * \`other\`
1021+uType :: Lens' URL (Maybe Text)
1022+uType = lens _uType (\ s a -> s{_uType = a})
1024+-- | The read-only type of the URL translated and formatted in the viewer\'s
1025+-- account locale or the \`Accept-Language\` HTTP header locale.
1026+uFormattedType :: Lens' URL (Maybe Text)
1028+ = lens _uFormattedType
1029+ (\ s a -> s{_uFormattedType = a})
1031+instance FromJSON URL where
1036+ (o .:? "value") <*> (o .:? "metadata") <*>
1038+ <*> (o .:? "formattedType"))
1040+instance ToJSON URL where
1044+ [("value" .=) <$> _uValue,
1045+ ("metadata" .=) <$> _uMetadata,
1046+ ("type" .=) <$> _uType,
1047+ ("formattedType" .=) <$> _uFormattedType])
1049+-- | A person\'s physical address. May be a P.O. box or street address. All
1050+-- fields are optional.
1052+-- /See:/ 'address' smart constructor.
1053+data Address = Address
1054+ { _aStreetAddress :: !(Maybe Text)
1055+ , _aPoBox :: !(Maybe Text)
1056+ , _aCountry :: !(Maybe Text)
1057+ , _aPostalCode :: !(Maybe Text)
1058+ , _aExtendedAddress :: !(Maybe Text)
1059+ , _aCity :: !(Maybe Text)
1060+ , _aMetadata :: !(Maybe FieldMetadata)
1061+ , _aCountryCode :: !(Maybe Text)
1062+ , _aFormattedValue :: !(Maybe Text)
1063+ , _aRegion :: !(Maybe Text)
1064+ , _aType :: !(Maybe Text)
1065+ , _aFormattedType :: !(Maybe Text)
1066+ } deriving (Eq,Show,Data,Typeable,Generic)
1068+-- | Creates a value of 'Address' with the minimum fields required to make a request.
1070+-- Use one of the following lenses to modify other fields as desired:
1072+-- * 'aStreetAddress'
1080+-- * 'aExtendedAddress'
1088+-- * 'aFormattedValue'
1094+-- * 'aFormattedType'
1099+ { _aStreetAddress = Nothing
1100+ , _aPoBox = Nothing
1101+ , _aCountry = Nothing
1102+ , _aPostalCode = Nothing
1103+ , _aExtendedAddress = Nothing
1105+ , _aMetadata = Nothing
1106+ , _aCountryCode = Nothing
1107+ , _aFormattedValue = Nothing
1108+ , _aRegion = Nothing
1110+ , _aFormattedType = Nothing
1113+-- | The street address.
1114+aStreetAddress :: Lens' Address (Maybe Text)
1116+ = lens _aStreetAddress
1117+ (\ s a -> s{_aStreetAddress = a})
1119+-- | The P.O. box of the address.
1120+aPoBox :: Lens' Address (Maybe Text)
1121+aPoBox = lens _aPoBox (\ s a -> s{_aPoBox = a})
1123+-- | The country of the address.
1124+aCountry :: Lens' Address (Maybe Text)
1125+aCountry = lens _aCountry (\ s a -> s{_aCountry = a})
1127+-- | The postal code of the address.
1128+aPostalCode :: Lens' Address (Maybe Text)
1130+ = lens _aPostalCode (\ s a -> s{_aPostalCode = a})
1132+-- | The extended address of the address; for example, the apartment number.
1133+aExtendedAddress :: Lens' Address (Maybe Text)
1135+ = lens _aExtendedAddress
1136+ (\ s a -> s{_aExtendedAddress = a})
1138+-- | The city of the address.
1139+aCity :: Lens' Address (Maybe Text)
1140+aCity = lens _aCity (\ s a -> s{_aCity = a})
1142+-- | Metadata about the address.
1143+aMetadata :: Lens' Address (Maybe FieldMetadata)
1145+ = lens _aMetadata (\ s a -> s{_aMetadata = a})
1147+-- | The [ISO 3166-1 alpha-2](http:\/\/www.iso.org\/iso\/country_codes.htm)
1148+-- country code of the address.
1149+aCountryCode :: Lens' Address (Maybe Text)
1151+ = lens _aCountryCode (\ s a -> s{_aCountryCode = a})
1153+-- | The read-only value of the address formatted in the viewer\'s account
1154+-- locale or the \`Accept-Language\` HTTP header locale.
1155+aFormattedValue :: Lens' Address (Maybe Text)
1157+ = lens _aFormattedValue
1158+ (\ s a -> s{_aFormattedValue = a})
1160+-- | The region of the address; for example, the state or province.
1161+aRegion :: Lens' Address (Maybe Text)
1162+aRegion = lens _aRegion (\ s a -> s{_aRegion = a})
1164+-- | The type of the address. The type can be custom or predefined. Possible
1165+-- values include, but are not limited to, the following: * \`home\` *
1166+-- \`work\` * \`other\`
1167+aType :: Lens' Address (Maybe Text)
1168+aType = lens _aType (\ s a -> s{_aType = a})
1170+-- | The read-only type of the address translated and formatted in the
1171+-- viewer\'s account locale or the \`Accept-Language\` HTTP header locale.
1172+aFormattedType :: Lens' Address (Maybe Text)
1174+ = lens _aFormattedType
1175+ (\ s a -> s{_aFormattedType = a})
1177+instance FromJSON Address where
1179+ = withObject "Address"
1182+ (o .:? "streetAddress") <*> (o .:? "poBox") <*>
1184+ <*> (o .:? "postalCode")
1185+ <*> (o .:? "extendedAddress")
1187+ <*> (o .:? "metadata")
1188+ <*> (o .:? "countryCode")
1189+ <*> (o .:? "formattedValue")
1190+ <*> (o .:? "region")
1192+ <*> (o .:? "formattedType"))
1194+instance ToJSON Address where
1198+ [("streetAddress" .=) <$> _aStreetAddress,
1199+ ("poBox" .=) <$> _aPoBox,
1200+ ("country" .=) <$> _aCountry,
1201+ ("postalCode" .=) <$> _aPostalCode,
1202+ ("extendedAddress" .=) <$> _aExtendedAddress,
1203+ ("city" .=) <$> _aCity,
1204+ ("metadata" .=) <$> _aMetadata,
1205+ ("countryCode" .=) <$> _aCountryCode,
1206+ ("formattedValue" .=) <$> _aFormattedValue,
1207+ ("region" .=) <$> _aRegion, ("type" .=) <$> _aType,
1208+ ("formattedType" .=) <$> _aFormattedType])
1210+-- | A person\'s relation to another person.
1212+-- /See:/ 'relation' smart constructor.
1213+data Relation = Relation
1214+ { _rPerson :: !(Maybe Text)
1215+ , _rMetadata :: !(Maybe FieldMetadata)
1216+ , _rType :: !(Maybe Text)
1217+ , _rFormattedType :: !(Maybe Text)
1218+ } deriving (Eq,Show,Data,Typeable,Generic)
1220+-- | Creates a value of 'Relation' with the minimum fields required to make a request.
1222+-- Use one of the following lenses to modify other fields as desired:
1230+-- * 'rFormattedType'
1235+ { _rPerson = Nothing
1236+ , _rMetadata = Nothing
1238+ , _rFormattedType = Nothing
1241+-- | The name of the other person this relation refers to.
1242+rPerson :: Lens' Relation (Maybe Text)
1243+rPerson = lens _rPerson (\ s a -> s{_rPerson = a})
1245+-- | Metadata about the relation.
1246+rMetadata :: Lens' Relation (Maybe FieldMetadata)
1248+ = lens _rMetadata (\ s a -> s{_rMetadata = a})
1250+-- | The person\'s relation to the other person. The type can be custom or
1251+-- predefined. Possible values include, but are not limited to, the
1252+-- following values: * \`spouse\` * \`child\` * \`mother\` * \`father\` *
1253+-- \`parent\` * \`brother\` * \`sister\` * \`friend\` * \`relative\` *
1254+-- \`domesticPartner\` * \`manager\` * \`assistant\` * \`referredBy\` *
1256+rType :: Lens' Relation (Maybe Text)
1257+rType = lens _rType (\ s a -> s{_rType = a})
1259+-- | The type of the relation translated and formatted in the viewer\'s
1260+-- account locale or the locale specified in the Accept-Language HTTP
1262+rFormattedType :: Lens' Relation (Maybe Text)
1264+ = lens _rFormattedType
1265+ (\ s a -> s{_rFormattedType = a})
1267+instance FromJSON Relation where
1269+ = withObject "Relation"
1272+ (o .:? "person") <*> (o .:? "metadata") <*>
1274+ <*> (o .:? "formattedType"))
1276+instance ToJSON Relation where
1277+ toJSON Relation{..}
1280+ [("person" .=) <$> _rPerson,
1281+ ("metadata" .=) <$> _rMetadata,
1282+ ("type" .=) <$> _rType,
1283+ ("formattedType" .=) <$> _rFormattedType])
1286+-- /See:/ 'getPeopleResponse' smart constructor.
1287+newtype GetPeopleResponse = GetPeopleResponse
1288+ { _gprResponses :: Maybe [PersonResponse]
1289+ } deriving (Eq,Show,Data,Typeable,Generic)
1291+-- | Creates a value of 'GetPeopleResponse' with the minimum fields required to make a request.
1293+-- Use one of the following lenses to modify other fields as desired:
1297+ :: GetPeopleResponse
1300+ { _gprResponses = Nothing
1303+-- | The response for each requested resource name.
1304+gprResponses :: Lens' GetPeopleResponse [PersonResponse]
1306+ = lens _gprResponses (\ s a -> s{_gprResponses = a})
1310+instance FromJSON GetPeopleResponse where
1312+ = withObject "GetPeopleResponse"
1314+ GetPeopleResponse <$> (o .:? "responses" .!= mempty))
1316+instance ToJSON GetPeopleResponse where
1317+ toJSON GetPeopleResponse{..}
1319+ (catMaybes [("responses" .=) <$> _gprResponses])
1321+-- | A person\'s birthday. At least one of the \`date\` and \`text\` fields
1322+-- are specified. The \`date\` and \`text\` fields typically represent the
1323+-- same date, but are not guaranteed to.
1325+-- /See:/ 'birthday' smart constructor.
1326+data Birthday = Birthday
1327+ { _bText :: !(Maybe Text)
1328+ , _bDate :: !(Maybe Date)
1329+ , _bMetadata :: !(Maybe FieldMetadata)
1330+ } deriving (Eq,Show,Data,Typeable,Generic)
1332+-- | Creates a value of 'Birthday' with the minimum fields required to make a request.
1334+-- Use one of the following lenses to modify other fields as desired:
1347+ , _bMetadata = Nothing
1350+-- | A free-form string representing the user\'s birthday.
1351+bText :: Lens' Birthday (Maybe Text)
1352+bText = lens _bText (\ s a -> s{_bText = a})
1354+-- | The date of the birthday.
1355+bDate :: Lens' Birthday (Maybe Date)
1356+bDate = lens _bDate (\ s a -> s{_bDate = a})
1358+-- | Metadata about the birthday.
1359+bMetadata :: Lens' Birthday (Maybe FieldMetadata)
1361+ = lens _bMetadata (\ s a -> s{_bMetadata = a})
1363+instance FromJSON Birthday where
1365+ = withObject "Birthday"
1368+ (o .:? "text") <*> (o .:? "date") <*>
1369+ (o .:? "metadata"))
1371+instance ToJSON Birthday where
1372+ toJSON Birthday{..}
1375+ [("text" .=) <$> _bText, ("date" .=) <$> _bDate,
1376+ ("metadata" .=) <$> _bMetadata])
1378+-- | Represents a whole calendar date, for example a date of birth. The time
1379+-- of day and time zone are either specified elsewhere or are not
1380+-- significant. The date is relative to the [Proleptic Gregorian
1381+-- Calendar](https:\/\/en.wikipedia.org\/wiki\/Proleptic_Gregorian_calendar).
1382+-- The day may be 0 to represent a year and month where the day is not
1383+-- significant. The year may be 0 to represent a month and day independent
1384+-- of year; for example, anniversary date.
1386+-- /See:/ 'date' smart constructor.
1388+ { _dDay :: !(Maybe (Textual Int32))
1389+ , _dYear :: !(Maybe (Textual Int32))
1390+ , _dMonth :: !(Maybe (Textual Int32))
1391+ } deriving (Eq,Show,Data,Typeable,Generic)
1393+-- | Creates a value of 'Date' with the minimum fields required to make a request.
1395+-- Use one of the following lenses to modify other fields as desired:
1408+ , _dMonth = Nothing
1411+-- | Day of month. Must be from 1 to 31 and valid for the year and month, or
1412+-- 0 if specifying a year\/month where the day is not significant.
1413+dDay :: Lens' Date (Maybe Int32)
1415+ = lens _dDay (\ s a -> s{_dDay = a}) .
1418+-- | Year of date. Must be from 1 to 9999, or 0 if specifying a date without
1420+dYear :: Lens' Date (Maybe Int32)
1422+ = lens _dYear (\ s a -> s{_dYear = a}) .
1425+-- | Month of year. Must be from 1 to 12.
1426+dMonth :: Lens' Date (Maybe Int32)
1428+ = lens _dMonth (\ s a -> s{_dMonth = a}) .
1431+instance FromJSON Date where
1433+ = withObject "Date"
1436+ (o .:? "day") <*> (o .:? "year") <*> (o .:? "month"))
1438+instance ToJSON Date where
1442+ [("day" .=) <$> _dDay, ("year" .=) <$> _dYear,
1443+ ("month" .=) <$> _dMonth])
1445+-- | A brief one-line description of the person.
1447+-- /See:/ 'tagline' smart constructor.
1448+data Tagline = Tagline
1449+ { _tValue :: !(Maybe Text)
1450+ , _tMetadata :: !(Maybe FieldMetadata)
1451+ } deriving (Eq,Show,Data,Typeable,Generic)
1453+-- | Creates a value of 'Tagline' with the minimum fields required to make a request.
1455+-- Use one of the following lenses to modify other fields as desired:
1464+ { _tValue = Nothing
1465+ , _tMetadata = Nothing
1469+tValue :: Lens' Tagline (Maybe Text)
1470+tValue = lens _tValue (\ s a -> s{_tValue = a})
1472+-- | Metadata about the tagline.
1473+tMetadata :: Lens' Tagline (Maybe FieldMetadata)
1475+ = lens _tMetadata (\ s a -> s{_tMetadata = a})
1477+instance FromJSON Tagline where
1479+ = withObject "Tagline"
1481+ Tagline <$> (o .:? "value") <*> (o .:? "metadata"))
1483+instance ToJSON Tagline where
1487+ [("value" .=) <$> _tValue,
1488+ ("metadata" .=) <$> _tMetadata])
1490+-- | A person\'s past or current residence.
1492+-- /See:/ 'residence' smart constructor.
1493+data Residence = Residence
1494+ { _resValue :: !(Maybe Text)
1495+ , _resCurrent :: !(Maybe Bool)
1496+ , _resMetadata :: !(Maybe FieldMetadata)
1497+ } deriving (Eq,Show,Data,Typeable,Generic)
1499+-- | Creates a value of 'Residence' with the minimum fields required to make a request.
1501+-- Use one of the following lenses to modify other fields as desired:
1512+ { _resValue = Nothing
1513+ , _resCurrent = Nothing
1514+ , _resMetadata = Nothing
1517+-- | The address of the residence.
1518+resValue :: Lens' Residence (Maybe Text)
1519+resValue = lens _resValue (\ s a -> s{_resValue = a})
1521+-- | True if the residence is the person\'s current residence; false if the
1522+-- residence is a past residence.
1523+resCurrent :: Lens' Residence (Maybe Bool)
1525+ = lens _resCurrent (\ s a -> s{_resCurrent = a})
1527+-- | Metadata about the residence.
1528+resMetadata :: Lens' Residence (Maybe FieldMetadata)
1530+ = lens _resMetadata (\ s a -> s{_resMetadata = a})
1532+instance FromJSON Residence where
1534+ = withObject "Residence"
1537+ (o .:? "value") <*> (o .:? "current") <*>
1538+ (o .:? "metadata"))
1540+instance ToJSON Residence where
1541+ toJSON Residence{..}
1544+ [("value" .=) <$> _resValue,
1545+ ("current" .=) <$> _resCurrent,
1546+ ("metadata" .=) <$> _resMetadata])
1548+-- | A person\'s gender.
1550+-- /See:/ 'gender' smart constructor.
1551+data Gender = Gender
1552+ { _gValue :: !(Maybe Text)
1553+ , _gMetadata :: !(Maybe FieldMetadata)
1554+ , _gFormattedValue :: !(Maybe Text)
1555+ } deriving (Eq,Show,Data,Typeable,Generic)
1557+-- | Creates a value of 'Gender' with the minimum fields required to make a request.
1559+-- Use one of the following lenses to modify other fields as desired:
1565+-- * 'gFormattedValue'
1570+ { _gValue = Nothing
1571+ , _gMetadata = Nothing
1572+ , _gFormattedValue = Nothing
1575+-- | The gender for the person. The gender can be custom or predefined.
1576+-- Possible values include, but are not limited to, the following: *
1577+-- \`male\` * \`female\` * \`other\` * \`unknown\`
1578+gValue :: Lens' Gender (Maybe Text)
1579+gValue = lens _gValue (\ s a -> s{_gValue = a})
1581+-- | Metadata about the gender.
1582+gMetadata :: Lens' Gender (Maybe FieldMetadata)
1584+ = lens _gMetadata (\ s a -> s{_gMetadata = a})
1586+-- | The read-only value of the gender translated and formatted in the
1587+-- viewer\'s account locale or the \`Accept-Language\` HTTP header locale.
1588+gFormattedValue :: Lens' Gender (Maybe Text)
1590+ = lens _gFormattedValue
1591+ (\ s a -> s{_gFormattedValue = a})
1593+instance FromJSON Gender where
1595+ = withObject "Gender"
1598+ (o .:? "value") <*> (o .:? "metadata") <*>
1599+ (o .:? "formattedValue"))
1601+instance ToJSON Gender where
1605+ [("value" .=) <$> _gValue,
1606+ ("metadata" .=) <$> _gMetadata,
1607+ ("formattedValue" .=) <$> _gFormattedValue])
1609+-- | A person\'s name. If the name is a mononym, the family name is empty.
1611+-- /See:/ 'name' smart constructor.
1613+ { _nGivenName :: !(Maybe Text)
1614+ , _nPhoneticHonorificSuffix :: !(Maybe Text)
1615+ , _nMiddleName :: !(Maybe Text)
1616+ , _nPhoneticMiddleName :: !(Maybe Text)
1617+ , _nPhoneticFamilyName :: !(Maybe Text)
1618+ , _nPhoneticHonorificPrefix :: !(Maybe Text)
1619+ , _nHonorificPrefix :: !(Maybe Text)
1620+ , _nFamilyName :: !(Maybe Text)
1621+ , _nMetadata :: !(Maybe FieldMetadata)
1622+ , _nDisplayName :: !(Maybe Text)
1623+ , _nPhoneticGivenName :: !(Maybe Text)
1624+ , _nHonorificSuffix :: !(Maybe Text)
1625+ } deriving (Eq,Show,Data,Typeable,Generic)
1627+-- | Creates a value of 'Name' with the minimum fields required to make a request.
1629+-- Use one of the following lenses to modify other fields as desired:
1633+-- * 'nPhoneticHonorificSuffix'
1637+-- * 'nPhoneticMiddleName'
1639+-- * 'nPhoneticFamilyName'
1641+-- * 'nPhoneticHonorificPrefix'
1643+-- * 'nHonorificPrefix'
1651+-- * 'nPhoneticGivenName'
1653+-- * 'nHonorificSuffix'
1658+ { _nGivenName = Nothing
1659+ , _nPhoneticHonorificSuffix = Nothing
1660+ , _nMiddleName = Nothing
1661+ , _nPhoneticMiddleName = Nothing
1662+ , _nPhoneticFamilyName = Nothing
1663+ , _nPhoneticHonorificPrefix = Nothing
1664+ , _nHonorificPrefix = Nothing
1665+ , _nFamilyName = Nothing
1666+ , _nMetadata = Nothing
1667+ , _nDisplayName = Nothing
1668+ , _nPhoneticGivenName = Nothing
1669+ , _nHonorificSuffix = Nothing
1672+-- | The given name.
1673+nGivenName :: Lens' Name (Maybe Text)
1675+ = lens _nGivenName (\ s a -> s{_nGivenName = a})
1677+-- | The honorific suffixes spelled as they sound.
1678+nPhoneticHonorificSuffix :: Lens' Name (Maybe Text)
1679+nPhoneticHonorificSuffix
1680+ = lens _nPhoneticHonorificSuffix
1681+ (\ s a -> s{_nPhoneticHonorificSuffix = a})
1683+-- | The middle name(s).
1684+nMiddleName :: Lens' Name (Maybe Text)
1686+ = lens _nMiddleName (\ s a -> s{_nMiddleName = a})
1688+-- | The middle name(s) spelled as they sound.
1689+nPhoneticMiddleName :: Lens' Name (Maybe Text)
1691+ = lens _nPhoneticMiddleName
1692+ (\ s a -> s{_nPhoneticMiddleName = a})
1694+-- | The family name spelled as it sounds.
1695+nPhoneticFamilyName :: Lens' Name (Maybe Text)
1697+ = lens _nPhoneticFamilyName
1698+ (\ s a -> s{_nPhoneticFamilyName = a})
1700+-- | The honorific prefixes spelled as they sound.
1701+nPhoneticHonorificPrefix :: Lens' Name (Maybe Text)
1702+nPhoneticHonorificPrefix
1703+ = lens _nPhoneticHonorificPrefix
1704+ (\ s a -> s{_nPhoneticHonorificPrefix = a})
1706+-- | The honorific prefixes, such as \`Mrs.\` or \`Dr.\`
1707+nHonorificPrefix :: Lens' Name (Maybe Text)
1709+ = lens _nHonorificPrefix
1710+ (\ s a -> s{_nHonorificPrefix = a})
1712+-- | The family name.
1713+nFamilyName :: Lens' Name (Maybe Text)
1715+ = lens _nFamilyName (\ s a -> s{_nFamilyName = a})
1717+-- | Metadata about the name.
1718+nMetadata :: Lens' Name (Maybe FieldMetadata)
1720+ = lens _nMetadata (\ s a -> s{_nMetadata = a})
1722+-- | The display name formatted according to the locale specified by the
1723+-- viewer\'s account or the Accept-Language HTTP header.
1724+nDisplayName :: Lens' Name (Maybe Text)
1726+ = lens _nDisplayName (\ s a -> s{_nDisplayName = a})
1728+-- | The given name spelled as it sounds.
1729+nPhoneticGivenName :: Lens' Name (Maybe Text)
1731+ = lens _nPhoneticGivenName
1732+ (\ s a -> s{_nPhoneticGivenName = a})
1734+-- | The honorific suffixes, such as \`Jr.\`
1735+nHonorificSuffix :: Lens' Name (Maybe Text)
1737+ = lens _nHonorificSuffix
1738+ (\ s a -> s{_nHonorificSuffix = a})
1740+instance FromJSON Name where
1742+ = withObject "Name"
1745+ (o .:? "givenName") <*>
1746+ (o .:? "phoneticHonorificSuffix")
1747+ <*> (o .:? "middleName")
1748+ <*> (o .:? "phoneticMiddleName")
1749+ <*> (o .:? "phoneticFamilyName")
1750+ <*> (o .:? "phoneticHonorificPrefix")
1751+ <*> (o .:? "honorificPrefix")
1752+ <*> (o .:? "familyName")
1753+ <*> (o .:? "metadata")
1754+ <*> (o .:? "displayName")
1755+ <*> (o .:? "phoneticGivenName")
1756+ <*> (o .:? "honorificSuffix"))
1758+instance ToJSON Name where
1762+ [("givenName" .=) <$> _nGivenName,
1763+ ("phoneticHonorificSuffix" .=) <$>
1764+ _nPhoneticHonorificSuffix,
1765+ ("middleName" .=) <$> _nMiddleName,
1766+ ("phoneticMiddleName" .=) <$> _nPhoneticMiddleName,
1767+ ("phoneticFamilyName" .=) <$> _nPhoneticFamilyName,
1768+ ("phoneticHonorificPrefix" .=) <$>
1769+ _nPhoneticHonorificPrefix,
1770+ ("honorificPrefix" .=) <$> _nHonorificPrefix,
1771+ ("familyName" .=) <$> _nFamilyName,
1772+ ("metadata" .=) <$> _nMetadata,
1773+ ("displayName" .=) <$> _nDisplayName,
1774+ ("phoneticGivenName" .=) <$> _nPhoneticGivenName,
1775+ ("honorificSuffix" .=) <$> _nHonorificSuffix])
1777+-- | Metadata about a field.
1779+-- /See:/ 'fieldMetadata' smart constructor.
1780+data FieldMetadata = FieldMetadata
1781+ { _fmVerified :: !(Maybe Bool)
1782+ , _fmPrimary :: !(Maybe Bool)
1783+ , _fmSource :: !(Maybe Source)
1784+ } deriving (Eq,Show,Data,Typeable,Generic)
1786+-- | Creates a value of 'FieldMetadata' with the minimum fields required to make a request.
1788+-- Use one of the following lenses to modify other fields as desired:
1799+ { _fmVerified = Nothing
1800+ , _fmPrimary = Nothing
1801+ , _fmSource = Nothing
1804+-- | True if the field is verified; false if the field is unverified. A
1805+-- verified field is typically a name, email address, phone number, or
1806+-- website that has been confirmed to be owned by the person.
1807+fmVerified :: Lens' FieldMetadata (Maybe Bool)
1809+ = lens _fmVerified (\ s a -> s{_fmVerified = a})
1811+-- | True if the field is the primary field; false if the field is a
1813+fmPrimary :: Lens' FieldMetadata (Maybe Bool)
1815+ = lens _fmPrimary (\ s a -> s{_fmPrimary = a})
1817+-- | The source of the field.
1818+fmSource :: Lens' FieldMetadata (Maybe Source)
1819+fmSource = lens _fmSource (\ s a -> s{_fmSource = a})
1821+instance FromJSON FieldMetadata where
1823+ = withObject "FieldMetadata"
1826+ (o .:? "verified") <*> (o .:? "primary") <*>
1829+instance ToJSON FieldMetadata where
1830+ toJSON FieldMetadata{..}
1833+ [("verified" .=) <$> _fmVerified,
1834+ ("primary" .=) <$> _fmPrimary,
1835+ ("source" .=) <$> _fmSource])
1837+-- | A person\'s phone number.
1839+-- /See:/ 'phoneNumber' smart constructor.
1840+data PhoneNumber = PhoneNumber
1841+ { _pnCanonicalForm :: !(Maybe Text)
1842+ , _pnValue :: !(Maybe Text)
1843+ , _pnMetadata :: !(Maybe FieldMetadata)
1844+ , _pnType :: !(Maybe Text)
1845+ , _pnFormattedType :: !(Maybe Text)
1846+ } deriving (Eq,Show,Data,Typeable,Generic)
1848+-- | Creates a value of 'PhoneNumber' with the minimum fields required to make a request.
1850+-- Use one of the following lenses to modify other fields as desired:
1852+-- * 'pnCanonicalForm'
1860+-- * 'pnFormattedType'
1865+ { _pnCanonicalForm = Nothing
1866+ , _pnValue = Nothing
1867+ , _pnMetadata = Nothing
1868+ , _pnType = Nothing
1869+ , _pnFormattedType = Nothing
1872+-- | The read-only canonicalized [ITU-T
1873+-- E.164](https:\/\/law.resource.org\/pub\/us\/cfr\/ibr\/004\/itu-t.E.164.1.2008.pdf)
1874+-- form of the phone number.
1875+pnCanonicalForm :: Lens' PhoneNumber (Maybe Text)
1877+ = lens _pnCanonicalForm
1878+ (\ s a -> s{_pnCanonicalForm = a})
1880+-- | The phone number.
1881+pnValue :: Lens' PhoneNumber (Maybe Text)
1882+pnValue = lens _pnValue (\ s a -> s{_pnValue = a})
1884+-- | Metadata about the phone number.
1885+pnMetadata :: Lens' PhoneNumber (Maybe FieldMetadata)
1887+ = lens _pnMetadata (\ s a -> s{_pnMetadata = a})
1889+-- | The type of the phone number. The type can be custom or predefined.
1890+-- Possible values include, but are not limited to, the following: *
1891+-- \`home\` * \`work\` * \`mobile\` * \`homeFax\` * \`workFax\` *
1892+-- \`otherFax\` * \`pager\` * \`workMobile\` * \`workPager\` * \`main\` *
1893+-- \`googleVoice\` * \`other\`
1894+pnType :: Lens' PhoneNumber (Maybe Text)
1895+pnType = lens _pnType (\ s a -> s{_pnType = a})
1897+-- | The read-only type of the phone number translated and formatted in the
1898+-- viewer\'s account locale or the the \`Accept-Language\` HTTP header
1900+pnFormattedType :: Lens' PhoneNumber (Maybe Text)
1902+ = lens _pnFormattedType
1903+ (\ s a -> s{_pnFormattedType = a})
1905+instance FromJSON PhoneNumber where
1907+ = withObject "PhoneNumber"
1910+ (o .:? "canonicalForm") <*> (o .:? "value") <*>
1913+ <*> (o .:? "formattedType"))
1915+instance ToJSON PhoneNumber where
1916+ toJSON PhoneNumber{..}
1919+ [("canonicalForm" .=) <$> _pnCanonicalForm,
1920+ ("value" .=) <$> _pnValue,
1921+ ("metadata" .=) <$> _pnMetadata,
1922+ ("type" .=) <$> _pnType,
1923+ ("formattedType" .=) <$> _pnFormattedType])
1925+-- | A person\'s occupation.
1927+-- /See:/ 'occupation' smart constructor.
1928+data Occupation = Occupation
1929+ { _oValue :: !(Maybe Text)
1930+ , _oMetadata :: !(Maybe FieldMetadata)
1931+ } deriving (Eq,Show,Data,Typeable,Generic)
1933+-- | Creates a value of 'Occupation' with the minimum fields required to make a request.
1935+-- Use one of the following lenses to modify other fields as desired:
1944+ { _oValue = Nothing
1945+ , _oMetadata = Nothing
1948+-- | The occupation; for example, \`carpenter\`.
1949+oValue :: Lens' Occupation (Maybe Text)
1950+oValue = lens _oValue (\ s a -> s{_oValue = a})
1952+-- | Metadata about the occupation.
1953+oMetadata :: Lens' Occupation (Maybe FieldMetadata)
1955+ = lens _oMetadata (\ s a -> s{_oMetadata = a})
1957+instance FromJSON Occupation where
1959+ = withObject "Occupation"
1962+ (o .:? "value") <*> (o .:? "metadata"))
1964+instance ToJSON Occupation where
1965+ toJSON Occupation{..}
1968+ [("value" .=) <$> _oValue,
1969+ ("metadata" .=) <$> _oMetadata])
1971+-- | A person\'s email address.
1973+-- /See:/ 'emailAddress' smart constructor.
1974+data EmailAddress = EmailAddress
1975+ { _eaValue :: !(Maybe Text)
1976+ , _eaMetadata :: !(Maybe FieldMetadata)
1977+ , _eaType :: !(Maybe Text)
1978+ , _eaFormattedType :: !(Maybe Text)
1979+ } deriving (Eq,Show,Data,Typeable,Generic)
1981+-- | Creates a value of 'EmailAddress' with the minimum fields required to make a request.
1983+-- Use one of the following lenses to modify other fields as desired:
1991+-- * 'eaFormattedType'
1996+ { _eaValue = Nothing
1997+ , _eaMetadata = Nothing
1998+ , _eaType = Nothing
1999+ , _eaFormattedType = Nothing
2002+-- | The email address.
2003+eaValue :: Lens' EmailAddress (Maybe Text)
2004+eaValue = lens _eaValue (\ s a -> s{_eaValue = a})
2006+-- | Metadata about the email address.
2007+eaMetadata :: Lens' EmailAddress (Maybe FieldMetadata)
2009+ = lens _eaMetadata (\ s a -> s{_eaMetadata = a})
2011+-- | The type of the email address. The type can be custom or predefined.
2012+-- Possible values include, but are not limited to, the following: *
2013+-- \`home\` * \`work\` * \`other\`
2014+eaType :: Lens' EmailAddress (Maybe Text)
2015+eaType = lens _eaType (\ s a -> s{_eaType = a})
2017+-- | The read-only type of the email address translated and formatted in the
2018+-- viewer\'s account locale or the \`Accept-Language\` HTTP header locale.
2019+eaFormattedType :: Lens' EmailAddress (Maybe Text)
2021+ = lens _eaFormattedType
2022+ (\ s a -> s{_eaFormattedType = a})
2024+instance FromJSON EmailAddress where
2026+ = withObject "EmailAddress"
2029+ (o .:? "value") <*> (o .:? "metadata") <*>
2031+ <*> (o .:? "formattedType"))
2033+instance ToJSON EmailAddress where
2034+ toJSON EmailAddress{..}
2037+ [("value" .=) <$> _eaValue,
2038+ ("metadata" .=) <$> _eaMetadata,
2039+ ("type" .=) <$> _eaType,
2040+ ("formattedType" .=) <$> _eaFormattedType])
2042+-- | The source of a field.
2044+-- /See:/ 'source' smart constructor.
2045+data Source = Source
2046+ { _sId :: !(Maybe Text)
2047+ , _sType :: !(Maybe Text)
2048+ } deriving (Eq,Show,Data,Typeable,Generic)
2050+-- | Creates a value of 'Source' with the minimum fields required to make a request.
2052+-- Use one of the following lenses to modify other fields as desired:
2065+-- | A unique identifier within the source type generated by the server.
2066+sId :: Lens' Source (Maybe Text)
2067+sId = lens _sId (\ s a -> s{_sId = a})
2069+-- | The source type.
2070+sType :: Lens' Source (Maybe Text)
2071+sType = lens _sType (\ s a -> s{_sType = a})
2073+instance FromJSON Source where
2075+ = withObject "Source"
2076+ (\ o -> Source <$> (o .:? "id") <*> (o .:? "type"))
2078+instance ToJSON Source where
2082+ [("id" .=) <$> _sId, ("type" .=) <$> _sType])
2084+-- | A person\'s instant messaging client.
2086+-- /See:/ 'imClient' smart constructor.
2087+data ImClient = ImClient
2088+ { _icFormattedProtocol :: !(Maybe Text)
2089+ , _icUsername :: !(Maybe Text)
2090+ , _icProtocol :: !(Maybe Text)
2091+ , _icMetadata :: !(Maybe FieldMetadata)
2092+ , _icType :: !(Maybe Text)
2093+ , _icFormattedType :: !(Maybe Text)
2094+ } deriving (Eq,Show,Data,Typeable,Generic)
2096+-- | Creates a value of 'ImClient' with the minimum fields required to make a request.
2098+-- Use one of the following lenses to modify other fields as desired:
2100+-- * 'icFormattedProtocol'
2110+-- * 'icFormattedType'
2115+ { _icFormattedProtocol = Nothing
2116+ , _icUsername = Nothing
2117+ , _icProtocol = Nothing
2118+ , _icMetadata = Nothing
2119+ , _icType = Nothing
2120+ , _icFormattedType = Nothing
2123+-- | The read-only protocol of the IM client formatted in the viewer\'s
2124+-- account locale or the \`Accept-Language\` HTTP header locale.
2125+icFormattedProtocol :: Lens' ImClient (Maybe Text)
2127+ = lens _icFormattedProtocol
2128+ (\ s a -> s{_icFormattedProtocol = a})
2130+-- | The user name used in the IM client.
2131+icUsername :: Lens' ImClient (Maybe Text)
2133+ = lens _icUsername (\ s a -> s{_icUsername = a})
2135+-- | The protocol of the IM client. The protocol can be custom or predefined.
2136+-- Possible values include, but are not limited to, the following: *
2137+-- \`aim\` * \`msn\` * \`yahoo\` * \`skype\` * \`qq\` * \`googleTalk\` *
2138+-- \`icq\` * \`jabber\` * \`netMeeting\`
2139+icProtocol :: Lens' ImClient (Maybe Text)
2141+ = lens _icProtocol (\ s a -> s{_icProtocol = a})
2143+-- | Metadata about the IM client.
2144+icMetadata :: Lens' ImClient (Maybe FieldMetadata)
2146+ = lens _icMetadata (\ s a -> s{_icMetadata = a})
2148+-- | The type of the IM client. The type can be custom or predefined.
2149+-- Possible values include, but are not limited to, the following: *
2150+-- \`home\` * \`work\` * \`other\`
2151+icType :: Lens' ImClient (Maybe Text)
2152+icType = lens _icType (\ s a -> s{_icType = a})
2154+-- | The read-only type of the IM client translated and formatted in the
2155+-- viewer\'s account locale or the \`Accept-Language\` HTTP header locale.
2156+icFormattedType :: Lens' ImClient (Maybe Text)
2158+ = lens _icFormattedType
2159+ (\ s a -> s{_icFormattedType = a})
2161+instance FromJSON ImClient where
2163+ = withObject "ImClient"
2166+ (o .:? "formattedProtocol") <*> (o .:? "username")
2167+ <*> (o .:? "protocol")
2168+ <*> (o .:? "metadata")
2170+ <*> (o .:? "formattedType"))
2172+instance ToJSON ImClient where
2173+ toJSON ImClient{..}
2176+ [("formattedProtocol" .=) <$> _icFormattedProtocol,
2177+ ("username" .=) <$> _icUsername,
2178+ ("protocol" .=) <$> _icProtocol,
2179+ ("metadata" .=) <$> _icMetadata,
2180+ ("type" .=) <$> _icType,
2181+ ("formattedType" .=) <$> _icFormattedType])
2183+-- | Metadata about a person.
2185+-- /See:/ 'personMetadata' smart constructor.
2186+data PersonMetadata = PersonMetadata
2187+ { _pmPreviousResourceNames :: !(Maybe [Text])
2188+ , _pmObjectType :: !(Maybe Text)
2189+ , _pmSources :: !(Maybe [Source])
2190+ , _pmDeleted :: !(Maybe Bool)
2191+ } deriving (Eq,Show,Data,Typeable,Generic)
2193+-- | Creates a value of 'PersonMetadata' with the minimum fields required to make a request.
2195+-- Use one of the following lenses to modify other fields as desired:
2197+-- * 'pmPreviousResourceNames'
2208+ { _pmPreviousResourceNames = Nothing
2209+ , _pmObjectType = Nothing
2210+ , _pmSources = Nothing
2211+ , _pmDeleted = Nothing
2214+-- | Any former resource names this person has had. Populated only for
2215+-- [\`connections.list\`](\/people\/api\/rest\/v1\/people.connections\/list)
2216+-- requests that include a sync token. The resource name may change when
2217+-- adding or removing fields that link a contact and profile such as a
2218+-- verified email, verified phone number, or profile URL.
2219+pmPreviousResourceNames :: Lens' PersonMetadata [Text]
2220+pmPreviousResourceNames
2221+ = lens _pmPreviousResourceNames
2222+ (\ s a -> s{_pmPreviousResourceNames = a})
2226+-- | The type of the person object.
2227+pmObjectType :: Lens' PersonMetadata (Maybe Text)
2229+ = lens _pmObjectType (\ s a -> s{_pmObjectType = a})
2231+-- | The sources of data for the person.
2232+pmSources :: Lens' PersonMetadata [Source]
2234+ = lens _pmSources (\ s a -> s{_pmSources = a}) .
2238+-- | True if the person resource has been deleted. Populated only for
2239+-- [\`connections.list\`](\/people\/api\/rest\/v1\/people.connections\/list)
2240+-- requests that include a sync token.
2241+pmDeleted :: Lens' PersonMetadata (Maybe Bool)
2243+ = lens _pmDeleted (\ s a -> s{_pmDeleted = a})
2245+instance FromJSON PersonMetadata where
2247+ = withObject "PersonMetadata"
2250+ (o .:? "previousResourceNames" .!= mempty) <*>
2251+ (o .:? "objectType")
2252+ <*> (o .:? "sources" .!= mempty)
2253+ <*> (o .:? "deleted"))
2255+instance ToJSON PersonMetadata where
2256+ toJSON PersonMetadata{..}
2259+ [("previousResourceNames" .=) <$>
2260+ _pmPreviousResourceNames,
2261+ ("objectType" .=) <$> _pmObjectType,
2262+ ("sources" .=) <$> _pmSources,
2263+ ("deleted" .=) <$> _pmDeleted])
2265+-- | A person\'s nickname.
2267+-- /See:/ 'nickname' smart constructor.
2268+data Nickname = Nickname
2269+ { _nicValue :: !(Maybe Text)
2270+ , _nicMetadata :: !(Maybe FieldMetadata)
2271+ , _nicType :: !(Maybe Text)
2272+ } deriving (Eq,Show,Data,Typeable,Generic)
2274+-- | Creates a value of 'Nickname' with the minimum fields required to make a request.
2276+-- Use one of the following lenses to modify other fields as desired:
2287+ { _nicValue = Nothing
2288+ , _nicMetadata = Nothing
2289+ , _nicType = Nothing
2293+nicValue :: Lens' Nickname (Maybe Text)
2294+nicValue = lens _nicValue (\ s a -> s{_nicValue = a})
2296+-- | Metadata about the nickname.
2297+nicMetadata :: Lens' Nickname (Maybe FieldMetadata)
2299+ = lens _nicMetadata (\ s a -> s{_nicMetadata = a})
2301+-- | The type of the nickname.
2302+nicType :: Lens' Nickname (Maybe Text)
2303+nicType = lens _nicType (\ s a -> s{_nicType = a})
2305+instance FromJSON Nickname where
2307+ = withObject "Nickname"
2310+ (o .:? "value") <*> (o .:? "metadata") <*>
2313+instance ToJSON Nickname where
2314+ toJSON Nickname{..}
2317+ [("value" .=) <$> _nicValue,
2318+ ("metadata" .=) <$> _nicMetadata,
2319+ ("type" .=) <$> _nicType])
2321+-- | A person\'s past or current organization. Overlapping date ranges are
2324+-- /See:/ 'organization' smart constructor.
2325+data Organization = Organization
2326+ { _orgDePartment :: !(Maybe Text)
2327+ , _orgLocation :: !(Maybe Text)
2328+ , _orgDomain :: !(Maybe Text)
2329+ , _orgEndDate :: !(Maybe Date)
2330+ , _orgSymbol :: !(Maybe Text)
2331+ , _orgJobDescription :: !(Maybe Text)
2332+ , _orgCurrent :: !(Maybe Bool)
2333+ , _orgStartDate :: !(Maybe Date)
2334+ , _orgName :: !(Maybe Text)
2335+ , _orgMetadata :: !(Maybe FieldMetadata)
2336+ , _orgPhoneticName :: !(Maybe Text)
2337+ , _orgTitle :: !(Maybe Text)
2338+ , _orgType :: !(Maybe Text)
2339+ , _orgFormattedType :: !(Maybe Text)
2340+ } deriving (Eq,Show,Data,Typeable,Generic)
2342+-- | Creates a value of 'Organization' with the minimum fields required to make a request.
2344+-- Use one of the following lenses to modify other fields as desired:
2346+-- * 'orgDePartment'
2356+-- * 'orgJobDescription'
2366+-- * 'orgPhoneticName'
2372+-- * 'orgFormattedType'
2377+ { _orgDePartment = Nothing
2378+ , _orgLocation = Nothing
2379+ , _orgDomain = Nothing
2380+ , _orgEndDate = Nothing
2381+ , _orgSymbol = Nothing
2382+ , _orgJobDescription = Nothing
2383+ , _orgCurrent = Nothing
2384+ , _orgStartDate = Nothing
2385+ , _orgName = Nothing
2386+ , _orgMetadata = Nothing
2387+ , _orgPhoneticName = Nothing
2388+ , _orgTitle = Nothing
2389+ , _orgType = Nothing
2390+ , _orgFormattedType = Nothing
2393+-- | The person\'s department at the organization.
2394+orgDePartment :: Lens' Organization (Maybe Text)
2396+ = lens _orgDePartment
2397+ (\ s a -> s{_orgDePartment = a})
2399+-- | The location of the organization office the person works at.
2400+orgLocation :: Lens' Organization (Maybe Text)
2402+ = lens _orgLocation (\ s a -> s{_orgLocation = a})
2404+-- | The domain name associated with the organization; for example,
2406+orgDomain :: Lens' Organization (Maybe Text)
2408+ = lens _orgDomain (\ s a -> s{_orgDomain = a})
2410+-- | The end date when the person left the organization.
2411+orgEndDate :: Lens' Organization (Maybe Date)
2413+ = lens _orgEndDate (\ s a -> s{_orgEndDate = a})
2415+-- | The symbol associated with the organization; for example, a stock ticker
2416+-- symbol, abbreviation, or acronym.
2417+orgSymbol :: Lens' Organization (Maybe Text)
2419+ = lens _orgSymbol (\ s a -> s{_orgSymbol = a})
2421+-- | The person\'s job description at the organization.
2422+orgJobDescription :: Lens' Organization (Maybe Text)
2424+ = lens _orgJobDescription
2425+ (\ s a -> s{_orgJobDescription = a})
2427+-- | True if the organization is the person\'s current organization; false if
2428+-- the organization is a past organization.
2429+orgCurrent :: Lens' Organization (Maybe Bool)
2431+ = lens _orgCurrent (\ s a -> s{_orgCurrent = a})
2433+-- | The start date when the person joined the organization.
2434+orgStartDate :: Lens' Organization (Maybe Date)
2436+ = lens _orgStartDate (\ s a -> s{_orgStartDate = a})
2438+-- | The name of the organization.
2439+orgName :: Lens' Organization (Maybe Text)
2440+orgName = lens _orgName (\ s a -> s{_orgName = a})
2442+-- | Metadata about the organization.
2443+orgMetadata :: Lens' Organization (Maybe FieldMetadata)
2445+ = lens _orgMetadata (\ s a -> s{_orgMetadata = a})
2447+-- | The phonetic name of the organization.
2448+orgPhoneticName :: Lens' Organization (Maybe Text)
2450+ = lens _orgPhoneticName
2451+ (\ s a -> s{_orgPhoneticName = a})
2453+-- | The person\'s job title at the organization.
2454+orgTitle :: Lens' Organization (Maybe Text)
2455+orgTitle = lens _orgTitle (\ s a -> s{_orgTitle = a})
2457+-- | The type of the organization. The type can be custom or predefined.
2458+-- Possible values include, but are not limited to, the following: *
2459+-- \`work\` * \`school\`
2460+orgType :: Lens' Organization (Maybe Text)
2461+orgType = lens _orgType (\ s a -> s{_orgType = a})
2463+-- | The read-only type of the organization translated and formatted in the
2464+-- viewer\'s account locale or the \`Accept-Language\` HTTP header locale.
2465+orgFormattedType :: Lens' Organization (Maybe Text)
2467+ = lens _orgFormattedType
2468+ (\ s a -> s{_orgFormattedType = a})
2470+instance FromJSON Organization where
2472+ = withObject "Organization"
2475+ (o .:? "department") <*> (o .:? "location") <*>
2477+ <*> (o .:? "endDate")
2478+ <*> (o .:? "symbol")
2479+ <*> (o .:? "jobDescription")
2480+ <*> (o .:? "current")
2481+ <*> (o .:? "startDate")
2483+ <*> (o .:? "metadata")
2484+ <*> (o .:? "phoneticName")
2485+ <*> (o .:? "title")
2487+ <*> (o .:? "formattedType"))
2489+instance ToJSON Organization where
2490+ toJSON Organization{..}
2493+ [("department" .=) <$> _orgDePartment,
2494+ ("location" .=) <$> _orgLocation,
2495+ ("domain" .=) <$> _orgDomain,
2496+ ("endDate" .=) <$> _orgEndDate,
2497+ ("symbol" .=) <$> _orgSymbol,
2498+ ("jobDescription" .=) <$> _orgJobDescription,
2499+ ("current" .=) <$> _orgCurrent,
2500+ ("startDate" .=) <$> _orgStartDate,
2501+ ("name" .=) <$> _orgName,
2502+ ("metadata" .=) <$> _orgMetadata,
2503+ ("phoneticName" .=) <$> _orgPhoneticName,
2504+ ("title" .=) <$> _orgTitle, ("type" .=) <$> _orgType,
2505+ ("formattedType" .=) <$> _orgFormattedType])
2507+-- | One of the person\'s interests.
2509+-- /See:/ 'interest' smart constructor.
2510+data Interest = Interest
2511+ { _iValue :: !(Maybe Text)
2512+ , _iMetadata :: !(Maybe FieldMetadata)
2513+ } deriving (Eq,Show,Data,Typeable,Generic)
2515+-- | Creates a value of 'Interest' with the minimum fields required to make a request.
2517+-- Use one of the following lenses to modify other fields as desired:
2526+ { _iValue = Nothing
2527+ , _iMetadata = Nothing
2530+-- | The interest; for example, \`stargazing\`.
2531+iValue :: Lens' Interest (Maybe Text)
2532+iValue = lens _iValue (\ s a -> s{_iValue = a})
2534+-- | Metadata about the interest.
2535+iMetadata :: Lens' Interest (Maybe FieldMetadata)
2537+ = lens _iMetadata (\ s a -> s{_iMetadata = a})
2539+instance FromJSON Interest where
2541+ = withObject "Interest"
2543+ Interest <$> (o .:? "value") <*> (o .:? "metadata"))
2545+instance ToJSON Interest where
2546+ toJSON Interest{..}
2549+ [("value" .=) <$> _iValue,
2550+ ("metadata" .=) <$> _iMetadata])
2552+-- | The response for a single person
2554+-- /See:/ 'personResponse' smart constructor.
2555+data PersonResponse = PersonResponse
2556+ { _prRequestedResourceName :: !(Maybe Text)
2557+ , _prPerson :: !(Maybe Person)
2558+ , _prHTTPStatusCode :: !(Maybe (Textual Int32))
2559+ } deriving (Eq,Show,Data,Typeable,Generic)
2561+-- | Creates a value of 'PersonResponse' with the minimum fields required to make a request.
2563+-- Use one of the following lenses to modify other fields as desired:
2565+-- * 'prRequestedResourceName'
2569+-- * 'prHTTPStatusCode'
2574+ { _prRequestedResourceName = Nothing
2575+ , _prPerson = Nothing
2576+ , _prHTTPStatusCode = Nothing
2579+-- | The original requested resource name. May be different than the resource
2580+-- name on the returned person. The resource name can change when adding or
2581+-- removing fields that link a contact and profile such as a verified
2582+-- email, verified phone number, or a profile URL.
2583+prRequestedResourceName :: Lens' PersonResponse (Maybe Text)
2584+prRequestedResourceName
2585+ = lens _prRequestedResourceName
2586+ (\ s a -> s{_prRequestedResourceName = a})
2589+prPerson :: Lens' PersonResponse (Maybe Person)
2590+prPerson = lens _prPerson (\ s a -> s{_prPerson = a})
2592+-- | [HTTP 1.1 status
2593+-- code](http:\/\/www.w3.org\/Protocols\/rfc2616\/rfc2616-sec10.html).
2594+prHTTPStatusCode :: Lens' PersonResponse (Maybe Int32)
2596+ = lens _prHTTPStatusCode
2597+ (\ s a -> s{_prHTTPStatusCode = a})
2600+instance FromJSON PersonResponse where
2602+ = withObject "PersonResponse"
2605+ (o .:? "requestedResourceName") <*> (o .:? "person")
2606+ <*> (o .:? "httpStatusCode"))
2608+instance ToJSON PersonResponse where
2609+ toJSON PersonResponse{..}
2612+ [("requestedResourceName" .=) <$>
2613+ _prRequestedResourceName,
2614+ ("person" .=) <$> _prPerson,
2615+ ("httpStatusCode" .=) <$> _prHTTPStatusCode])
2617+-- | A skill that the person has.
2619+-- /See:/ 'skill' smart constructor.
2621+ { _sValue :: !(Maybe Text)
2622+ , _sMetadata :: !(Maybe FieldMetadata)
2623+ } deriving (Eq,Show,Data,Typeable,Generic)
2625+-- | Creates a value of 'Skill' with the minimum fields required to make a request.
2627+-- Use one of the following lenses to modify other fields as desired:
2636+ { _sValue = Nothing
2637+ , _sMetadata = Nothing
2640+-- | The skill; for example, \`underwater basket weaving\`.
2641+sValue :: Lens' Skill (Maybe Text)
2642+sValue = lens _sValue (\ s a -> s{_sValue = a})
2644+-- | Metadata about the skill.
2645+sMetadata :: Lens' Skill (Maybe FieldMetadata)
2647+ = lens _sMetadata (\ s a -> s{_sMetadata = a})
2649+instance FromJSON Skill where
2651+ = withObject "Skill"
2653+ Skill <$> (o .:? "value") <*> (o .:? "metadata"))
2655+instance ToJSON Skill where
2659+ [("value" .=) <$> _sValue,
2660+ ("metadata" .=) <$> _sMetadata])
2662+-- | A person\'s short biography.
2664+-- /See:/ 'biography' smart constructor.
2665+data Biography = Biography
2666+ { _bioValue :: !(Maybe Text)
2667+ , _bioMetadata :: !(Maybe FieldMetadata)
2668+ } deriving (Eq,Show,Data,Typeable,Generic)
2670+-- | Creates a value of 'Biography' with the minimum fields required to make a request.
2672+-- Use one of the following lenses to modify other fields as desired:
2681+ { _bioValue = Nothing
2682+ , _bioMetadata = Nothing
2685+-- | The short biography.
2686+bioValue :: Lens' Biography (Maybe Text)
2687+bioValue = lens _bioValue (\ s a -> s{_bioValue = a})
2689+-- | Metadata about the biography.
2690+bioMetadata :: Lens' Biography (Maybe FieldMetadata)
2692+ = lens _bioMetadata (\ s a -> s{_bioMetadata = a})
2694+instance FromJSON Biography where
2696+ = withObject "Biography"
2698+ Biography <$> (o .:? "value") <*> (o .:? "metadata"))
2700+instance ToJSON Biography where
2701+ toJSON Biography{..}
2704+ [("value" .=) <$> _bioValue,
2705+ ("metadata" .=) <$> _bioMetadata])
2707+-- | A person\'s cover photo. A large image shown on the person\'s profile
2708+-- page that represents who they are or what they care about.
2710+-- /See:/ 'coverPhoto' smart constructor.
2711+data CoverPhoto = CoverPhoto
2712+ { _cpDefault :: !(Maybe Bool)
2713+ , _cpURL :: !(Maybe Text)
2714+ , _cpMetadata :: !(Maybe FieldMetadata)
2715+ } deriving (Eq,Show,Data,Typeable,Generic)
2717+-- | Creates a value of 'CoverPhoto' with the minimum fields required to make a request.
2719+-- Use one of the following lenses to modify other fields as desired:
2730+ { _cpDefault = Nothing
2732+ , _cpMetadata = Nothing
2735+-- | True if the cover photo is the default cover photo; false if the cover
2736+-- photo is a user-provided cover photo.
2737+cpDefault :: Lens' CoverPhoto (Maybe Bool)
2739+ = lens _cpDefault (\ s a -> s{_cpDefault = a})
2741+-- | The URL of the cover photo.
2742+cpURL :: Lens' CoverPhoto (Maybe Text)
2743+cpURL = lens _cpURL (\ s a -> s{_cpURL = a})
2745+-- | Metadata about the cover photo.
2746+cpMetadata :: Lens' CoverPhoto (Maybe FieldMetadata)
2748+ = lens _cpMetadata (\ s a -> s{_cpMetadata = a})
2750+instance FromJSON CoverPhoto where
2752+ = withObject "CoverPhoto"
2755+ (o .:? "default") <*> (o .:? "url") <*>
2756+ (o .:? "metadata"))
2758+instance ToJSON CoverPhoto where
2759+ toJSON CoverPhoto{..}
2762+ [("default" .=) <$> _cpDefault,
2763+ ("url" .=) <$> _cpURL,
2764+ ("metadata" .=) <$> _cpMetadata])