@@ -0,0 +1,805 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
9+
10+-- |
11+-- Module : Network.Google.FirebaseDynamicLinks.Types.Product
12+-- Copyright : (c) 2015-2016 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)
17+--
18+module Network.Google.FirebaseDynamicLinks.Types.Product where
19+
20+import Network.Google.FirebaseDynamicLinks.Types.Sum
21+import Network.Google.Prelude
22+
23+-- | Short Dynamic Link suffix.
24+--
25+-- /See:/ 'suffix' smart constructor.
26+newtype Suffix = Suffix'
27+ { _sOption :: Maybe SuffixOption
28+ } deriving (Eq,Show,Data,Typeable,Generic)
29+
30+-- | Creates a value of 'Suffix' with the minimum fields required to make a request.
31+--
32+-- Use one of the following lenses to modify other fields as desired:
33+--
34+-- * 'sOption'
35+suffix
36+ :: Suffix
37+suffix =
38+ Suffix'
39+ { _sOption = Nothing
40+ }
41+
42+-- | Suffix option.
43+sOption :: Lens' Suffix (Maybe SuffixOption)
44+sOption = lens _sOption (\ s a -> s{_sOption = a})
45+
46+instance FromJSON Suffix where
47+ parseJSON
48+ = withObject "Suffix"
49+ (\ o -> Suffix' <$> (o .:? "option"))
50+
51+instance ToJSON Suffix where
52+ toJSON Suffix'{..}
53+ = object (catMaybes [("option" .=) <$> _sOption])
54+
55+-- | Dynamic Links warning messages.
56+--
57+-- /See:/ 'dynamicLinkWarning' smart constructor.
58+data DynamicLinkWarning = DynamicLinkWarning'
59+ { _dlwWarningCode :: !(Maybe DynamicLinkWarningWarningCode)
60+ , _dlwWarningMessage :: !(Maybe Text)
61+ } deriving (Eq,Show,Data,Typeable,Generic)
62+
63+-- | Creates a value of 'DynamicLinkWarning' with the minimum fields required to make a request.
64+--
65+-- Use one of the following lenses to modify other fields as desired:
66+--
67+-- * 'dlwWarningCode'
68+--
69+-- * 'dlwWarningMessage'
70+dynamicLinkWarning
71+ :: DynamicLinkWarning
72+dynamicLinkWarning =
73+ DynamicLinkWarning'
74+ { _dlwWarningCode = Nothing
75+ , _dlwWarningMessage = Nothing
76+ }
77+
78+-- | The warning code.
79+dlwWarningCode :: Lens' DynamicLinkWarning (Maybe DynamicLinkWarningWarningCode)
80+dlwWarningCode
81+ = lens _dlwWarningCode
82+ (\ s a -> s{_dlwWarningCode = a})
83+
84+-- | The warning message to help developers improve their requests.
85+dlwWarningMessage :: Lens' DynamicLinkWarning (Maybe Text)
86+dlwWarningMessage
87+ = lens _dlwWarningMessage
88+ (\ s a -> s{_dlwWarningMessage = a})
89+
90+instance FromJSON DynamicLinkWarning where
91+ parseJSON
92+ = withObject "DynamicLinkWarning"
93+ (\ o ->
94+ DynamicLinkWarning' <$>
95+ (o .:? "warningCode") <*> (o .:? "warningMessage"))
96+
97+instance ToJSON DynamicLinkWarning where
98+ toJSON DynamicLinkWarning'{..}
99+ = object
100+ (catMaybes
101+ [("warningCode" .=) <$> _dlwWarningCode,
102+ ("warningMessage" .=) <$> _dlwWarningMessage])
103+
104+-- | Request to create a short Dynamic Link.
105+--
106+-- /See:/ 'createShortDynamicLinkRequest' smart constructor.
107+data CreateShortDynamicLinkRequest = CreateShortDynamicLinkRequest'
108+ { _csdlrLongDynamicLink :: !(Maybe Text)
109+ , _csdlrSuffix :: !(Maybe Suffix)
110+ , _csdlrDynamicLinkInfo :: !(Maybe DynamicLinkInfo)
111+ } deriving (Eq,Show,Data,Typeable,Generic)
112+
113+-- | Creates a value of 'CreateShortDynamicLinkRequest' with the minimum fields required to make a request.
114+--
115+-- Use one of the following lenses to modify other fields as desired:
116+--
117+-- * 'csdlrLongDynamicLink'
118+--
119+-- * 'csdlrSuffix'
120+--
121+-- * 'csdlrDynamicLinkInfo'
122+createShortDynamicLinkRequest
123+ :: CreateShortDynamicLinkRequest
124+createShortDynamicLinkRequest =
125+ CreateShortDynamicLinkRequest'
126+ { _csdlrLongDynamicLink = Nothing
127+ , _csdlrSuffix = Nothing
128+ , _csdlrDynamicLinkInfo = Nothing
129+ }
130+
131+-- | Full long Dynamic Link URL with desired query parameters specified. For
132+-- example,
133+-- \"https:\/\/sample.app.goo.gl\/?link=http:\/\/www.google.com&apn=com.sample\",
134+-- [Learn
135+-- more](https:\/\/firebase.google.com\/docs\/dynamic-links\/android#create-a-dynamic-link-programmatically).
136+csdlrLongDynamicLink :: Lens' CreateShortDynamicLinkRequest (Maybe Text)
137+csdlrLongDynamicLink
138+ = lens _csdlrLongDynamicLink
139+ (\ s a -> s{_csdlrLongDynamicLink = a})
140+
141+-- | Short Dynamic Link suffix. Optional.
142+csdlrSuffix :: Lens' CreateShortDynamicLinkRequest (Maybe Suffix)
143+csdlrSuffix
144+ = lens _csdlrSuffix (\ s a -> s{_csdlrSuffix = a})
145+
146+-- | Information about the Dynamic Link to be shortened. [Learn
147+-- more](https:\/\/firebase.google.com\/docs\/dynamic-links\/android#create-a-dynamic-link-programmatically).
148+csdlrDynamicLinkInfo :: Lens' CreateShortDynamicLinkRequest (Maybe DynamicLinkInfo)
149+csdlrDynamicLinkInfo
150+ = lens _csdlrDynamicLinkInfo
151+ (\ s a -> s{_csdlrDynamicLinkInfo = a})
152+
153+instance FromJSON CreateShortDynamicLinkRequest where
154+ parseJSON
155+ = withObject "CreateShortDynamicLinkRequest"
156+ (\ o ->
157+ CreateShortDynamicLinkRequest' <$>
158+ (o .:? "longDynamicLink") <*> (o .:? "suffix") <*>
159+ (o .:? "dynamicLinkInfo"))
160+
161+instance ToJSON CreateShortDynamicLinkRequest where
162+ toJSON CreateShortDynamicLinkRequest'{..}
163+ = object
164+ (catMaybes
165+ [("longDynamicLink" .=) <$> _csdlrLongDynamicLink,
166+ ("suffix" .=) <$> _csdlrSuffix,
167+ ("dynamicLinkInfo" .=) <$> _csdlrDynamicLinkInfo])
168+
169+-- | Parameters for social meta tag params. Used to set meta tag data for
170+-- link previews on social sites.
171+--
172+-- /See:/ 'socialMetaTagInfo' smart constructor.
173+data SocialMetaTagInfo = SocialMetaTagInfo'
174+ { _smtiSocialImageLink :: !(Maybe Text)
175+ , _smtiSocialDescription :: !(Maybe Text)
176+ , _smtiSocialTitle :: !(Maybe Text)
177+ } deriving (Eq,Show,Data,Typeable,Generic)
178+
179+-- | Creates a value of 'SocialMetaTagInfo' with the minimum fields required to make a request.
180+--
181+-- Use one of the following lenses to modify other fields as desired:
182+--
183+-- * 'smtiSocialImageLink'
184+--
185+-- * 'smtiSocialDescription'
186+--
187+-- * 'smtiSocialTitle'
188+socialMetaTagInfo
189+ :: SocialMetaTagInfo
190+socialMetaTagInfo =
191+ SocialMetaTagInfo'
192+ { _smtiSocialImageLink = Nothing
193+ , _smtiSocialDescription = Nothing
194+ , _smtiSocialTitle = Nothing
195+ }
196+
197+-- | An image url string. Optional.
198+smtiSocialImageLink :: Lens' SocialMetaTagInfo (Maybe Text)
199+smtiSocialImageLink
200+ = lens _smtiSocialImageLink
201+ (\ s a -> s{_smtiSocialImageLink = a})
202+
203+-- | A short description of the link. Optional.
204+smtiSocialDescription :: Lens' SocialMetaTagInfo (Maybe Text)
205+smtiSocialDescription
206+ = lens _smtiSocialDescription
207+ (\ s a -> s{_smtiSocialDescription = a})
208+
209+-- | Title to be displayed. Optional.
210+smtiSocialTitle :: Lens' SocialMetaTagInfo (Maybe Text)
211+smtiSocialTitle
212+ = lens _smtiSocialTitle
213+ (\ s a -> s{_smtiSocialTitle = a})
214+
215+instance FromJSON SocialMetaTagInfo where
216+ parseJSON
217+ = withObject "SocialMetaTagInfo"
218+ (\ o ->
219+ SocialMetaTagInfo' <$>
220+ (o .:? "socialImageLink") <*>
221+ (o .:? "socialDescription")
222+ <*> (o .:? "socialTitle"))
223+
224+instance ToJSON SocialMetaTagInfo where
225+ toJSON SocialMetaTagInfo'{..}
226+ = object
227+ (catMaybes
228+ [("socialImageLink" .=) <$> _smtiSocialImageLink,
229+ ("socialDescription" .=) <$> _smtiSocialDescription,
230+ ("socialTitle" .=) <$> _smtiSocialTitle])
231+
232+-- | Response to create a short Dynamic Link.
233+--
234+-- /See:/ 'createShortDynamicLinkResponse' smart constructor.
235+data CreateShortDynamicLinkResponse = CreateShortDynamicLinkResponse'
236+ { _csdlrPreviewLink :: !(Maybe Text)
237+ , _csdlrWarning :: !(Maybe [DynamicLinkWarning])
238+ , _csdlrShortLink :: !(Maybe Text)
239+ } deriving (Eq,Show,Data,Typeable,Generic)
240+
241+-- | Creates a value of 'CreateShortDynamicLinkResponse' with the minimum fields required to make a request.
242+--
243+-- Use one of the following lenses to modify other fields as desired:
244+--
245+-- * 'csdlrPreviewLink'
246+--
247+-- * 'csdlrWarning'
248+--
249+-- * 'csdlrShortLink'
250+createShortDynamicLinkResponse
251+ :: CreateShortDynamicLinkResponse
252+createShortDynamicLinkResponse =
253+ CreateShortDynamicLinkResponse'
254+ { _csdlrPreviewLink = Nothing
255+ , _csdlrWarning = Nothing
256+ , _csdlrShortLink = Nothing
257+ }
258+
259+-- | Preivew link to show the link flow chart.
260+csdlrPreviewLink :: Lens' CreateShortDynamicLinkResponse (Maybe Text)
261+csdlrPreviewLink
262+ = lens _csdlrPreviewLink
263+ (\ s a -> s{_csdlrPreviewLink = a})
264+
265+-- | Information about potential warnings on link creation.
266+csdlrWarning :: Lens' CreateShortDynamicLinkResponse [DynamicLinkWarning]
267+csdlrWarning
268+ = lens _csdlrWarning (\ s a -> s{_csdlrWarning = a})
269+ . _Default
270+ . _Coerce
271+
272+-- | Short Dynamic Link value. e.g. https:\/\/abcd.app.goo.gl\/wxyz
273+csdlrShortLink :: Lens' CreateShortDynamicLinkResponse (Maybe Text)
274+csdlrShortLink
275+ = lens _csdlrShortLink
276+ (\ s a -> s{_csdlrShortLink = a})
277+
278+instance FromJSON CreateShortDynamicLinkResponse
279+ where
280+ parseJSON
281+ = withObject "CreateShortDynamicLinkResponse"
282+ (\ o ->
283+ CreateShortDynamicLinkResponse' <$>
284+ (o .:? "previewLink") <*>
285+ (o .:? "warning" .!= mempty)
286+ <*> (o .:? "shortLink"))
287+
288+instance ToJSON CreateShortDynamicLinkResponse where
289+ toJSON CreateShortDynamicLinkResponse'{..}
290+ = object
291+ (catMaybes
292+ [("previewLink" .=) <$> _csdlrPreviewLink,
293+ ("warning" .=) <$> _csdlrWarning,
294+ ("shortLink" .=) <$> _csdlrShortLink])
295+
296+-- | iOS related attributes to the Dynamic Link..
297+--
298+-- /See:/ 'iosInfo' smart constructor.
299+data IosInfo = IosInfo'
300+ { _iiIosBundleId :: !(Maybe Text)
301+ , _iiIosIPadBundleId :: !(Maybe Text)
302+ , _iiIosAppStoreId :: !(Maybe Text)
303+ , _iiIosIPadFallbackLink :: !(Maybe Text)
304+ , _iiIosCustomScheme :: !(Maybe Text)
305+ , _iiIosFallbackLink :: !(Maybe Text)
306+ } deriving (Eq,Show,Data,Typeable,Generic)
307+
308+-- | Creates a value of 'IosInfo' with the minimum fields required to make a request.
309+--
310+-- Use one of the following lenses to modify other fields as desired:
311+--
312+-- * 'iiIosBundleId'
313+--
314+-- * 'iiIosIPadBundleId'
315+--
316+-- * 'iiIosAppStoreId'
317+--
318+-- * 'iiIosIPadFallbackLink'
319+--
320+-- * 'iiIosCustomScheme'
321+--
322+-- * 'iiIosFallbackLink'
323+iosInfo
324+ :: IosInfo
325+iosInfo =
326+ IosInfo'
327+ { _iiIosBundleId = Nothing
328+ , _iiIosIPadBundleId = Nothing
329+ , _iiIosAppStoreId = Nothing
330+ , _iiIosIPadFallbackLink = Nothing
331+ , _iiIosCustomScheme = Nothing
332+ , _iiIosFallbackLink = Nothing
333+ }
334+
335+-- | iOS bundle ID of the app.
336+iiIosBundleId :: Lens' IosInfo (Maybe Text)
337+iiIosBundleId
338+ = lens _iiIosBundleId
339+ (\ s a -> s{_iiIosBundleId = a})
340+
341+-- | iPad bundle ID of the app.
342+iiIosIPadBundleId :: Lens' IosInfo (Maybe Text)
343+iiIosIPadBundleId
344+ = lens _iiIosIPadBundleId
345+ (\ s a -> s{_iiIosIPadBundleId = a})
346+
347+-- | iOS App Store ID.
348+iiIosAppStoreId :: Lens' IosInfo (Maybe Text)
349+iiIosAppStoreId
350+ = lens _iiIosAppStoreId
351+ (\ s a -> s{_iiIosAppStoreId = a})
352+
353+-- | If specified, this overrides the ios_fallback_link value on iPads.
354+iiIosIPadFallbackLink :: Lens' IosInfo (Maybe Text)
355+iiIosIPadFallbackLink
356+ = lens _iiIosIPadFallbackLink
357+ (\ s a -> s{_iiIosIPadFallbackLink = a})
358+
359+-- | Custom (destination) scheme to use for iOS. By default, we’ll use the
360+-- bundle ID as the custom scheme. Developer can override this behavior
361+-- using this param.
362+iiIosCustomScheme :: Lens' IosInfo (Maybe Text)
363+iiIosCustomScheme
364+ = lens _iiIosCustomScheme
365+ (\ s a -> s{_iiIosCustomScheme = a})
366+
367+-- | Link to open on iOS if the app is not installed.
368+iiIosFallbackLink :: Lens' IosInfo (Maybe Text)
369+iiIosFallbackLink
370+ = lens _iiIosFallbackLink
371+ (\ s a -> s{_iiIosFallbackLink = a})
372+
373+instance FromJSON IosInfo where
374+ parseJSON
375+ = withObject "IosInfo"
376+ (\ o ->
377+ IosInfo' <$>
378+ (o .:? "iosBundleId") <*> (o .:? "iosIpadBundleId")
379+ <*> (o .:? "iosAppStoreId")
380+ <*> (o .:? "iosIpadFallbackLink")
381+ <*> (o .:? "iosCustomScheme")
382+ <*> (o .:? "iosFallbackLink"))
383+
384+instance ToJSON IosInfo where
385+ toJSON IosInfo'{..}
386+ = object
387+ (catMaybes
388+ [("iosBundleId" .=) <$> _iiIosBundleId,
389+ ("iosIpadBundleId" .=) <$> _iiIosIPadBundleId,
390+ ("iosAppStoreId" .=) <$> _iiIosAppStoreId,
391+ ("iosIpadFallbackLink" .=) <$>
392+ _iiIosIPadFallbackLink,
393+ ("iosCustomScheme" .=) <$> _iiIosCustomScheme,
394+ ("iosFallbackLink" .=) <$> _iiIosFallbackLink])
395+
396+-- | Information about a Dynamic Link.
397+--
398+-- /See:/ 'dynamicLinkInfo' smart constructor.
399+data DynamicLinkInfo = DynamicLinkInfo'
400+ { _dliSocialMetaTagInfo :: !(Maybe SocialMetaTagInfo)
401+ , _dliDynamicLinkDomain :: !(Maybe Text)
402+ , _dliLink :: !(Maybe Text)
403+ , _dliIosInfo :: !(Maybe IosInfo)
404+ , _dliIsAd :: !(Maybe Bool)
405+ , _dliAndroidInfo :: !(Maybe AndroidInfo)
406+ , _dliAnalyticsInfo :: !(Maybe AnalyticsInfo)
407+ } deriving (Eq,Show,Data,Typeable,Generic)
408+
409+-- | Creates a value of 'DynamicLinkInfo' with the minimum fields required to make a request.
410+--
411+-- Use one of the following lenses to modify other fields as desired:
412+--
413+-- * 'dliSocialMetaTagInfo'
414+--
415+-- * 'dliDynamicLinkDomain'
416+--
417+-- * 'dliLink'
418+--
419+-- * 'dliIosInfo'
420+--
421+-- * 'dliIsAd'
422+--
423+-- * 'dliAndroidInfo'
424+--
425+-- * 'dliAnalyticsInfo'
426+dynamicLinkInfo
427+ :: DynamicLinkInfo
428+dynamicLinkInfo =
429+ DynamicLinkInfo'
430+ { _dliSocialMetaTagInfo = Nothing
431+ , _dliDynamicLinkDomain = Nothing
432+ , _dliLink = Nothing
433+ , _dliIosInfo = Nothing
434+ , _dliIsAd = Nothing
435+ , _dliAndroidInfo = Nothing
436+ , _dliAnalyticsInfo = Nothing
437+ }
438+
439+-- | Parameters for social meta tag params. Used to set meta tag data for
440+-- link previews on social sites.
441+dliSocialMetaTagInfo :: Lens' DynamicLinkInfo (Maybe SocialMetaTagInfo)
442+dliSocialMetaTagInfo
443+ = lens _dliSocialMetaTagInfo
444+ (\ s a -> s{_dliSocialMetaTagInfo = a})
445+
446+-- | Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl [Learn
447+-- more](https:\/\/firebase.google.com\/docs\/dynamic-links\/android#set-up-firebase-and-the-dynamic-links-sdk)
448+-- on how to set up Dynamic Link domain associated with your Firebase
449+-- project. Required.
450+dliDynamicLinkDomain :: Lens' DynamicLinkInfo (Maybe Text)
451+dliDynamicLinkDomain
452+ = lens _dliDynamicLinkDomain
453+ (\ s a -> s{_dliDynamicLinkDomain = a})
454+
455+-- | The link your app will open, You can specify any URL your app can
456+-- handle. This link must be a well-formatted URL, be properly URL-encoded,
457+-- and use the HTTP or HTTPS scheme. See \'link\' parameters in the
458+-- [documentation](https:\/\/firebase.google.com\/docs\/dynamic-links\/android#create-a-dynamic-link-programmatically).
459+-- Required.
460+dliLink :: Lens' DynamicLinkInfo (Maybe Text)
461+dliLink = lens _dliLink (\ s a -> s{_dliLink = a})
462+
463+-- | iOS related information. See iOS related parameters in the
464+-- [documentation](https:\/\/firebase.google.com\/docs\/dynamic-links\/ios#create-a-dynamic-link-programmatically).
465+dliIosInfo :: Lens' DynamicLinkInfo (Maybe IosInfo)
466+dliIosInfo
467+ = lens _dliIosInfo (\ s a -> s{_dliIosInfo = a})
468+
469+-- | Declares that the Dynamic Link is used in an advertisement. See the
470+-- \'ad\' parameter in the
471+-- [documentation](https:\/\/firebase.google.com\/docs\/dynamic-links\/android#create-a-dynamic-link-programmatically).
472+dliIsAd :: Lens' DynamicLinkInfo (Maybe Bool)
473+dliIsAd = lens _dliIsAd (\ s a -> s{_dliIsAd = a})
474+
475+-- | Android related information. See Android related parameters in the
476+-- [documentation](https:\/\/firebase.google.com\/docs\/dynamic-links\/android#create-a-dynamic-link-programmatically).
477+dliAndroidInfo :: Lens' DynamicLinkInfo (Maybe AndroidInfo)
478+dliAndroidInfo
479+ = lens _dliAndroidInfo
480+ (\ s a -> s{_dliAndroidInfo = a})
481+
482+-- | Parameters used for tracking. See all tracking parameters in the
483+-- [documentation](https:\/\/firebase.google.com\/docs\/dynamic-links\/android#create-a-dynamic-link-programmatically).
484+dliAnalyticsInfo :: Lens' DynamicLinkInfo (Maybe AnalyticsInfo)
485+dliAnalyticsInfo
486+ = lens _dliAnalyticsInfo
487+ (\ s a -> s{_dliAnalyticsInfo = a})
488+
489+instance FromJSON DynamicLinkInfo where
490+ parseJSON
491+ = withObject "DynamicLinkInfo"
492+ (\ o ->
493+ DynamicLinkInfo' <$>
494+ (o .:? "socialMetaTagInfo") <*>
495+ (o .:? "dynamicLinkDomain")
496+ <*> (o .:? "link")
497+ <*> (o .:? "iosInfo")
498+ <*> (o .:? "isAd")
499+ <*> (o .:? "androidInfo")
500+ <*> (o .:? "analyticsInfo"))
501+
502+instance ToJSON DynamicLinkInfo where
503+ toJSON DynamicLinkInfo'{..}
504+ = object
505+ (catMaybes
506+ [("socialMetaTagInfo" .=) <$> _dliSocialMetaTagInfo,
507+ ("dynamicLinkDomain" .=) <$> _dliDynamicLinkDomain,
508+ ("link" .=) <$> _dliLink,
509+ ("iosInfo" .=) <$> _dliIosInfo,
510+ ("isAd" .=) <$> _dliIsAd,
511+ ("androidInfo" .=) <$> _dliAndroidInfo,
512+ ("analyticsInfo" .=) <$> _dliAnalyticsInfo])
513+
514+-- | Android related attributes to the Dynamic Link.
515+--
516+-- /See:/ 'androidInfo' smart constructor.
517+data AndroidInfo = AndroidInfo'
518+ { _aiAndroidMinPackageVersionCode :: !(Maybe Text)
519+ , _aiAndroidFallbackLink :: !(Maybe Text)
520+ , _aiAndroidLink :: !(Maybe Text)
521+ , _aiAndroidPackageName :: !(Maybe Text)
522+ } deriving (Eq,Show,Data,Typeable,Generic)
523+
524+-- | Creates a value of 'AndroidInfo' with the minimum fields required to make a request.
525+--
526+-- Use one of the following lenses to modify other fields as desired:
527+--
528+-- * 'aiAndroidMinPackageVersionCode'
529+--
530+-- * 'aiAndroidFallbackLink'
531+--
532+-- * 'aiAndroidLink'
533+--
534+-- * 'aiAndroidPackageName'
535+androidInfo
536+ :: AndroidInfo
537+androidInfo =
538+ AndroidInfo'
539+ { _aiAndroidMinPackageVersionCode = Nothing
540+ , _aiAndroidFallbackLink = Nothing
541+ , _aiAndroidLink = Nothing
542+ , _aiAndroidPackageName = Nothing
543+ }
544+
545+-- | Minimum version code for the Android app. If the installed app’s version
546+-- code is lower, then the user is taken to the Play Store.
547+aiAndroidMinPackageVersionCode :: Lens' AndroidInfo (Maybe Text)
548+aiAndroidMinPackageVersionCode
549+ = lens _aiAndroidMinPackageVersionCode
550+ (\ s a -> s{_aiAndroidMinPackageVersionCode = a})
551+
552+-- | Link to open on Android if the app is not installed.
553+aiAndroidFallbackLink :: Lens' AndroidInfo (Maybe Text)
554+aiAndroidFallbackLink
555+ = lens _aiAndroidFallbackLink
556+ (\ s a -> s{_aiAndroidFallbackLink = a})
557+
558+-- | If specified, this overrides the ‘link’ parameter on Android.
559+aiAndroidLink :: Lens' AndroidInfo (Maybe Text)
560+aiAndroidLink
561+ = lens _aiAndroidLink
562+ (\ s a -> s{_aiAndroidLink = a})
563+
564+-- | Android package name of the app.
565+aiAndroidPackageName :: Lens' AndroidInfo (Maybe Text)
566+aiAndroidPackageName
567+ = lens _aiAndroidPackageName
568+ (\ s a -> s{_aiAndroidPackageName = a})
569+
570+instance FromJSON AndroidInfo where
571+ parseJSON
572+ = withObject "AndroidInfo"
573+ (\ o ->
574+ AndroidInfo' <$>
575+ (o .:? "androidMinPackageVersionCode") <*>
576+ (o .:? "androidFallbackLink")
577+ <*> (o .:? "androidLink")
578+ <*> (o .:? "androidPackageName"))
579+
580+instance ToJSON AndroidInfo where
581+ toJSON AndroidInfo'{..}
582+ = object
583+ (catMaybes
584+ [("androidMinPackageVersionCode" .=) <$>
585+ _aiAndroidMinPackageVersionCode,
586+ ("androidFallbackLink" .=) <$>
587+ _aiAndroidFallbackLink,
588+ ("androidLink" .=) <$> _aiAndroidLink,
589+ ("androidPackageName" .=) <$> _aiAndroidPackageName])
590+
591+-- | Tracking parameters supported by Dynamic Link.
592+--
593+-- /See:/ 'analyticsInfo' smart constructor.
594+data AnalyticsInfo = AnalyticsInfo'
595+ { _aiItunesConnectAnalytics :: !(Maybe ITunesConnectAnalytics)
596+ , _aiGooglePlayAnalytics :: !(Maybe GooglePlayAnalytics)
597+ } deriving (Eq,Show,Data,Typeable,Generic)
598+
599+-- | Creates a value of 'AnalyticsInfo' with the minimum fields required to make a request.
600+--
601+-- Use one of the following lenses to modify other fields as desired:
602+--
603+-- * 'aiItunesConnectAnalytics'
604+--
605+-- * 'aiGooglePlayAnalytics'
606+analyticsInfo
607+ :: AnalyticsInfo
608+analyticsInfo =
609+ AnalyticsInfo'
610+ { _aiItunesConnectAnalytics = Nothing
611+ , _aiGooglePlayAnalytics = Nothing
612+ }
613+
614+-- | iTunes Connect App Analytics.
615+aiItunesConnectAnalytics :: Lens' AnalyticsInfo (Maybe ITunesConnectAnalytics)
616+aiItunesConnectAnalytics
617+ = lens _aiItunesConnectAnalytics
618+ (\ s a -> s{_aiItunesConnectAnalytics = a})
619+
620+-- | Google Play Campaign Measurements.
621+aiGooglePlayAnalytics :: Lens' AnalyticsInfo (Maybe GooglePlayAnalytics)
622+aiGooglePlayAnalytics
623+ = lens _aiGooglePlayAnalytics
624+ (\ s a -> s{_aiGooglePlayAnalytics = a})
625+
626+instance FromJSON AnalyticsInfo where
627+ parseJSON
628+ = withObject "AnalyticsInfo"
629+ (\ o ->
630+ AnalyticsInfo' <$>
631+ (o .:? "itunesConnectAnalytics") <*>
632+ (o .:? "googlePlayAnalytics"))
633+
634+instance ToJSON AnalyticsInfo where
635+ toJSON AnalyticsInfo'{..}
636+ = object
637+ (catMaybes
638+ [("itunesConnectAnalytics" .=) <$>
639+ _aiItunesConnectAnalytics,
640+ ("googlePlayAnalytics" .=) <$>
641+ _aiGooglePlayAnalytics])
642+
643+-- | Parameters for iTunes Connect App Analytics.
644+--
645+-- /See:/ 'iTunesConnectAnalytics' smart constructor.
646+data ITunesConnectAnalytics = ITunesConnectAnalytics'
647+ { _itcaAt :: !(Maybe Text)
648+ , _itcaMt :: !(Maybe Text)
649+ , _itcaPt :: !(Maybe Text)
650+ , _itcaCt :: !(Maybe Text)
651+ } deriving (Eq,Show,Data,Typeable,Generic)
652+
653+-- | Creates a value of 'ITunesConnectAnalytics' with the minimum fields required to make a request.
654+--
655+-- Use one of the following lenses to modify other fields as desired:
656+--
657+-- * 'itcaAt'
658+--
659+-- * 'itcaMt'
660+--
661+-- * 'itcaPt'
662+--
663+-- * 'itcaCt'
664+iTunesConnectAnalytics
665+ :: ITunesConnectAnalytics
666+iTunesConnectAnalytics =
667+ ITunesConnectAnalytics'
668+ { _itcaAt = Nothing
669+ , _itcaMt = Nothing
670+ , _itcaPt = Nothing
671+ , _itcaCt = Nothing
672+ }
673+
674+-- | Affiliate token used to create affiliate-coded links.
675+itcaAt :: Lens' ITunesConnectAnalytics (Maybe Text)
676+itcaAt = lens _itcaAt (\ s a -> s{_itcaAt = a})
677+
678+-- | iTune media types, including music, podcasts, audiobooks and so on.
679+itcaMt :: Lens' ITunesConnectAnalytics (Maybe Text)
680+itcaMt = lens _itcaMt (\ s a -> s{_itcaMt = a})
681+
682+-- | Provider token that enables analytics for Dynamic Links from within
683+-- iTunes Connect.
684+itcaPt :: Lens' ITunesConnectAnalytics (Maybe Text)
685+itcaPt = lens _itcaPt (\ s a -> s{_itcaPt = a})
686+
687+-- | Campaign text that developers can optionally add to any link in order to
688+-- track sales from a specific marketing campaign.
689+itcaCt :: Lens' ITunesConnectAnalytics (Maybe Text)
690+itcaCt = lens _itcaCt (\ s a -> s{_itcaCt = a})
691+
692+instance FromJSON ITunesConnectAnalytics where
693+ parseJSON
694+ = withObject "ITunesConnectAnalytics"
695+ (\ o ->
696+ ITunesConnectAnalytics' <$>
697+ (o .:? "at") <*> (o .:? "mt") <*> (o .:? "pt") <*>
698+ (o .:? "ct"))
699+
700+instance ToJSON ITunesConnectAnalytics where
701+ toJSON ITunesConnectAnalytics'{..}
702+ = object
703+ (catMaybes
704+ [("at" .=) <$> _itcaAt, ("mt" .=) <$> _itcaMt,
705+ ("pt" .=) <$> _itcaPt, ("ct" .=) <$> _itcaCt])
706+
707+-- | Parameters for Google Play Campaign Measurements. [Learn
708+-- more](https:\/\/developers.google.com\/analytics\/devguides\/collection\/android\/v4\/campaigns#campaign-params)
709+--
710+-- /See:/ 'googlePlayAnalytics' smart constructor.
711+data GooglePlayAnalytics = GooglePlayAnalytics'
712+ { _gpaUtmContent :: !(Maybe Text)
713+ , _gpaUtmMedium :: !(Maybe Text)
714+ , _gpaUtmTerm :: !(Maybe Text)
715+ , _gpaUtmCampaign :: !(Maybe Text)
716+ , _gpaGclid :: !(Maybe Text)
717+ , _gpaUtmSource :: !(Maybe Text)
718+ } deriving (Eq,Show,Data,Typeable,Generic)
719+
720+-- | Creates a value of 'GooglePlayAnalytics' with the minimum fields required to make a request.
721+--
722+-- Use one of the following lenses to modify other fields as desired:
723+--
724+-- * 'gpaUtmContent'
725+--
726+-- * 'gpaUtmMedium'
727+--
728+-- * 'gpaUtmTerm'
729+--
730+-- * 'gpaUtmCampaign'
731+--
732+-- * 'gpaGclid'
733+--
734+-- * 'gpaUtmSource'
735+googlePlayAnalytics
736+ :: GooglePlayAnalytics
737+googlePlayAnalytics =
738+ GooglePlayAnalytics'
739+ { _gpaUtmContent = Nothing
740+ , _gpaUtmMedium = Nothing
741+ , _gpaUtmTerm = Nothing
742+ , _gpaUtmCampaign = Nothing
743+ , _gpaGclid = Nothing
744+ , _gpaUtmSource = Nothing
745+ }
746+
747+-- | Campaign content; used for A\/B testing and content-targeted ads to
748+-- differentiate ads or links that point to the same URL.
749+gpaUtmContent :: Lens' GooglePlayAnalytics (Maybe Text)
750+gpaUtmContent
751+ = lens _gpaUtmContent
752+ (\ s a -> s{_gpaUtmContent = a})
753+
754+-- | Campaign medium; used to identify a medium such as email or
755+-- cost-per-click.
756+gpaUtmMedium :: Lens' GooglePlayAnalytics (Maybe Text)
757+gpaUtmMedium
758+ = lens _gpaUtmMedium (\ s a -> s{_gpaUtmMedium = a})
759+
760+-- | Campaign term; used with paid search to supply the keywords for ads.
761+gpaUtmTerm :: Lens' GooglePlayAnalytics (Maybe Text)
762+gpaUtmTerm
763+ = lens _gpaUtmTerm (\ s a -> s{_gpaUtmTerm = a})
764+
765+-- | Campaign name; used for keyword analysis to identify a specific product
766+-- promotion or strategic campaign.
767+gpaUtmCampaign :: Lens' GooglePlayAnalytics (Maybe Text)
768+gpaUtmCampaign
769+ = lens _gpaUtmCampaign
770+ (\ s a -> s{_gpaUtmCampaign = a})
771+
772+-- | [AdWords autotagging
773+-- parameter](https:\/\/support.google.com\/analytics\/answer\/1033981?hl=en);
774+-- used to measure Google AdWords ads. This value is generated dynamically
775+-- and should never be modified.
776+gpaGclid :: Lens' GooglePlayAnalytics (Maybe Text)
777+gpaGclid = lens _gpaGclid (\ s a -> s{_gpaGclid = a})
778+
779+-- | Campaign source; used to identify a search engine, newsletter, or other
780+-- source.
781+gpaUtmSource :: Lens' GooglePlayAnalytics (Maybe Text)
782+gpaUtmSource
783+ = lens _gpaUtmSource (\ s a -> s{_gpaUtmSource = a})
784+
785+instance FromJSON GooglePlayAnalytics where
786+ parseJSON
787+ = withObject "GooglePlayAnalytics"
788+ (\ o ->
789+ GooglePlayAnalytics' <$>
790+ (o .:? "utmContent") <*> (o .:? "utmMedium") <*>
791+ (o .:? "utmTerm")
792+ <*> (o .:? "utmCampaign")
793+ <*> (o .:? "gclid")
794+ <*> (o .:? "utmSource"))
795+
796+instance ToJSON GooglePlayAnalytics where
797+ toJSON GooglePlayAnalytics'{..}
798+ = object
799+ (catMaybes
800+ [("utmContent" .=) <$> _gpaUtmContent,
801+ ("utmMedium" .=) <$> _gpaUtmMedium,
802+ ("utmTerm" .=) <$> _gpaUtmTerm,
803+ ("utmCampaign" .=) <$> _gpaUtmCampaign,
804+ ("gclid" .=) <$> _gpaGclid,
805+ ("utmSource" .=) <$> _gpaUtmSource])