@@ -0,0 +1,7628 @@
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.AdExchangeBuyer2.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.AdExchangeBuyer2.Types.Product where
19+
20+import Network.Google.AdExchangeBuyer2.Types.Sum
21+import Network.Google.Prelude
22+
23+-- | HTML content for a creative.
24+--
25+-- /See:/ 'htmlContent' smart constructor.
26+data HTMLContent = HTMLContent'
27+ { _hcHeight :: !(Maybe (Textual Int32))
28+ , _hcSnippet :: !(Maybe Text)
29+ , _hcWidth :: !(Maybe (Textual Int32))
30+ } deriving (Eq,Show,Data,Typeable,Generic)
31+
32+-- | Creates a value of 'HTMLContent' with the minimum fields required to make a request.
33+--
34+-- Use one of the following lenses to modify other fields as desired:
35+--
36+-- * 'hcHeight'
37+--
38+-- * 'hcSnippet'
39+--
40+-- * 'hcWidth'
41+htmlContent
42+ :: HTMLContent
43+htmlContent =
44+ HTMLContent'
45+ { _hcHeight = Nothing
46+ , _hcSnippet = Nothing
47+ , _hcWidth = Nothing
48+ }
49+
50+-- | The height of the HTML snippet in pixels.
51+hcHeight :: Lens' HTMLContent (Maybe Int32)
52+hcHeight
53+ = lens _hcHeight (\ s a -> s{_hcHeight = a}) .
54+ mapping _Coerce
55+
56+-- | The HTML snippet that displays the ad when inserted in the web page.
57+hcSnippet :: Lens' HTMLContent (Maybe Text)
58+hcSnippet
59+ = lens _hcSnippet (\ s a -> s{_hcSnippet = a})
60+
61+-- | The width of the HTML snippet in pixels.
62+hcWidth :: Lens' HTMLContent (Maybe Int32)
63+hcWidth
64+ = lens _hcWidth (\ s a -> s{_hcWidth = a}) .
65+ mapping _Coerce
66+
67+instance FromJSON HTMLContent where
68+ parseJSON
69+ = withObject "HTMLContent"
70+ (\ o ->
71+ HTMLContent' <$>
72+ (o .:? "height") <*> (o .:? "snippet") <*>
73+ (o .:? "width"))
74+
75+instance ToJSON HTMLContent where
76+ toJSON HTMLContent'{..}
77+ = object
78+ (catMaybes
79+ [("height" .=) <$> _hcHeight,
80+ ("snippet" .=) <$> _hcSnippet,
81+ ("width" .=) <$> _hcWidth])
82+
83+-- | Response message for listing all reasons that bids were filtered from
84+-- the auction.
85+--
86+-- /See:/ 'listFilteredBidsResponse' smart constructor.
87+data ListFilteredBidsResponse = ListFilteredBidsResponse'
88+ { _lfbrNextPageToken :: !(Maybe Text)
89+ , _lfbrCreativeStatusRows :: !(Maybe [CreativeStatusRow])
90+ } deriving (Eq,Show,Data,Typeable,Generic)
91+
92+-- | Creates a value of 'ListFilteredBidsResponse' with the minimum fields required to make a request.
93+--
94+-- Use one of the following lenses to modify other fields as desired:
95+--
96+-- * 'lfbrNextPageToken'
97+--
98+-- * 'lfbrCreativeStatusRows'
99+listFilteredBidsResponse
100+ :: ListFilteredBidsResponse
101+listFilteredBidsResponse =
102+ ListFilteredBidsResponse'
103+ { _lfbrNextPageToken = Nothing
104+ , _lfbrCreativeStatusRows = Nothing
105+ }
106+
107+-- | A token to retrieve the next page of results. Pass this value in the
108+-- ListFilteredBidsRequest.pageToken field in the subsequent call to the
109+-- filteredBids.list method to retrieve the next page of results.
110+lfbrNextPageToken :: Lens' ListFilteredBidsResponse (Maybe Text)
111+lfbrNextPageToken
112+ = lens _lfbrNextPageToken
113+ (\ s a -> s{_lfbrNextPageToken = a})
114+
115+-- | List of rows, with counts of filtered bids aggregated by filtering
116+-- reason (i.e. creative status).
117+lfbrCreativeStatusRows :: Lens' ListFilteredBidsResponse [CreativeStatusRow]
118+lfbrCreativeStatusRows
119+ = lens _lfbrCreativeStatusRows
120+ (\ s a -> s{_lfbrCreativeStatusRows = a})
121+ . _Default
122+ . _Coerce
123+
124+instance FromJSON ListFilteredBidsResponse where
125+ parseJSON
126+ = withObject "ListFilteredBidsResponse"
127+ (\ o ->
128+ ListFilteredBidsResponse' <$>
129+ (o .:? "nextPageToken") <*>
130+ (o .:? "creativeStatusRows" .!= mempty))
131+
132+instance ToJSON ListFilteredBidsResponse where
133+ toJSON ListFilteredBidsResponse'{..}
134+ = object
135+ (catMaybes
136+ [("nextPageToken" .=) <$> _lfbrNextPageToken,
137+ ("creativeStatusRows" .=) <$>
138+ _lfbrCreativeStatusRows])
139+
140+-- | Request message to resume (unpause) serving for an already-finalized
141+-- proposal.
142+--
143+-- /See:/ 'resumeProposalRequest' smart constructor.
144+data ResumeProposalRequest =
145+ ResumeProposalRequest'
146+ deriving (Eq,Show,Data,Typeable,Generic)
147+
148+-- | Creates a value of 'ResumeProposalRequest' with the minimum fields required to make a request.
149+--
150+resumeProposalRequest
151+ :: ResumeProposalRequest
152+resumeProposalRequest = ResumeProposalRequest'
153+
154+instance FromJSON ResumeProposalRequest where
155+ parseJSON
156+ = withObject "ResumeProposalRequest"
157+ (\ o -> pure ResumeProposalRequest')
158+
159+instance ToJSON ResumeProposalRequest where
160+ toJSON = const emptyObject
161+
162+-- | Terms for Preferred Deals. Note that Preferred Deals cannot be created
163+-- via the API at this time, but can be returned in a get or list request.
164+--
165+-- /See:/ 'nonGuaranteedFixedPriceTerms' smart constructor.
166+newtype NonGuaranteedFixedPriceTerms = NonGuaranteedFixedPriceTerms'
167+ { _ngfptFixedPrices :: Maybe [PricePerBuyer]
168+ } deriving (Eq,Show,Data,Typeable,Generic)
169+
170+-- | Creates a value of 'NonGuaranteedFixedPriceTerms' with the minimum fields required to make a request.
171+--
172+-- Use one of the following lenses to modify other fields as desired:
173+--
174+-- * 'ngfptFixedPrices'
175+nonGuaranteedFixedPriceTerms
176+ :: NonGuaranteedFixedPriceTerms
177+nonGuaranteedFixedPriceTerms =
178+ NonGuaranteedFixedPriceTerms'
179+ { _ngfptFixedPrices = Nothing
180+ }
181+
182+-- | Fixed price for the specified buyer.
183+ngfptFixedPrices :: Lens' NonGuaranteedFixedPriceTerms [PricePerBuyer]
184+ngfptFixedPrices
185+ = lens _ngfptFixedPrices
186+ (\ s a -> s{_ngfptFixedPrices = a})
187+ . _Default
188+ . _Coerce
189+
190+instance FromJSON NonGuaranteedFixedPriceTerms where
191+ parseJSON
192+ = withObject "NonGuaranteedFixedPriceTerms"
193+ (\ o ->
194+ NonGuaranteedFixedPriceTerms' <$>
195+ (o .:? "fixedPrices" .!= mempty))
196+
197+instance ToJSON NonGuaranteedFixedPriceTerms where
198+ toJSON NonGuaranteedFixedPriceTerms'{..}
199+ = object
200+ (catMaybes
201+ [("fixedPrices" .=) <$> _ngfptFixedPrices])
202+
203+-- | A response for listing creative and deal associations
204+--
205+-- /See:/ 'listDealAssociationsResponse' smart constructor.
206+data ListDealAssociationsResponse = ListDealAssociationsResponse'
207+ { _ldarNextPageToken :: !(Maybe Text)
208+ , _ldarAssociations :: !(Maybe [CreativeDealAssociation])
209+ } deriving (Eq,Show,Data,Typeable,Generic)
210+
211+-- | Creates a value of 'ListDealAssociationsResponse' with the minimum fields required to make a request.
212+--
213+-- Use one of the following lenses to modify other fields as desired:
214+--
215+-- * 'ldarNextPageToken'
216+--
217+-- * 'ldarAssociations'
218+listDealAssociationsResponse
219+ :: ListDealAssociationsResponse
220+listDealAssociationsResponse =
221+ ListDealAssociationsResponse'
222+ { _ldarNextPageToken = Nothing
223+ , _ldarAssociations = Nothing
224+ }
225+
226+-- | A token to retrieve the next page of results. Pass this value in the
227+-- ListDealAssociationsRequest.page_token field in the subsequent call to
228+-- \'ListDealAssociation\' method to retrieve the next page of results.
229+ldarNextPageToken :: Lens' ListDealAssociationsResponse (Maybe Text)
230+ldarNextPageToken
231+ = lens _ldarNextPageToken
232+ (\ s a -> s{_ldarNextPageToken = a})
233+
234+-- | The list of associations.
235+ldarAssociations :: Lens' ListDealAssociationsResponse [CreativeDealAssociation]
236+ldarAssociations
237+ = lens _ldarAssociations
238+ (\ s a -> s{_ldarAssociations = a})
239+ . _Default
240+ . _Coerce
241+
242+instance FromJSON ListDealAssociationsResponse where
243+ parseJSON
244+ = withObject "ListDealAssociationsResponse"
245+ (\ o ->
246+ ListDealAssociationsResponse' <$>
247+ (o .:? "nextPageToken") <*>
248+ (o .:? "associations" .!= mempty))
249+
250+instance ToJSON ListDealAssociationsResponse where
251+ toJSON ListDealAssociationsResponse'{..}
252+ = object
253+ (catMaybes
254+ [("nextPageToken" .=) <$> _ldarNextPageToken,
255+ ("associations" .=) <$> _ldarAssociations])
256+
257+-- | An image resource. You may provide a larger image than was requested, so
258+-- long as the aspect ratio is preserved.
259+--
260+-- /See:/ 'image' smart constructor.
261+data Image = Image'
262+ { _iHeight :: !(Maybe (Textual Int32))
263+ , _iURL :: !(Maybe Text)
264+ , _iWidth :: !(Maybe (Textual Int32))
265+ } deriving (Eq,Show,Data,Typeable,Generic)
266+
267+-- | Creates a value of 'Image' with the minimum fields required to make a request.
268+--
269+-- Use one of the following lenses to modify other fields as desired:
270+--
271+-- * 'iHeight'
272+--
273+-- * 'iURL'
274+--
275+-- * 'iWidth'
276+image
277+ :: Image
278+image =
279+ Image'
280+ { _iHeight = Nothing
281+ , _iURL = Nothing
282+ , _iWidth = Nothing
283+ }
284+
285+-- | Image height in pixels.
286+iHeight :: Lens' Image (Maybe Int32)
287+iHeight
288+ = lens _iHeight (\ s a -> s{_iHeight = a}) .
289+ mapping _Coerce
290+
291+-- | The URL of the image.
292+iURL :: Lens' Image (Maybe Text)
293+iURL = lens _iURL (\ s a -> s{_iURL = a})
294+
295+-- | Image width in pixels.
296+iWidth :: Lens' Image (Maybe Int32)
297+iWidth
298+ = lens _iWidth (\ s a -> s{_iWidth = a}) .
299+ mapping _Coerce
300+
301+instance FromJSON Image where
302+ parseJSON
303+ = withObject "Image"
304+ (\ o ->
305+ Image' <$>
306+ (o .:? "height") <*> (o .:? "url") <*>
307+ (o .:? "width"))
308+
309+instance ToJSON Image where
310+ toJSON Image'{..}
311+ = object
312+ (catMaybes
313+ [("height" .=) <$> _iHeight, ("url" .=) <$> _iURL,
314+ ("width" .=) <$> _iWidth])
315+
316+-- | Represents targeting about various types of technology.
317+--
318+-- /See:/ 'technologyTargeting' smart constructor.
319+data TechnologyTargeting = TechnologyTargeting'
320+ { _ttDeviceCategoryTargeting :: !(Maybe CriteriaTargeting)
321+ , _ttOperatingSystemTargeting :: !(Maybe OperatingSystemTargeting)
322+ , _ttDeviceCapabilityTargeting :: !(Maybe CriteriaTargeting)
323+ } deriving (Eq,Show,Data,Typeable,Generic)
324+
325+-- | Creates a value of 'TechnologyTargeting' with the minimum fields required to make a request.
326+--
327+-- Use one of the following lenses to modify other fields as desired:
328+--
329+-- * 'ttDeviceCategoryTargeting'
330+--
331+-- * 'ttOperatingSystemTargeting'
332+--
333+-- * 'ttDeviceCapabilityTargeting'
334+technologyTargeting
335+ :: TechnologyTargeting
336+technologyTargeting =
337+ TechnologyTargeting'
338+ { _ttDeviceCategoryTargeting = Nothing
339+ , _ttOperatingSystemTargeting = Nothing
340+ , _ttDeviceCapabilityTargeting = Nothing
341+ }
342+
343+-- | IDs of device categories to be included\/excluded.
344+ttDeviceCategoryTargeting :: Lens' TechnologyTargeting (Maybe CriteriaTargeting)
345+ttDeviceCategoryTargeting
346+ = lens _ttDeviceCategoryTargeting
347+ (\ s a -> s{_ttDeviceCategoryTargeting = a})
348+
349+-- | Operating system related targeting information.
350+ttOperatingSystemTargeting :: Lens' TechnologyTargeting (Maybe OperatingSystemTargeting)
351+ttOperatingSystemTargeting
352+ = lens _ttOperatingSystemTargeting
353+ (\ s a -> s{_ttOperatingSystemTargeting = a})
354+
355+-- | IDs of device capabilities to be included\/excluded.
356+ttDeviceCapabilityTargeting :: Lens' TechnologyTargeting (Maybe CriteriaTargeting)
357+ttDeviceCapabilityTargeting
358+ = lens _ttDeviceCapabilityTargeting
359+ (\ s a -> s{_ttDeviceCapabilityTargeting = a})
360+
361+instance FromJSON TechnologyTargeting where
362+ parseJSON
363+ = withObject "TechnologyTargeting"
364+ (\ o ->
365+ TechnologyTargeting' <$>
366+ (o .:? "deviceCategoryTargeting") <*>
367+ (o .:? "operatingSystemTargeting")
368+ <*> (o .:? "deviceCapabilityTargeting"))
369+
370+instance ToJSON TechnologyTargeting where
371+ toJSON TechnologyTargeting'{..}
372+ = object
373+ (catMaybes
374+ [("deviceCategoryTargeting" .=) <$>
375+ _ttDeviceCategoryTargeting,
376+ ("operatingSystemTargeting" .=) <$>
377+ _ttOperatingSystemTargeting,
378+ ("deviceCapabilityTargeting" .=) <$>
379+ _ttDeviceCapabilityTargeting])
380+
381+-- | Response message for profiles visible to the buyer.
382+--
383+-- /See:/ 'listPublisherProFilesResponse' smart constructor.
384+data ListPublisherProFilesResponse = ListPublisherProFilesResponse'
385+ { _lppfrNextPageToken :: !(Maybe Text)
386+ , _lppfrPublisherProFiles :: !(Maybe [PublisherProFile])
387+ } deriving (Eq,Show,Data,Typeable,Generic)
388+
389+-- | Creates a value of 'ListPublisherProFilesResponse' with the minimum fields required to make a request.
390+--
391+-- Use one of the following lenses to modify other fields as desired:
392+--
393+-- * 'lppfrNextPageToken'
394+--
395+-- * 'lppfrPublisherProFiles'
396+listPublisherProFilesResponse
397+ :: ListPublisherProFilesResponse
398+listPublisherProFilesResponse =
399+ ListPublisherProFilesResponse'
400+ { _lppfrNextPageToken = Nothing
401+ , _lppfrPublisherProFiles = Nothing
402+ }
403+
404+-- | List pagination support
405+lppfrNextPageToken :: Lens' ListPublisherProFilesResponse (Maybe Text)
406+lppfrNextPageToken
407+ = lens _lppfrNextPageToken
408+ (\ s a -> s{_lppfrNextPageToken = a})
409+
410+-- | The list of matching publisher profiles.
411+lppfrPublisherProFiles :: Lens' ListPublisherProFilesResponse [PublisherProFile]
412+lppfrPublisherProFiles
413+ = lens _lppfrPublisherProFiles
414+ (\ s a -> s{_lppfrPublisherProFiles = a})
415+ . _Default
416+ . _Coerce
417+
418+instance FromJSON ListPublisherProFilesResponse where
419+ parseJSON
420+ = withObject "ListPublisherProFilesResponse"
421+ (\ o ->
422+ ListPublisherProFilesResponse' <$>
423+ (o .:? "nextPageToken") <*>
424+ (o .:? "publisherProfiles" .!= mempty))
425+
426+instance ToJSON ListPublisherProFilesResponse where
427+ toJSON ListPublisherProFilesResponse'{..}
428+ = object
429+ (catMaybes
430+ [("nextPageToken" .=) <$> _lppfrNextPageToken,
431+ ("publisherProfiles" .=) <$>
432+ _lppfrPublisherProFiles])
433+
434+-- | Terms for Private Auctions. Note that Private Auctions can be created
435+-- only by the seller, but they can be returned in a get or list request.
436+--
437+-- /See:/ 'nonGuaranteedAuctionTerms' smart constructor.
438+data NonGuaranteedAuctionTerms = NonGuaranteedAuctionTerms'
439+ { _ngatReservePricesPerBuyer :: !(Maybe [PricePerBuyer])
440+ , _ngatAutoOptimizePrivateAuction :: !(Maybe Bool)
441+ } deriving (Eq,Show,Data,Typeable,Generic)
442+
443+-- | Creates a value of 'NonGuaranteedAuctionTerms' with the minimum fields required to make a request.
444+--
445+-- Use one of the following lenses to modify other fields as desired:
446+--
447+-- * 'ngatReservePricesPerBuyer'
448+--
449+-- * 'ngatAutoOptimizePrivateAuction'
450+nonGuaranteedAuctionTerms
451+ :: NonGuaranteedAuctionTerms
452+nonGuaranteedAuctionTerms =
453+ NonGuaranteedAuctionTerms'
454+ { _ngatReservePricesPerBuyer = Nothing
455+ , _ngatAutoOptimizePrivateAuction = Nothing
456+ }
457+
458+-- | Reserve price for the specified buyer.
459+ngatReservePricesPerBuyer :: Lens' NonGuaranteedAuctionTerms [PricePerBuyer]
460+ngatReservePricesPerBuyer
461+ = lens _ngatReservePricesPerBuyer
462+ (\ s a -> s{_ngatReservePricesPerBuyer = a})
463+ . _Default
464+ . _Coerce
465+
466+-- | True if open auction buyers are allowed to compete with invited buyers
467+-- in this private auction.
468+ngatAutoOptimizePrivateAuction :: Lens' NonGuaranteedAuctionTerms (Maybe Bool)
469+ngatAutoOptimizePrivateAuction
470+ = lens _ngatAutoOptimizePrivateAuction
471+ (\ s a -> s{_ngatAutoOptimizePrivateAuction = a})
472+
473+instance FromJSON NonGuaranteedAuctionTerms where
474+ parseJSON
475+ = withObject "NonGuaranteedAuctionTerms"
476+ (\ o ->
477+ NonGuaranteedAuctionTerms' <$>
478+ (o .:? "reservePricesPerBuyer" .!= mempty) <*>
479+ (o .:? "autoOptimizePrivateAuction"))
480+
481+instance ToJSON NonGuaranteedAuctionTerms where
482+ toJSON NonGuaranteedAuctionTerms'{..}
483+ = object
484+ (catMaybes
485+ [("reservePricesPerBuyer" .=) <$>
486+ _ngatReservePricesPerBuyer,
487+ ("autoOptimizePrivateAuction" .=) <$>
488+ _ngatAutoOptimizePrivateAuction])
489+
490+--
491+-- /See:/ 'listClientUsersResponse' smart constructor.
492+data ListClientUsersResponse = ListClientUsersResponse'
493+ { _lcurNextPageToken :: !(Maybe Text)
494+ , _lcurUsers :: !(Maybe [ClientUser])
495+ } deriving (Eq,Show,Data,Typeable,Generic)
496+
497+-- | Creates a value of 'ListClientUsersResponse' with the minimum fields required to make a request.
498+--
499+-- Use one of the following lenses to modify other fields as desired:
500+--
501+-- * 'lcurNextPageToken'
502+--
503+-- * 'lcurUsers'
504+listClientUsersResponse
505+ :: ListClientUsersResponse
506+listClientUsersResponse =
507+ ListClientUsersResponse'
508+ { _lcurNextPageToken = Nothing
509+ , _lcurUsers = Nothing
510+ }
511+
512+-- | A token to retrieve the next page of results. Pass this value in the
513+-- ListClientUsersRequest.pageToken field in the subsequent call to the
514+-- clients.invitations.list method to retrieve the next page of results.
515+lcurNextPageToken :: Lens' ListClientUsersResponse (Maybe Text)
516+lcurNextPageToken
517+ = lens _lcurNextPageToken
518+ (\ s a -> s{_lcurNextPageToken = a})
519+
520+-- | The returned list of client users.
521+lcurUsers :: Lens' ListClientUsersResponse [ClientUser]
522+lcurUsers
523+ = lens _lcurUsers (\ s a -> s{_lcurUsers = a}) .
524+ _Default
525+ . _Coerce
526+
527+instance FromJSON ListClientUsersResponse where
528+ parseJSON
529+ = withObject "ListClientUsersResponse"
530+ (\ o ->
531+ ListClientUsersResponse' <$>
532+ (o .:? "nextPageToken") <*>
533+ (o .:? "users" .!= mempty))
534+
535+instance ToJSON ListClientUsersResponse where
536+ toJSON ListClientUsersResponse'{..}
537+ = object
538+ (catMaybes
539+ [("nextPageToken" .=) <$> _lcurNextPageToken,
540+ ("users" .=) <$> _lcurUsers])
541+
542+-- | The set of metrics that are measured in numbers of bids, representing
543+-- how many bids with the specified dimension values were considered
544+-- eligible at each stage of the bidding funnel;
545+--
546+-- /See:/ 'bidMetricsRow' smart constructor.
547+data BidMetricsRow = BidMetricsRow'
548+ { _bmrBids :: !(Maybe MetricValue)
549+ , _bmrBidsInAuction :: !(Maybe MetricValue)
550+ , _bmrImpressionsWon :: !(Maybe MetricValue)
551+ , _bmrRowDimensions :: !(Maybe RowDimensions)
552+ , _bmrMeasurableImpressions :: !(Maybe MetricValue)
553+ , _bmrViewableImpressions :: !(Maybe MetricValue)
554+ , _bmrBilledImpressions :: !(Maybe MetricValue)
555+ } deriving (Eq,Show,Data,Typeable,Generic)
556+
557+-- | Creates a value of 'BidMetricsRow' with the minimum fields required to make a request.
558+--
559+-- Use one of the following lenses to modify other fields as desired:
560+--
561+-- * 'bmrBids'
562+--
563+-- * 'bmrBidsInAuction'
564+--
565+-- * 'bmrImpressionsWon'
566+--
567+-- * 'bmrRowDimensions'
568+--
569+-- * 'bmrMeasurableImpressions'
570+--
571+-- * 'bmrViewableImpressions'
572+--
573+-- * 'bmrBilledImpressions'
574+bidMetricsRow
575+ :: BidMetricsRow
576+bidMetricsRow =
577+ BidMetricsRow'
578+ { _bmrBids = Nothing
579+ , _bmrBidsInAuction = Nothing
580+ , _bmrImpressionsWon = Nothing
581+ , _bmrRowDimensions = Nothing
582+ , _bmrMeasurableImpressions = Nothing
583+ , _bmrViewableImpressions = Nothing
584+ , _bmrBilledImpressions = Nothing
585+ }
586+
587+-- | The number of bids that Ad Exchange received from the buyer.
588+bmrBids :: Lens' BidMetricsRow (Maybe MetricValue)
589+bmrBids = lens _bmrBids (\ s a -> s{_bmrBids = a})
590+
591+-- | The number of bids that were permitted to compete in the auction.
592+bmrBidsInAuction :: Lens' BidMetricsRow (Maybe MetricValue)
593+bmrBidsInAuction
594+ = lens _bmrBidsInAuction
595+ (\ s a -> s{_bmrBidsInAuction = a})
596+
597+-- | The number of bids that won an impression.
598+bmrImpressionsWon :: Lens' BidMetricsRow (Maybe MetricValue)
599+bmrImpressionsWon
600+ = lens _bmrImpressionsWon
601+ (\ s a -> s{_bmrImpressionsWon = a})
602+
603+-- | The values of all dimensions associated with metric values in this row.
604+bmrRowDimensions :: Lens' BidMetricsRow (Maybe RowDimensions)
605+bmrRowDimensions
606+ = lens _bmrRowDimensions
607+ (\ s a -> s{_bmrRowDimensions = a})
608+
609+-- | The number of bids for which the corresponding impression was measurable
610+-- for viewability (as defined by Active View).
611+bmrMeasurableImpressions :: Lens' BidMetricsRow (Maybe MetricValue)
612+bmrMeasurableImpressions
613+ = lens _bmrMeasurableImpressions
614+ (\ s a -> s{_bmrMeasurableImpressions = a})
615+
616+-- | The number of bids for which the corresponding impression was viewable
617+-- (as defined by Active View).
618+bmrViewableImpressions :: Lens' BidMetricsRow (Maybe MetricValue)
619+bmrViewableImpressions
620+ = lens _bmrViewableImpressions
621+ (\ s a -> s{_bmrViewableImpressions = a})
622+
623+-- | The number of bids for which the buyer was billed.
624+bmrBilledImpressions :: Lens' BidMetricsRow (Maybe MetricValue)
625+bmrBilledImpressions
626+ = lens _bmrBilledImpressions
627+ (\ s a -> s{_bmrBilledImpressions = a})
628+
629+instance FromJSON BidMetricsRow where
630+ parseJSON
631+ = withObject "BidMetricsRow"
632+ (\ o ->
633+ BidMetricsRow' <$>
634+ (o .:? "bids") <*> (o .:? "bidsInAuction") <*>
635+ (o .:? "impressionsWon")
636+ <*> (o .:? "rowDimensions")
637+ <*> (o .:? "measurableImpressions")
638+ <*> (o .:? "viewableImpressions")
639+ <*> (o .:? "billedImpressions"))
640+
641+instance ToJSON BidMetricsRow where
642+ toJSON BidMetricsRow'{..}
643+ = object
644+ (catMaybes
645+ [("bids" .=) <$> _bmrBids,
646+ ("bidsInAuction" .=) <$> _bmrBidsInAuction,
647+ ("impressionsWon" .=) <$> _bmrImpressionsWon,
648+ ("rowDimensions" .=) <$> _bmrRowDimensions,
649+ ("measurableImpressions" .=) <$>
650+ _bmrMeasurableImpressions,
651+ ("viewableImpressions" .=) <$>
652+ _bmrViewableImpressions,
653+ ("billedImpressions" .=) <$> _bmrBilledImpressions])
654+
655+-- | Specifies the day part targeting criteria.
656+--
657+-- /See:/ 'dayPartTargeting' smart constructor.
658+data DayPartTargeting = DayPartTargeting'
659+ { _dptTimeZoneType :: !(Maybe DayPartTargetingTimeZoneType)
660+ , _dptDayParts :: !(Maybe [DayPart])
661+ } deriving (Eq,Show,Data,Typeable,Generic)
662+
663+-- | Creates a value of 'DayPartTargeting' with the minimum fields required to make a request.
664+--
665+-- Use one of the following lenses to modify other fields as desired:
666+--
667+-- * 'dptTimeZoneType'
668+--
669+-- * 'dptDayParts'
670+dayPartTargeting
671+ :: DayPartTargeting
672+dayPartTargeting =
673+ DayPartTargeting'
674+ { _dptTimeZoneType = Nothing
675+ , _dptDayParts = Nothing
676+ }
677+
678+-- | The timezone to use for interpreting the day part targeting.
679+dptTimeZoneType :: Lens' DayPartTargeting (Maybe DayPartTargetingTimeZoneType)
680+dptTimeZoneType
681+ = lens _dptTimeZoneType
682+ (\ s a -> s{_dptTimeZoneType = a})
683+
684+-- | A list of day part targeting criterion.
685+dptDayParts :: Lens' DayPartTargeting [DayPart]
686+dptDayParts
687+ = lens _dptDayParts (\ s a -> s{_dptDayParts = a}) .
688+ _Default
689+ . _Coerce
690+
691+instance FromJSON DayPartTargeting where
692+ parseJSON
693+ = withObject "DayPartTargeting"
694+ (\ o ->
695+ DayPartTargeting' <$>
696+ (o .:? "timeZoneType") <*>
697+ (o .:? "dayParts" .!= mempty))
698+
699+instance ToJSON DayPartTargeting where
700+ toJSON DayPartTargeting'{..}
701+ = object
702+ (catMaybes
703+ [("timeZoneType" .=) <$> _dptTimeZoneType,
704+ ("dayParts" .=) <$> _dptDayParts])
705+
706+-- | Generic targeting used for targeting dimensions that contains a list of
707+-- included and excluded numeric IDs.
708+--
709+-- /See:/ 'criteriaTargeting' smart constructor.
710+data CriteriaTargeting = CriteriaTargeting'
711+ { _ctExcludedCriteriaIds :: !(Maybe [Textual Int64])
712+ , _ctTargetedCriteriaIds :: !(Maybe [Textual Int64])
713+ } deriving (Eq,Show,Data,Typeable,Generic)
714+
715+-- | Creates a value of 'CriteriaTargeting' with the minimum fields required to make a request.
716+--
717+-- Use one of the following lenses to modify other fields as desired:
718+--
719+-- * 'ctExcludedCriteriaIds'
720+--
721+-- * 'ctTargetedCriteriaIds'
722+criteriaTargeting
723+ :: CriteriaTargeting
724+criteriaTargeting =
725+ CriteriaTargeting'
726+ { _ctExcludedCriteriaIds = Nothing
727+ , _ctTargetedCriteriaIds = Nothing
728+ }
729+
730+-- | A list of numeric IDs to be excluded.
731+ctExcludedCriteriaIds :: Lens' CriteriaTargeting [Int64]
732+ctExcludedCriteriaIds
733+ = lens _ctExcludedCriteriaIds
734+ (\ s a -> s{_ctExcludedCriteriaIds = a})
735+ . _Default
736+ . _Coerce
737+
738+-- | A list of numeric IDs to be included.
739+ctTargetedCriteriaIds :: Lens' CriteriaTargeting [Int64]
740+ctTargetedCriteriaIds
741+ = lens _ctTargetedCriteriaIds
742+ (\ s a -> s{_ctTargetedCriteriaIds = a})
743+ . _Default
744+ . _Coerce
745+
746+instance FromJSON CriteriaTargeting where
747+ parseJSON
748+ = withObject "CriteriaTargeting"
749+ (\ o ->
750+ CriteriaTargeting' <$>
751+ (o .:? "excludedCriteriaIds" .!= mempty) <*>
752+ (o .:? "targetedCriteriaIds" .!= mempty))
753+
754+instance ToJSON CriteriaTargeting where
755+ toJSON CriteriaTargeting'{..}
756+ = object
757+ (catMaybes
758+ [("excludedCriteriaIds" .=) <$>
759+ _ctExcludedCriteriaIds,
760+ ("targetedCriteriaIds" .=) <$>
761+ _ctTargetedCriteriaIds])
762+
763+-- | Tracks which parties (if any) have paused a deal. The deal is considered
764+-- paused if either hasBuyerPaused or hasSellPaused is true.
765+--
766+-- /See:/ 'dealPauseStatus' smart constructor.
767+data DealPauseStatus = DealPauseStatus'
768+ { _dpsFirstPausedBy :: !(Maybe DealPauseStatusFirstPausedBy)
769+ , _dpsBuyerPauseReason :: !(Maybe Text)
770+ , _dpsHasBuyerPaused :: !(Maybe Bool)
771+ , _dpsSellerPauseReason :: !(Maybe Text)
772+ , _dpsHasSellerPaused :: !(Maybe Bool)
773+ } deriving (Eq,Show,Data,Typeable,Generic)
774+
775+-- | Creates a value of 'DealPauseStatus' with the minimum fields required to make a request.
776+--
777+-- Use one of the following lenses to modify other fields as desired:
778+--
779+-- * 'dpsFirstPausedBy'
780+--
781+-- * 'dpsBuyerPauseReason'
782+--
783+-- * 'dpsHasBuyerPaused'
784+--
785+-- * 'dpsSellerPauseReason'
786+--
787+-- * 'dpsHasSellerPaused'
788+dealPauseStatus
789+ :: DealPauseStatus
790+dealPauseStatus =
791+ DealPauseStatus'
792+ { _dpsFirstPausedBy = Nothing
793+ , _dpsBuyerPauseReason = Nothing
794+ , _dpsHasBuyerPaused = Nothing
795+ , _dpsSellerPauseReason = Nothing
796+ , _dpsHasSellerPaused = Nothing
797+ }
798+
799+-- | The role of the person who first paused this deal.
800+dpsFirstPausedBy :: Lens' DealPauseStatus (Maybe DealPauseStatusFirstPausedBy)
801+dpsFirstPausedBy
802+ = lens _dpsFirstPausedBy
803+ (\ s a -> s{_dpsFirstPausedBy = a})
804+
805+-- | The buyer\'s reason for pausing, if the buyer paused the deal.
806+dpsBuyerPauseReason :: Lens' DealPauseStatus (Maybe Text)
807+dpsBuyerPauseReason
808+ = lens _dpsBuyerPauseReason
809+ (\ s a -> s{_dpsBuyerPauseReason = a})
810+
811+-- | True, if the buyer has paused the deal unilaterally.
812+dpsHasBuyerPaused :: Lens' DealPauseStatus (Maybe Bool)
813+dpsHasBuyerPaused
814+ = lens _dpsHasBuyerPaused
815+ (\ s a -> s{_dpsHasBuyerPaused = a})
816+
817+-- | The seller\'s reason for pausing, if the seller paused the deal.
818+dpsSellerPauseReason :: Lens' DealPauseStatus (Maybe Text)
819+dpsSellerPauseReason
820+ = lens _dpsSellerPauseReason
821+ (\ s a -> s{_dpsSellerPauseReason = a})
822+
823+-- | True, if the seller has paused the deal unilaterally.
824+dpsHasSellerPaused :: Lens' DealPauseStatus (Maybe Bool)
825+dpsHasSellerPaused
826+ = lens _dpsHasSellerPaused
827+ (\ s a -> s{_dpsHasSellerPaused = a})
828+
829+instance FromJSON DealPauseStatus where
830+ parseJSON
831+ = withObject "DealPauseStatus"
832+ (\ o ->
833+ DealPauseStatus' <$>
834+ (o .:? "firstPausedBy") <*>
835+ (o .:? "buyerPauseReason")
836+ <*> (o .:? "hasBuyerPaused")
837+ <*> (o .:? "sellerPauseReason")
838+ <*> (o .:? "hasSellerPaused"))
839+
840+instance ToJSON DealPauseStatus where
841+ toJSON DealPauseStatus'{..}
842+ = object
843+ (catMaybes
844+ [("firstPausedBy" .=) <$> _dpsFirstPausedBy,
845+ ("buyerPauseReason" .=) <$> _dpsBuyerPauseReason,
846+ ("hasBuyerPaused" .=) <$> _dpsHasBuyerPaused,
847+ ("sellerPauseReason" .=) <$> _dpsSellerPauseReason,
848+ ("hasSellerPaused" .=) <$> _dpsHasSellerPaused])
849+
850+-- | The number of filtered bids with the specified dimension values, among
851+-- those filtered due to the requested filtering reason (i.e. creative
852+-- status), that have the specified detail.
853+--
854+-- /See:/ 'filteredBidDetailRow' smart constructor.
855+data FilteredBidDetailRow = FilteredBidDetailRow'
856+ { _fbdrDetailId :: !(Maybe (Textual Int32))
857+ , _fbdrRowDimensions :: !(Maybe RowDimensions)
858+ , _fbdrBidCount :: !(Maybe MetricValue)
859+ } deriving (Eq,Show,Data,Typeable,Generic)
860+
861+-- | Creates a value of 'FilteredBidDetailRow' with the minimum fields required to make a request.
862+--
863+-- Use one of the following lenses to modify other fields as desired:
864+--
865+-- * 'fbdrDetailId'
866+--
867+-- * 'fbdrRowDimensions'
868+--
869+-- * 'fbdrBidCount'
870+filteredBidDetailRow
871+ :: FilteredBidDetailRow
872+filteredBidDetailRow =
873+ FilteredBidDetailRow'
874+ { _fbdrDetailId = Nothing
875+ , _fbdrRowDimensions = Nothing
876+ , _fbdrBidCount = Nothing
877+ }
878+
879+-- | The ID of the detail. The associated value can be looked up in the
880+-- dictionary file corresponding to the DetailType in the response message.
881+fbdrDetailId :: Lens' FilteredBidDetailRow (Maybe Int32)
882+fbdrDetailId
883+ = lens _fbdrDetailId (\ s a -> s{_fbdrDetailId = a})
884+ . mapping _Coerce
885+
886+-- | The values of all dimensions associated with metric values in this row.
887+fbdrRowDimensions :: Lens' FilteredBidDetailRow (Maybe RowDimensions)
888+fbdrRowDimensions
889+ = lens _fbdrRowDimensions
890+ (\ s a -> s{_fbdrRowDimensions = a})
891+
892+-- | The number of bids with the specified detail.
893+fbdrBidCount :: Lens' FilteredBidDetailRow (Maybe MetricValue)
894+fbdrBidCount
895+ = lens _fbdrBidCount (\ s a -> s{_fbdrBidCount = a})
896+
897+instance FromJSON FilteredBidDetailRow where
898+ parseJSON
899+ = withObject "FilteredBidDetailRow"
900+ (\ o ->
901+ FilteredBidDetailRow' <$>
902+ (o .:? "detailId") <*> (o .:? "rowDimensions") <*>
903+ (o .:? "bidCount"))
904+
905+instance ToJSON FilteredBidDetailRow where
906+ toJSON FilteredBidDetailRow'{..}
907+ = object
908+ (catMaybes
909+ [("detailId" .=) <$> _fbdrDetailId,
910+ ("rowDimensions" .=) <$> _fbdrRowDimensions,
911+ ("bidCount" .=) <$> _fbdrBidCount])
912+
913+-- | Buyers are allowed to store certain types of private data in a
914+-- proposal\/deal.
915+--
916+-- /See:/ 'privateData' smart constructor.
917+newtype PrivateData = PrivateData'
918+ { _pdReferenceId :: Maybe Text
919+ } deriving (Eq,Show,Data,Typeable,Generic)
920+
921+-- | Creates a value of 'PrivateData' with the minimum fields required to make a request.
922+--
923+-- Use one of the following lenses to modify other fields as desired:
924+--
925+-- * 'pdReferenceId'
926+privateData
927+ :: PrivateData
928+privateData =
929+ PrivateData'
930+ { _pdReferenceId = Nothing
931+ }
932+
933+-- | A buyer or seller specified reference ID. This can be queried in the
934+-- list operations (max-length: 1024 unicode code units).
935+pdReferenceId :: Lens' PrivateData (Maybe Text)
936+pdReferenceId
937+ = lens _pdReferenceId
938+ (\ s a -> s{_pdReferenceId = a})
939+
940+instance FromJSON PrivateData where
941+ parseJSON
942+ = withObject "PrivateData"
943+ (\ o -> PrivateData' <$> (o .:? "referenceId"))
944+
945+instance ToJSON PrivateData where
946+ toJSON PrivateData'{..}
947+ = object
948+ (catMaybes [("referenceId" .=) <$> _pdReferenceId])
949+
950+-- | A generic empty message that you can re-use to avoid defining duplicated
951+-- empty messages in your APIs. A typical example is to use it as the
952+-- request or the response type of an API method. For instance: service Foo
953+-- { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
954+-- JSON representation for \`Empty\` is empty JSON object \`{}\`.
955+--
956+-- /See:/ 'empty' smart constructor.
957+data Empty =
958+ Empty'
959+ deriving (Eq,Show,Data,Typeable,Generic)
960+
961+-- | Creates a value of 'Empty' with the minimum fields required to make a request.
962+--
963+empty
964+ :: Empty
965+empty = Empty'
966+
967+instance FromJSON Empty where
968+ parseJSON = withObject "Empty" (\ o -> pure Empty')
969+
970+instance ToJSON Empty where
971+ toJSON = const emptyObject
972+
973+-- | The serving context for this restriction.
974+--
975+-- /See:/ 'servingContext' smart constructor.
976+data ServingContext = ServingContext'
977+ { _scPlatform :: !(Maybe PlatformContext)
978+ , _scLocation :: !(Maybe LocationContext)
979+ , _scSecurityType :: !(Maybe SecurityContext)
980+ , _scAll :: !(Maybe ServingContextAll)
981+ , _scAuctionType :: !(Maybe AuctionContext)
982+ , _scAppType :: !(Maybe AppContext)
983+ } deriving (Eq,Show,Data,Typeable,Generic)
984+
985+-- | Creates a value of 'ServingContext' with the minimum fields required to make a request.
986+--
987+-- Use one of the following lenses to modify other fields as desired:
988+--
989+-- * 'scPlatform'
990+--
991+-- * 'scLocation'
992+--
993+-- * 'scSecurityType'
994+--
995+-- * 'scAll'
996+--
997+-- * 'scAuctionType'
998+--
999+-- * 'scAppType'
1000+servingContext
1001+ :: ServingContext
1002+servingContext =
1003+ ServingContext'
1004+ { _scPlatform = Nothing
1005+ , _scLocation = Nothing
1006+ , _scSecurityType = Nothing
1007+ , _scAll = Nothing
1008+ , _scAuctionType = Nothing
1009+ , _scAppType = Nothing
1010+ }
1011+
1012+-- | Matches impressions coming from a particular platform.
1013+scPlatform :: Lens' ServingContext (Maybe PlatformContext)
1014+scPlatform
1015+ = lens _scPlatform (\ s a -> s{_scPlatform = a})
1016+
1017+-- | Matches impressions coming from users *or* publishers in a specific
1018+-- location.
1019+scLocation :: Lens' ServingContext (Maybe LocationContext)
1020+scLocation
1021+ = lens _scLocation (\ s a -> s{_scLocation = a})
1022+
1023+-- | Matches impressions for a particular security type.
1024+scSecurityType :: Lens' ServingContext (Maybe SecurityContext)
1025+scSecurityType
1026+ = lens _scSecurityType
1027+ (\ s a -> s{_scSecurityType = a})
1028+
1029+-- | Matches all contexts.
1030+scAll :: Lens' ServingContext (Maybe ServingContextAll)
1031+scAll = lens _scAll (\ s a -> s{_scAll = a})
1032+
1033+-- | Matches impressions for a particular auction type.
1034+scAuctionType :: Lens' ServingContext (Maybe AuctionContext)
1035+scAuctionType
1036+ = lens _scAuctionType
1037+ (\ s a -> s{_scAuctionType = a})
1038+
1039+-- | Matches impressions for a particular app type.
1040+scAppType :: Lens' ServingContext (Maybe AppContext)
1041+scAppType
1042+ = lens _scAppType (\ s a -> s{_scAppType = a})
1043+
1044+instance FromJSON ServingContext where
1045+ parseJSON
1046+ = withObject "ServingContext"
1047+ (\ o ->
1048+ ServingContext' <$>
1049+ (o .:? "platform") <*> (o .:? "location") <*>
1050+ (o .:? "securityType")
1051+ <*> (o .:? "all")
1052+ <*> (o .:? "auctionType")
1053+ <*> (o .:? "appType"))
1054+
1055+instance ToJSON ServingContext where
1056+ toJSON ServingContext'{..}
1057+ = object
1058+ (catMaybes
1059+ [("platform" .=) <$> _scPlatform,
1060+ ("location" .=) <$> _scLocation,
1061+ ("securityType" .=) <$> _scSecurityType,
1062+ ("all" .=) <$> _scAll,
1063+ ("auctionType" .=) <$> _scAuctionType,
1064+ ("appType" .=) <$> _scAppType])
1065+
1066+-- | Note: this resource requires whitelisting for access. Please contact
1067+-- your account manager for access to Marketplace resources. Represents a
1068+-- publisher profile in Marketplace. All fields are read only. All string
1069+-- fields are free-form text entered by the publisher unless noted
1070+-- otherwise.
1071+--
1072+-- /See:/ 'publisherProFile' smart constructor.
1073+data PublisherProFile = PublisherProFile'
1074+ { _ppfDirectDealsContact :: !(Maybe Text)
1075+ , _ppfAudienceDescription :: !(Maybe Text)
1076+ , _ppfLogoURL :: !(Maybe Text)
1077+ , _ppfOverview :: !(Maybe Text)
1078+ , _ppfSamplePageURL :: !(Maybe Text)
1079+ , _ppfSeller :: !(Maybe Seller)
1080+ , _ppfMediaKitURL :: !(Maybe Text)
1081+ , _ppfBuyerPitchStatement :: !(Maybe Text)
1082+ , _ppfDisplayName :: !(Maybe Text)
1083+ , _ppfPublisherProFileId :: !(Maybe Text)
1084+ , _ppfGooglePlusURL :: !(Maybe Text)
1085+ , _ppfDomains :: !(Maybe [Text])
1086+ , _ppfRateCardInfoURL :: !(Maybe Text)
1087+ , _ppfTopHeadlines :: !(Maybe [Text])
1088+ , _ppfProgrammaticDealsContact :: !(Maybe Text)
1089+ } deriving (Eq,Show,Data,Typeable,Generic)
1090+
1091+-- | Creates a value of 'PublisherProFile' with the minimum fields required to make a request.
1092+--
1093+-- Use one of the following lenses to modify other fields as desired:
1094+--
1095+-- * 'ppfDirectDealsContact'
1096+--
1097+-- * 'ppfAudienceDescription'
1098+--
1099+-- * 'ppfLogoURL'
1100+--
1101+-- * 'ppfOverview'
1102+--
1103+-- * 'ppfSamplePageURL'
1104+--
1105+-- * 'ppfSeller'
1106+--
1107+-- * 'ppfMediaKitURL'
1108+--
1109+-- * 'ppfBuyerPitchStatement'
1110+--
1111+-- * 'ppfDisplayName'
1112+--
1113+-- * 'ppfPublisherProFileId'
1114+--
1115+-- * 'ppfGooglePlusURL'
1116+--
1117+-- * 'ppfDomains'
1118+--
1119+-- * 'ppfRateCardInfoURL'
1120+--
1121+-- * 'ppfTopHeadlines'
1122+--
1123+-- * 'ppfProgrammaticDealsContact'
1124+publisherProFile
1125+ :: PublisherProFile
1126+publisherProFile =
1127+ PublisherProFile'
1128+ { _ppfDirectDealsContact = Nothing
1129+ , _ppfAudienceDescription = Nothing
1130+ , _ppfLogoURL = Nothing
1131+ , _ppfOverview = Nothing
1132+ , _ppfSamplePageURL = Nothing
1133+ , _ppfSeller = Nothing
1134+ , _ppfMediaKitURL = Nothing
1135+ , _ppfBuyerPitchStatement = Nothing
1136+ , _ppfDisplayName = Nothing
1137+ , _ppfPublisherProFileId = Nothing
1138+ , _ppfGooglePlusURL = Nothing
1139+ , _ppfDomains = Nothing
1140+ , _ppfRateCardInfoURL = Nothing
1141+ , _ppfTopHeadlines = Nothing
1142+ , _ppfProgrammaticDealsContact = Nothing
1143+ }
1144+
1145+-- | Contact information for direct reservation deals. This is free text
1146+-- entered by the publisher and may include information like names, phone
1147+-- numbers and email addresses.
1148+ppfDirectDealsContact :: Lens' PublisherProFile (Maybe Text)
1149+ppfDirectDealsContact
1150+ = lens _ppfDirectDealsContact
1151+ (\ s a -> s{_ppfDirectDealsContact = a})
1152+
1153+-- | Description on the publisher\'s audience.
1154+ppfAudienceDescription :: Lens' PublisherProFile (Maybe Text)
1155+ppfAudienceDescription
1156+ = lens _ppfAudienceDescription
1157+ (\ s a -> s{_ppfAudienceDescription = a})
1158+
1159+-- | A Google public URL to the logo for this publisher profile. The logo is
1160+-- stored as a PNG, JPG, or GIF image.
1161+ppfLogoURL :: Lens' PublisherProFile (Maybe Text)
1162+ppfLogoURL
1163+ = lens _ppfLogoURL (\ s a -> s{_ppfLogoURL = a})
1164+
1165+-- | Overview of the publisher.
1166+ppfOverview :: Lens' PublisherProFile (Maybe Text)
1167+ppfOverview
1168+ = lens _ppfOverview (\ s a -> s{_ppfOverview = a})
1169+
1170+-- | URL to a sample content page.
1171+ppfSamplePageURL :: Lens' PublisherProFile (Maybe Text)
1172+ppfSamplePageURL
1173+ = lens _ppfSamplePageURL
1174+ (\ s a -> s{_ppfSamplePageURL = a})
1175+
1176+-- | Seller of the publisher profile.
1177+ppfSeller :: Lens' PublisherProFile (Maybe Seller)
1178+ppfSeller
1179+ = lens _ppfSeller (\ s a -> s{_ppfSeller = a})
1180+
1181+-- | URL to additional marketing and sales materials.
1182+ppfMediaKitURL :: Lens' PublisherProFile (Maybe Text)
1183+ppfMediaKitURL
1184+ = lens _ppfMediaKitURL
1185+ (\ s a -> s{_ppfMediaKitURL = a})
1186+
1187+-- | Statement explaining what\'s unique about publisher\'s business, and why
1188+-- buyers should partner with the publisher.
1189+ppfBuyerPitchStatement :: Lens' PublisherProFile (Maybe Text)
1190+ppfBuyerPitchStatement
1191+ = lens _ppfBuyerPitchStatement
1192+ (\ s a -> s{_ppfBuyerPitchStatement = a})
1193+
1194+-- | Name of the publisher profile.
1195+ppfDisplayName :: Lens' PublisherProFile (Maybe Text)
1196+ppfDisplayName
1197+ = lens _ppfDisplayName
1198+ (\ s a -> s{_ppfDisplayName = a})
1199+
1200+-- | Unique ID for publisher profile.
1201+ppfPublisherProFileId :: Lens' PublisherProFile (Maybe Text)
1202+ppfPublisherProFileId
1203+ = lens _ppfPublisherProFileId
1204+ (\ s a -> s{_ppfPublisherProFileId = a})
1205+
1206+-- | URL to publisher\'s Google+ page.
1207+ppfGooglePlusURL :: Lens' PublisherProFile (Maybe Text)
1208+ppfGooglePlusURL
1209+ = lens _ppfGooglePlusURL
1210+ (\ s a -> s{_ppfGooglePlusURL = a})
1211+
1212+-- | The list of domains represented in this publisher profile. Empty if this
1213+-- is a parent profile. These are top private domains, meaning that these
1214+-- will not contain a string like \"photos.google.co.uk\/123\", but will
1215+-- instead contain \"google.co.uk\".
1216+ppfDomains :: Lens' PublisherProFile [Text]
1217+ppfDomains
1218+ = lens _ppfDomains (\ s a -> s{_ppfDomains = a}) .
1219+ _Default
1220+ . _Coerce
1221+
1222+-- | URL to a publisher rate card.
1223+ppfRateCardInfoURL :: Lens' PublisherProFile (Maybe Text)
1224+ppfRateCardInfoURL
1225+ = lens _ppfRateCardInfoURL
1226+ (\ s a -> s{_ppfRateCardInfoURL = a})
1227+
1228+-- | Up to three key metrics and rankings. Max 100 characters each. For
1229+-- example \"#1 Mobile News Site for 20 Straight Months\".
1230+ppfTopHeadlines :: Lens' PublisherProFile [Text]
1231+ppfTopHeadlines
1232+ = lens _ppfTopHeadlines
1233+ (\ s a -> s{_ppfTopHeadlines = a})
1234+ . _Default
1235+ . _Coerce
1236+
1237+-- | Contact information for programmatic deals. This is free text entered by
1238+-- the publisher and may include information like names, phone numbers and
1239+-- email addresses.
1240+ppfProgrammaticDealsContact :: Lens' PublisherProFile (Maybe Text)
1241+ppfProgrammaticDealsContact
1242+ = lens _ppfProgrammaticDealsContact
1243+ (\ s a -> s{_ppfProgrammaticDealsContact = a})
1244+
1245+instance FromJSON PublisherProFile where
1246+ parseJSON
1247+ = withObject "PublisherProFile"
1248+ (\ o ->
1249+ PublisherProFile' <$>
1250+ (o .:? "directDealsContact") <*>
1251+ (o .:? "audienceDescription")
1252+ <*> (o .:? "logoUrl")
1253+ <*> (o .:? "overview")
1254+ <*> (o .:? "samplePageUrl")
1255+ <*> (o .:? "seller")
1256+ <*> (o .:? "mediaKitUrl")
1257+ <*> (o .:? "buyerPitchStatement")
1258+ <*> (o .:? "displayName")
1259+ <*> (o .:? "publisherProfileId")
1260+ <*> (o .:? "googlePlusUrl")
1261+ <*> (o .:? "domains" .!= mempty)
1262+ <*> (o .:? "rateCardInfoUrl")
1263+ <*> (o .:? "topHeadlines" .!= mempty)
1264+ <*> (o .:? "programmaticDealsContact"))
1265+
1266+instance ToJSON PublisherProFile where
1267+ toJSON PublisherProFile'{..}
1268+ = object
1269+ (catMaybes
1270+ [("directDealsContact" .=) <$>
1271+ _ppfDirectDealsContact,
1272+ ("audienceDescription" .=) <$>
1273+ _ppfAudienceDescription,
1274+ ("logoUrl" .=) <$> _ppfLogoURL,
1275+ ("overview" .=) <$> _ppfOverview,
1276+ ("samplePageUrl" .=) <$> _ppfSamplePageURL,
1277+ ("seller" .=) <$> _ppfSeller,
1278+ ("mediaKitUrl" .=) <$> _ppfMediaKitURL,
1279+ ("buyerPitchStatement" .=) <$>
1280+ _ppfBuyerPitchStatement,
1281+ ("displayName" .=) <$> _ppfDisplayName,
1282+ ("publisherProfileId" .=) <$> _ppfPublisherProFileId,
1283+ ("googlePlusUrl" .=) <$> _ppfGooglePlusURL,
1284+ ("domains" .=) <$> _ppfDomains,
1285+ ("rateCardInfoUrl" .=) <$> _ppfRateCardInfoURL,
1286+ ("topHeadlines" .=) <$> _ppfTopHeadlines,
1287+ ("programmaticDealsContact" .=) <$>
1288+ _ppfProgrammaticDealsContact])
1289+
1290+-- | Request to accept a proposal.
1291+--
1292+-- /See:/ 'acceptProposalRequest' smart constructor.
1293+newtype AcceptProposalRequest = AcceptProposalRequest'
1294+ { _aprProposalRevision :: Maybe (Textual Int64)
1295+ } deriving (Eq,Show,Data,Typeable,Generic)
1296+
1297+-- | Creates a value of 'AcceptProposalRequest' with the minimum fields required to make a request.
1298+--
1299+-- Use one of the following lenses to modify other fields as desired:
1300+--
1301+-- * 'aprProposalRevision'
1302+acceptProposalRequest
1303+ :: AcceptProposalRequest
1304+acceptProposalRequest =
1305+ AcceptProposalRequest'
1306+ { _aprProposalRevision = Nothing
1307+ }
1308+
1309+-- | The last known client revision number of the proposal.
1310+aprProposalRevision :: Lens' AcceptProposalRequest (Maybe Int64)
1311+aprProposalRevision
1312+ = lens _aprProposalRevision
1313+ (\ s a -> s{_aprProposalRevision = a})
1314+ . mapping _Coerce
1315+
1316+instance FromJSON AcceptProposalRequest where
1317+ parseJSON
1318+ = withObject "AcceptProposalRequest"
1319+ (\ o ->
1320+ AcceptProposalRequest' <$>
1321+ (o .:? "proposalRevision"))
1322+
1323+instance ToJSON AcceptProposalRequest where
1324+ toJSON AcceptProposalRequest'{..}
1325+ = object
1326+ (catMaybes
1327+ [("proposalRevision" .=) <$> _aprProposalRevision])
1328+
1329+-- | Message depicting the size of the creative. The units of width and
1330+-- height depend on the type of the targeting.
1331+--
1332+-- /See:/ 'size' smart constructor.
1333+data Size = Size'
1334+ { _sHeight :: !(Maybe (Textual Int32))
1335+ , _sWidth :: !(Maybe (Textual Int32))
1336+ } deriving (Eq,Show,Data,Typeable,Generic)
1337+
1338+-- | Creates a value of 'Size' with the minimum fields required to make a request.
1339+--
1340+-- Use one of the following lenses to modify other fields as desired:
1341+--
1342+-- * 'sHeight'
1343+--
1344+-- * 'sWidth'
1345+size
1346+ :: Size
1347+size =
1348+ Size'
1349+ { _sHeight = Nothing
1350+ , _sWidth = Nothing
1351+ }
1352+
1353+-- | The height of the creative.
1354+sHeight :: Lens' Size (Maybe Int32)
1355+sHeight
1356+ = lens _sHeight (\ s a -> s{_sHeight = a}) .
1357+ mapping _Coerce
1358+
1359+-- | The width of the creative
1360+sWidth :: Lens' Size (Maybe Int32)
1361+sWidth
1362+ = lens _sWidth (\ s a -> s{_sWidth = a}) .
1363+ mapping _Coerce
1364+
1365+instance FromJSON Size where
1366+ parseJSON
1367+ = withObject "Size"
1368+ (\ o ->
1369+ Size' <$> (o .:? "height") <*> (o .:? "width"))
1370+
1371+instance ToJSON Size where
1372+ toJSON Size'{..}
1373+ = object
1374+ (catMaybes
1375+ [("height" .=) <$> _sHeight,
1376+ ("width" .=) <$> _sWidth])
1377+
1378+-- | Response message for listing all reasons that bid requests were filtered
1379+-- and not sent to the buyer.
1380+--
1381+-- /See:/ 'listFilteredBidRequestsResponse' smart constructor.
1382+data ListFilteredBidRequestsResponse = ListFilteredBidRequestsResponse'
1383+ { _lfbrrNextPageToken :: !(Maybe Text)
1384+ , _lfbrrCalloutStatusRows :: !(Maybe [CalloutStatusRow])
1385+ } deriving (Eq,Show,Data,Typeable,Generic)
1386+
1387+-- | Creates a value of 'ListFilteredBidRequestsResponse' with the minimum fields required to make a request.
1388+--
1389+-- Use one of the following lenses to modify other fields as desired:
1390+--
1391+-- * 'lfbrrNextPageToken'
1392+--
1393+-- * 'lfbrrCalloutStatusRows'
1394+listFilteredBidRequestsResponse
1395+ :: ListFilteredBidRequestsResponse
1396+listFilteredBidRequestsResponse =
1397+ ListFilteredBidRequestsResponse'
1398+ { _lfbrrNextPageToken = Nothing
1399+ , _lfbrrCalloutStatusRows = Nothing
1400+ }
1401+
1402+-- | A token to retrieve the next page of results. Pass this value in the
1403+-- ListFilteredBidRequestsRequest.pageToken field in the subsequent call to
1404+-- the filteredBidRequests.list method to retrieve the next page of
1405+-- results.
1406+lfbrrNextPageToken :: Lens' ListFilteredBidRequestsResponse (Maybe Text)
1407+lfbrrNextPageToken
1408+ = lens _lfbrrNextPageToken
1409+ (\ s a -> s{_lfbrrNextPageToken = a})
1410+
1411+-- | List of rows, with counts of filtered bid requests aggregated by callout
1412+-- status.
1413+lfbrrCalloutStatusRows :: Lens' ListFilteredBidRequestsResponse [CalloutStatusRow]
1414+lfbrrCalloutStatusRows
1415+ = lens _lfbrrCalloutStatusRows
1416+ (\ s a -> s{_lfbrrCalloutStatusRows = a})
1417+ . _Default
1418+ . _Coerce
1419+
1420+instance FromJSON ListFilteredBidRequestsResponse
1421+ where
1422+ parseJSON
1423+ = withObject "ListFilteredBidRequestsResponse"
1424+ (\ o ->
1425+ ListFilteredBidRequestsResponse' <$>
1426+ (o .:? "nextPageToken") <*>
1427+ (o .:? "calloutStatusRows" .!= mempty))
1428+
1429+instance ToJSON ListFilteredBidRequestsResponse where
1430+ toJSON ListFilteredBidRequestsResponse'{..}
1431+ = object
1432+ (catMaybes
1433+ [("nextPageToken" .=) <$> _lfbrrNextPageToken,
1434+ ("calloutStatusRows" .=) <$>
1435+ _lfbrrCalloutStatusRows])
1436+
1437+-- | A request for associating a deal and a creative.
1438+--
1439+-- /See:/ 'addDealAssociationRequest' smart constructor.
1440+newtype AddDealAssociationRequest = AddDealAssociationRequest'
1441+ { _adarAssociation :: Maybe CreativeDealAssociation
1442+ } deriving (Eq,Show,Data,Typeable,Generic)
1443+
1444+-- | Creates a value of 'AddDealAssociationRequest' with the minimum fields required to make a request.
1445+--
1446+-- Use one of the following lenses to modify other fields as desired:
1447+--
1448+-- * 'adarAssociation'
1449+addDealAssociationRequest
1450+ :: AddDealAssociationRequest
1451+addDealAssociationRequest =
1452+ AddDealAssociationRequest'
1453+ { _adarAssociation = Nothing
1454+ }
1455+
1456+-- | The association between a creative and a deal that should be added.
1457+adarAssociation :: Lens' AddDealAssociationRequest (Maybe CreativeDealAssociation)
1458+adarAssociation
1459+ = lens _adarAssociation
1460+ (\ s a -> s{_adarAssociation = a})
1461+
1462+instance FromJSON AddDealAssociationRequest where
1463+ parseJSON
1464+ = withObject "AddDealAssociationRequest"
1465+ (\ o ->
1466+ AddDealAssociationRequest' <$> (o .:? "association"))
1467+
1468+instance ToJSON AddDealAssociationRequest where
1469+ toJSON AddDealAssociationRequest'{..}
1470+ = object
1471+ (catMaybes [("association" .=) <$> _adarAssociation])
1472+
1473+-- | The number of bids with the specified dimension values that did not win
1474+-- the auction (either were filtered pre-auction or lost the auction), as
1475+-- described by the specified creative status.
1476+--
1477+-- /See:/ 'creativeStatusRow' smart constructor.
1478+data CreativeStatusRow = CreativeStatusRow'
1479+ { _csrRowDimensions :: !(Maybe RowDimensions)
1480+ , _csrBidCount :: !(Maybe MetricValue)
1481+ , _csrCreativeStatusId :: !(Maybe (Textual Int32))
1482+ } deriving (Eq,Show,Data,Typeable,Generic)
1483+
1484+-- | Creates a value of 'CreativeStatusRow' with the minimum fields required to make a request.
1485+--
1486+-- Use one of the following lenses to modify other fields as desired:
1487+--
1488+-- * 'csrRowDimensions'
1489+--
1490+-- * 'csrBidCount'
1491+--
1492+-- * 'csrCreativeStatusId'
1493+creativeStatusRow
1494+ :: CreativeStatusRow
1495+creativeStatusRow =
1496+ CreativeStatusRow'
1497+ { _csrRowDimensions = Nothing
1498+ , _csrBidCount = Nothing
1499+ , _csrCreativeStatusId = Nothing
1500+ }
1501+
1502+-- | The values of all dimensions associated with metric values in this row.
1503+csrRowDimensions :: Lens' CreativeStatusRow (Maybe RowDimensions)
1504+csrRowDimensions
1505+ = lens _csrRowDimensions
1506+ (\ s a -> s{_csrRowDimensions = a})
1507+
1508+-- | The number of bids with the specified status.
1509+csrBidCount :: Lens' CreativeStatusRow (Maybe MetricValue)
1510+csrBidCount
1511+ = lens _csrBidCount (\ s a -> s{_csrBidCount = a})
1512+
1513+-- | The ID of the creative status. See
1514+-- [creative-status-codes](https:\/\/developers.google.com\/authorized-buyers\/rtb\/downloads\/creative-status-codes).
1515+csrCreativeStatusId :: Lens' CreativeStatusRow (Maybe Int32)
1516+csrCreativeStatusId
1517+ = lens _csrCreativeStatusId
1518+ (\ s a -> s{_csrCreativeStatusId = a})
1519+ . mapping _Coerce
1520+
1521+instance FromJSON CreativeStatusRow where
1522+ parseJSON
1523+ = withObject "CreativeStatusRow"
1524+ (\ o ->
1525+ CreativeStatusRow' <$>
1526+ (o .:? "rowDimensions") <*> (o .:? "bidCount") <*>
1527+ (o .:? "creativeStatusId"))
1528+
1529+instance ToJSON CreativeStatusRow where
1530+ toJSON CreativeStatusRow'{..}
1531+ = object
1532+ (catMaybes
1533+ [("rowDimensions" .=) <$> _csrRowDimensions,
1534+ ("bidCount" .=) <$> _csrBidCount,
1535+ ("creativeStatusId" .=) <$> _csrCreativeStatusId])
1536+
1537+-- | An open-ended realtime time range specified by the start timestamp. For
1538+-- filter sets that specify a realtime time range RTB metrics continue to
1539+-- be aggregated throughout the lifetime of the filter set.
1540+--
1541+-- /See:/ 'realtimeTimeRange' smart constructor.
1542+newtype RealtimeTimeRange = RealtimeTimeRange'
1543+ { _rtrStartTimestamp :: Maybe DateTime'
1544+ } deriving (Eq,Show,Data,Typeable,Generic)
1545+
1546+-- | Creates a value of 'RealtimeTimeRange' with the minimum fields required to make a request.
1547+--
1548+-- Use one of the following lenses to modify other fields as desired:
1549+--
1550+-- * 'rtrStartTimestamp'
1551+realtimeTimeRange
1552+ :: RealtimeTimeRange
1553+realtimeTimeRange =
1554+ RealtimeTimeRange'
1555+ { _rtrStartTimestamp = Nothing
1556+ }
1557+
1558+-- | The start timestamp of the real-time RTB metrics aggregation.
1559+rtrStartTimestamp :: Lens' RealtimeTimeRange (Maybe UTCTime)
1560+rtrStartTimestamp
1561+ = lens _rtrStartTimestamp
1562+ (\ s a -> s{_rtrStartTimestamp = a})
1563+ . mapping _DateTime
1564+
1565+instance FromJSON RealtimeTimeRange where
1566+ parseJSON
1567+ = withObject "RealtimeTimeRange"
1568+ (\ o ->
1569+ RealtimeTimeRange' <$> (o .:? "startTimestamp"))
1570+
1571+instance ToJSON RealtimeTimeRange where
1572+ toJSON RealtimeTimeRange'{..}
1573+ = object
1574+ (catMaybes
1575+ [("startTimestamp" .=) <$> _rtrStartTimestamp])
1576+
1577+-- | A proposal may be associated to several notes.
1578+--
1579+-- /See:/ 'note' smart constructor.
1580+data Note = Note'
1581+ { _nProposalRevision :: !(Maybe (Textual Int64))
1582+ , _nNote :: !(Maybe Text)
1583+ , _nNoteId :: !(Maybe Text)
1584+ , _nCreatorRole :: !(Maybe NoteCreatorRole)
1585+ , _nCreateTime :: !(Maybe DateTime')
1586+ } deriving (Eq,Show,Data,Typeable,Generic)
1587+
1588+-- | Creates a value of 'Note' with the minimum fields required to make a request.
1589+--
1590+-- Use one of the following lenses to modify other fields as desired:
1591+--
1592+-- * 'nProposalRevision'
1593+--
1594+-- * 'nNote'
1595+--
1596+-- * 'nNoteId'
1597+--
1598+-- * 'nCreatorRole'
1599+--
1600+-- * 'nCreateTime'
1601+note
1602+ :: Note
1603+note =
1604+ Note'
1605+ { _nProposalRevision = Nothing
1606+ , _nNote = Nothing
1607+ , _nNoteId = Nothing
1608+ , _nCreatorRole = Nothing
1609+ , _nCreateTime = Nothing
1610+ }
1611+
1612+-- | The revision number of the proposal when the note is created.
1613+-- \'OutputOnly
1614+nProposalRevision :: Lens' Note (Maybe Int64)
1615+nProposalRevision
1616+ = lens _nProposalRevision
1617+ (\ s a -> s{_nProposalRevision = a})
1618+ . mapping _Coerce
1619+
1620+-- | The actual note to attach. (max-length: 1024 unicode code units) Note:
1621+-- This field may be set only when creating the resource. Modifying this
1622+-- field while updating the resource will result in an error.
1623+nNote :: Lens' Note (Maybe Text)
1624+nNote = lens _nNote (\ s a -> s{_nNote = a})
1625+
1626+-- | The unique ID for the note. \'OutputOnly
1627+nNoteId :: Lens' Note (Maybe Text)
1628+nNoteId = lens _nNoteId (\ s a -> s{_nNoteId = a})
1629+
1630+-- | The role of the person (buyer\/seller) creating the note. \'OutputOnly
1631+nCreatorRole :: Lens' Note (Maybe NoteCreatorRole)
1632+nCreatorRole
1633+ = lens _nCreatorRole (\ s a -> s{_nCreatorRole = a})
1634+
1635+-- | The timestamp for when this note was created. \'OutputOnly
1636+nCreateTime :: Lens' Note (Maybe UTCTime)
1637+nCreateTime
1638+ = lens _nCreateTime (\ s a -> s{_nCreateTime = a}) .
1639+ mapping _DateTime
1640+
1641+instance FromJSON Note where
1642+ parseJSON
1643+ = withObject "Note"
1644+ (\ o ->
1645+ Note' <$>
1646+ (o .:? "proposalRevision") <*> (o .:? "note") <*>
1647+ (o .:? "noteId")
1648+ <*> (o .:? "creatorRole")
1649+ <*> (o .:? "createTime"))
1650+
1651+instance ToJSON Note where
1652+ toJSON Note'{..}
1653+ = object
1654+ (catMaybes
1655+ [("proposalRevision" .=) <$> _nProposalRevision,
1656+ ("note" .=) <$> _nNote, ("noteId" .=) <$> _nNoteId,
1657+ ("creatorRole" .=) <$> _nCreatorRole,
1658+ ("createTime" .=) <$> _nCreateTime])
1659+
1660+-- | Response message for listing filter sets.
1661+--
1662+-- /See:/ 'listFilterSetsResponse' smart constructor.
1663+data ListFilterSetsResponse = ListFilterSetsResponse'
1664+ { _lfsrNextPageToken :: !(Maybe Text)
1665+ , _lfsrFilterSets :: !(Maybe [FilterSet])
1666+ } deriving (Eq,Show,Data,Typeable,Generic)
1667+
1668+-- | Creates a value of 'ListFilterSetsResponse' with the minimum fields required to make a request.
1669+--
1670+-- Use one of the following lenses to modify other fields as desired:
1671+--
1672+-- * 'lfsrNextPageToken'
1673+--
1674+-- * 'lfsrFilterSets'
1675+listFilterSetsResponse
1676+ :: ListFilterSetsResponse
1677+listFilterSetsResponse =
1678+ ListFilterSetsResponse'
1679+ { _lfsrNextPageToken = Nothing
1680+ , _lfsrFilterSets = Nothing
1681+ }
1682+
1683+-- | A token to retrieve the next page of results. Pass this value in the
1684+-- ListFilterSetsRequest.pageToken field in the subsequent call to the
1685+-- accounts.filterSets.list method to retrieve the next page of results.
1686+lfsrNextPageToken :: Lens' ListFilterSetsResponse (Maybe Text)
1687+lfsrNextPageToken
1688+ = lens _lfsrNextPageToken
1689+ (\ s a -> s{_lfsrNextPageToken = a})
1690+
1691+-- | The filter sets belonging to the buyer.
1692+lfsrFilterSets :: Lens' ListFilterSetsResponse [FilterSet]
1693+lfsrFilterSets
1694+ = lens _lfsrFilterSets
1695+ (\ s a -> s{_lfsrFilterSets = a})
1696+ . _Default
1697+ . _Coerce
1698+
1699+instance FromJSON ListFilterSetsResponse where
1700+ parseJSON
1701+ = withObject "ListFilterSetsResponse"
1702+ (\ o ->
1703+ ListFilterSetsResponse' <$>
1704+ (o .:? "nextPageToken") <*>
1705+ (o .:? "filterSets" .!= mempty))
1706+
1707+instance ToJSON ListFilterSetsResponse where
1708+ toJSON ListFilterSetsResponse'{..}
1709+ = object
1710+ (catMaybes
1711+ [("nextPageToken" .=) <$> _lfsrNextPageToken,
1712+ ("filterSets" .=) <$> _lfsrFilterSets])
1713+
1714+-- | Represents an amount of money with its currency type.
1715+--
1716+-- /See:/ 'money' smart constructor.
1717+data Money = Money'
1718+ { _mCurrencyCode :: !(Maybe Text)
1719+ , _mNanos :: !(Maybe (Textual Int32))
1720+ , _mUnits :: !(Maybe (Textual Int64))
1721+ } deriving (Eq,Show,Data,Typeable,Generic)
1722+
1723+-- | Creates a value of 'Money' with the minimum fields required to make a request.
1724+--
1725+-- Use one of the following lenses to modify other fields as desired:
1726+--
1727+-- * 'mCurrencyCode'
1728+--
1729+-- * 'mNanos'
1730+--
1731+-- * 'mUnits'
1732+money
1733+ :: Money
1734+money =
1735+ Money'
1736+ { _mCurrencyCode = Nothing
1737+ , _mNanos = Nothing
1738+ , _mUnits = Nothing
1739+ }
1740+
1741+-- | The 3-letter currency code defined in ISO 4217.
1742+mCurrencyCode :: Lens' Money (Maybe Text)
1743+mCurrencyCode
1744+ = lens _mCurrencyCode
1745+ (\ s a -> s{_mCurrencyCode = a})
1746+
1747+-- | Number of nano (10^-9) units of the amount. The value must be between
1748+-- -999,999,999 and +999,999,999 inclusive. If \`units\` is positive,
1749+-- \`nanos\` must be positive or zero. If \`units\` is zero, \`nanos\` can
1750+-- be positive, zero, or negative. If \`units\` is negative, \`nanos\` must
1751+-- be negative or zero. For example $-1.75 is represented as \`units\`=-1
1752+-- and \`nanos\`=-750,000,000.
1753+mNanos :: Lens' Money (Maybe Int32)
1754+mNanos
1755+ = lens _mNanos (\ s a -> s{_mNanos = a}) .
1756+ mapping _Coerce
1757+
1758+-- | The whole units of the amount. For example if \`currencyCode\` is
1759+-- \`\"USD\"\`, then 1 unit is one US dollar.
1760+mUnits :: Lens' Money (Maybe Int64)
1761+mUnits
1762+ = lens _mUnits (\ s a -> s{_mUnits = a}) .
1763+ mapping _Coerce
1764+
1765+instance FromJSON Money where
1766+ parseJSON
1767+ = withObject "Money"
1768+ (\ o ->
1769+ Money' <$>
1770+ (o .:? "currencyCode") <*> (o .:? "nanos") <*>
1771+ (o .:? "units"))
1772+
1773+instance ToJSON Money where
1774+ toJSON Money'{..}
1775+ = object
1776+ (catMaybes
1777+ [("currencyCode" .=) <$> _mCurrencyCode,
1778+ ("nanos" .=) <$> _mNanos, ("units" .=) <$> _mUnits])
1779+
1780+-- | Request message for adding a note to a given proposal.
1781+--
1782+-- /See:/ 'addNoteRequest' smart constructor.
1783+newtype AddNoteRequest = AddNoteRequest'
1784+ { _anrNote :: Maybe Note
1785+ } deriving (Eq,Show,Data,Typeable,Generic)
1786+
1787+-- | Creates a value of 'AddNoteRequest' with the minimum fields required to make a request.
1788+--
1789+-- Use one of the following lenses to modify other fields as desired:
1790+--
1791+-- * 'anrNote'
1792+addNoteRequest
1793+ :: AddNoteRequest
1794+addNoteRequest =
1795+ AddNoteRequest'
1796+ { _anrNote = Nothing
1797+ }
1798+
1799+-- | Details of the note to add.
1800+anrNote :: Lens' AddNoteRequest (Maybe Note)
1801+anrNote = lens _anrNote (\ s a -> s{_anrNote = a})
1802+
1803+instance FromJSON AddNoteRequest where
1804+ parseJSON
1805+ = withObject "AddNoteRequest"
1806+ (\ o -> AddNoteRequest' <$> (o .:? "note"))
1807+
1808+instance ToJSON AddNoteRequest where
1809+ toJSON AddNoteRequest'{..}
1810+ = object (catMaybes [("note" .=) <$> _anrNote])
1811+
1812+-- | Represents targeting about where the ads can appear, e.g., certain sites
1813+-- or mobile applications. Different placement targeting types will be
1814+-- logically OR\'ed.
1815+--
1816+-- /See:/ 'placementTargeting' smart constructor.
1817+data PlacementTargeting = PlacementTargeting'
1818+ { _ptURLTargeting :: !(Maybe URLTargeting)
1819+ , _ptMobileApplicationTargeting :: !(Maybe MobileApplicationTargeting)
1820+ } deriving (Eq,Show,Data,Typeable,Generic)
1821+
1822+-- | Creates a value of 'PlacementTargeting' with the minimum fields required to make a request.
1823+--
1824+-- Use one of the following lenses to modify other fields as desired:
1825+--
1826+-- * 'ptURLTargeting'
1827+--
1828+-- * 'ptMobileApplicationTargeting'
1829+placementTargeting
1830+ :: PlacementTargeting
1831+placementTargeting =
1832+ PlacementTargeting'
1833+ { _ptURLTargeting = Nothing
1834+ , _ptMobileApplicationTargeting = Nothing
1835+ }
1836+
1837+-- | URLs to be included\/excluded.
1838+ptURLTargeting :: Lens' PlacementTargeting (Maybe URLTargeting)
1839+ptURLTargeting
1840+ = lens _ptURLTargeting
1841+ (\ s a -> s{_ptURLTargeting = a})
1842+
1843+-- | Mobile application targeting information in a deal. This doesn\'t apply
1844+-- to Auction Packages.
1845+ptMobileApplicationTargeting :: Lens' PlacementTargeting (Maybe MobileApplicationTargeting)
1846+ptMobileApplicationTargeting
1847+ = lens _ptMobileApplicationTargeting
1848+ (\ s a -> s{_ptMobileApplicationTargeting = a})
1849+
1850+instance FromJSON PlacementTargeting where
1851+ parseJSON
1852+ = withObject "PlacementTargeting"
1853+ (\ o ->
1854+ PlacementTargeting' <$>
1855+ (o .:? "urlTargeting") <*>
1856+ (o .:? "mobileApplicationTargeting"))
1857+
1858+instance ToJSON PlacementTargeting where
1859+ toJSON PlacementTargeting'{..}
1860+ = object
1861+ (catMaybes
1862+ [("urlTargeting" .=) <$> _ptURLTargeting,
1863+ ("mobileApplicationTargeting" .=) <$>
1864+ _ptMobileApplicationTargeting])
1865+
1866+-- | Represents size of a single ad slot, or a creative.
1867+--
1868+-- /See:/ 'adSize' smart constructor.
1869+data AdSize = AdSize'
1870+ { _asHeight :: !(Maybe (Textual Int64))
1871+ , _asWidth :: !(Maybe (Textual Int64))
1872+ , _asSizeType :: !(Maybe AdSizeSizeType)
1873+ } deriving (Eq,Show,Data,Typeable,Generic)
1874+
1875+-- | Creates a value of 'AdSize' with the minimum fields required to make a request.
1876+--
1877+-- Use one of the following lenses to modify other fields as desired:
1878+--
1879+-- * 'asHeight'
1880+--
1881+-- * 'asWidth'
1882+--
1883+-- * 'asSizeType'
1884+adSize
1885+ :: AdSize
1886+adSize =
1887+ AdSize'
1888+ { _asHeight = Nothing
1889+ , _asWidth = Nothing
1890+ , _asSizeType = Nothing
1891+ }
1892+
1893+-- | The height of the ad slot in pixels. This field will be present only
1894+-- when size type is \`PIXEL\`.
1895+asHeight :: Lens' AdSize (Maybe Int64)
1896+asHeight
1897+ = lens _asHeight (\ s a -> s{_asHeight = a}) .
1898+ mapping _Coerce
1899+
1900+-- | The width of the ad slot in pixels. This field will be present only when
1901+-- size type is \`PIXEL\`.
1902+asWidth :: Lens' AdSize (Maybe Int64)
1903+asWidth
1904+ = lens _asWidth (\ s a -> s{_asWidth = a}) .
1905+ mapping _Coerce
1906+
1907+-- | The size type of the ad slot.
1908+asSizeType :: Lens' AdSize (Maybe AdSizeSizeType)
1909+asSizeType
1910+ = lens _asSizeType (\ s a -> s{_asSizeType = a})
1911+
1912+instance FromJSON AdSize where
1913+ parseJSON
1914+ = withObject "AdSize"
1915+ (\ o ->
1916+ AdSize' <$>
1917+ (o .:? "height") <*> (o .:? "width") <*>
1918+ (o .:? "sizeType"))
1919+
1920+instance ToJSON AdSize where
1921+ toJSON AdSize'{..}
1922+ = object
1923+ (catMaybes
1924+ [("height" .=) <$> _asHeight,
1925+ ("width" .=) <$> _asWidth,
1926+ ("sizeType" .=) <$> _asSizeType])
1927+
1928+-- | A request for stopping notifications for changes to creative Status.
1929+--
1930+-- /See:/ 'stopWatchingCreativeRequest' smart constructor.
1931+data StopWatchingCreativeRequest =
1932+ StopWatchingCreativeRequest'
1933+ deriving (Eq,Show,Data,Typeable,Generic)
1934+
1935+-- | Creates a value of 'StopWatchingCreativeRequest' with the minimum fields required to make a request.
1936+--
1937+stopWatchingCreativeRequest
1938+ :: StopWatchingCreativeRequest
1939+stopWatchingCreativeRequest = StopWatchingCreativeRequest'
1940+
1941+instance FromJSON StopWatchingCreativeRequest where
1942+ parseJSON
1943+ = withObject "StopWatchingCreativeRequest"
1944+ (\ o -> pure StopWatchingCreativeRequest')
1945+
1946+instance ToJSON StopWatchingCreativeRequest where
1947+ toJSON = const emptyObject
1948+
1949+-- | A request for watching changes to creative Status.
1950+--
1951+-- /See:/ 'watchCreativeRequest' smart constructor.
1952+newtype WatchCreativeRequest = WatchCreativeRequest'
1953+ { _wcrTopic :: Maybe Text
1954+ } deriving (Eq,Show,Data,Typeable,Generic)
1955+
1956+-- | Creates a value of 'WatchCreativeRequest' with the minimum fields required to make a request.
1957+--
1958+-- Use one of the following lenses to modify other fields as desired:
1959+--
1960+-- * 'wcrTopic'
1961+watchCreativeRequest
1962+ :: WatchCreativeRequest
1963+watchCreativeRequest =
1964+ WatchCreativeRequest'
1965+ { _wcrTopic = Nothing
1966+ }
1967+
1968+-- | The Pub\/Sub topic to publish notifications to. This topic must already
1969+-- exist and must give permission to
1970+-- ad-exchange-buyside-reports\'google.com to write to the topic. This
1971+-- should be the full resource name in
1972+-- \"projects\/{project_id}\/topics\/{topic_id}\" format.
1973+wcrTopic :: Lens' WatchCreativeRequest (Maybe Text)
1974+wcrTopic = lens _wcrTopic (\ s a -> s{_wcrTopic = a})
1975+
1976+instance FromJSON WatchCreativeRequest where
1977+ parseJSON
1978+ = withObject "WatchCreativeRequest"
1979+ (\ o -> WatchCreativeRequest' <$> (o .:? "topic"))
1980+
1981+instance ToJSON WatchCreativeRequest where
1982+ toJSON WatchCreativeRequest'{..}
1983+ = object (catMaybes [("topic" .=) <$> _wcrTopic])
1984+
1985+-- | Message captures metadata about the serving status of a deal.
1986+--
1987+-- /See:/ 'dealServingMetadata' smart constructor.
1988+newtype DealServingMetadata = DealServingMetadata'
1989+ { _dsmDealPauseStatus :: Maybe DealPauseStatus
1990+ } deriving (Eq,Show,Data,Typeable,Generic)
1991+
1992+-- | Creates a value of 'DealServingMetadata' with the minimum fields required to make a request.
1993+--
1994+-- Use one of the following lenses to modify other fields as desired:
1995+--
1996+-- * 'dsmDealPauseStatus'
1997+dealServingMetadata
1998+ :: DealServingMetadata
1999+dealServingMetadata =
2000+ DealServingMetadata'
2001+ { _dsmDealPauseStatus = Nothing
2002+ }
2003+
2004+-- | Tracks which parties (if any) have paused a deal. \'OutputOnly
2005+dsmDealPauseStatus :: Lens' DealServingMetadata (Maybe DealPauseStatus)
2006+dsmDealPauseStatus
2007+ = lens _dsmDealPauseStatus
2008+ (\ s a -> s{_dsmDealPauseStatus = a})
2009+
2010+instance FromJSON DealServingMetadata where
2011+ parseJSON
2012+ = withObject "DealServingMetadata"
2013+ (\ o ->
2014+ DealServingMetadata' <$> (o .:? "dealPauseStatus"))
2015+
2016+instance ToJSON DealServingMetadata where
2017+ toJSON DealServingMetadata'{..}
2018+ = object
2019+ (catMaybes
2020+ [("dealPauseStatus" .=) <$> _dsmDealPauseStatus])
2021+
2022+-- | Message contains details about how the deals will be paced.
2023+--
2024+-- /See:/ 'deliveryControl' smart constructor.
2025+data DeliveryControl = DeliveryControl'
2026+ { _dcCreativeBlockingLevel :: !(Maybe DeliveryControlCreativeBlockingLevel)
2027+ , _dcFrequencyCaps :: !(Maybe [FrequencyCap])
2028+ , _dcDeliveryRateType :: !(Maybe DeliveryControlDeliveryRateType)
2029+ } deriving (Eq,Show,Data,Typeable,Generic)
2030+
2031+-- | Creates a value of 'DeliveryControl' with the minimum fields required to make a request.
2032+--
2033+-- Use one of the following lenses to modify other fields as desired:
2034+--
2035+-- * 'dcCreativeBlockingLevel'
2036+--
2037+-- * 'dcFrequencyCaps'
2038+--
2039+-- * 'dcDeliveryRateType'
2040+deliveryControl
2041+ :: DeliveryControl
2042+deliveryControl =
2043+ DeliveryControl'
2044+ { _dcCreativeBlockingLevel = Nothing
2045+ , _dcFrequencyCaps = Nothing
2046+ , _dcDeliveryRateType = Nothing
2047+ }
2048+
2049+-- | Specified the creative blocking levels to be applied. \'OutputOnly
2050+dcCreativeBlockingLevel :: Lens' DeliveryControl (Maybe DeliveryControlCreativeBlockingLevel)
2051+dcCreativeBlockingLevel
2052+ = lens _dcCreativeBlockingLevel
2053+ (\ s a -> s{_dcCreativeBlockingLevel = a})
2054+
2055+-- | Specifies any frequency caps. \'OutputOnly
2056+dcFrequencyCaps :: Lens' DeliveryControl [FrequencyCap]
2057+dcFrequencyCaps
2058+ = lens _dcFrequencyCaps
2059+ (\ s a -> s{_dcFrequencyCaps = a})
2060+ . _Default
2061+ . _Coerce
2062+
2063+-- | Specifies how the impression delivery will be paced. \'OutputOnly
2064+dcDeliveryRateType :: Lens' DeliveryControl (Maybe DeliveryControlDeliveryRateType)
2065+dcDeliveryRateType
2066+ = lens _dcDeliveryRateType
2067+ (\ s a -> s{_dcDeliveryRateType = a})
2068+
2069+instance FromJSON DeliveryControl where
2070+ parseJSON
2071+ = withObject "DeliveryControl"
2072+ (\ o ->
2073+ DeliveryControl' <$>
2074+ (o .:? "creativeBlockingLevel") <*>
2075+ (o .:? "frequencyCaps" .!= mempty)
2076+ <*> (o .:? "deliveryRateType"))
2077+
2078+instance ToJSON DeliveryControl where
2079+ toJSON DeliveryControl'{..}
2080+ = object
2081+ (catMaybes
2082+ [("creativeBlockingLevel" .=) <$>
2083+ _dcCreativeBlockingLevel,
2084+ ("frequencyCaps" .=) <$> _dcFrequencyCaps,
2085+ ("deliveryRateType" .=) <$> _dcDeliveryRateType])
2086+
2087+-- | Used to specify pricing rules for buyers\/advertisers. Each
2088+-- PricePerBuyer in a product can become 0 or 1 deals. To check if there is
2089+-- a PricePerBuyer for a particular buyer or buyer\/advertiser pair, we
2090+-- look for the most specific matching rule - we first look for a rule
2091+-- matching the buyer and advertiser, next a rule with the buyer but an
2092+-- empty advertiser list, and otherwise look for a matching rule where no
2093+-- buyer is set.
2094+--
2095+-- /See:/ 'pricePerBuyer' smart constructor.
2096+data PricePerBuyer = PricePerBuyer'
2097+ { _ppbPrice :: !(Maybe Price)
2098+ , _ppbAdvertiserIds :: !(Maybe [Text])
2099+ , _ppbBuyer :: !(Maybe Buyer)
2100+ } deriving (Eq,Show,Data,Typeable,Generic)
2101+
2102+-- | Creates a value of 'PricePerBuyer' with the minimum fields required to make a request.
2103+--
2104+-- Use one of the following lenses to modify other fields as desired:
2105+--
2106+-- * 'ppbPrice'
2107+--
2108+-- * 'ppbAdvertiserIds'
2109+--
2110+-- * 'ppbBuyer'
2111+pricePerBuyer
2112+ :: PricePerBuyer
2113+pricePerBuyer =
2114+ PricePerBuyer'
2115+ { _ppbPrice = Nothing
2116+ , _ppbAdvertiserIds = Nothing
2117+ , _ppbBuyer = Nothing
2118+ }
2119+
2120+-- | The specified price.
2121+ppbPrice :: Lens' PricePerBuyer (Maybe Price)
2122+ppbPrice = lens _ppbPrice (\ s a -> s{_ppbPrice = a})
2123+
2124+-- | The list of advertisers for this price when associated with this buyer.
2125+-- If empty, all advertisers with this buyer pay this price.
2126+ppbAdvertiserIds :: Lens' PricePerBuyer [Text]
2127+ppbAdvertiserIds
2128+ = lens _ppbAdvertiserIds
2129+ (\ s a -> s{_ppbAdvertiserIds = a})
2130+ . _Default
2131+ . _Coerce
2132+
2133+-- | The buyer who will pay this price. If unset, all buyers can pay this
2134+-- price (if the advertisers match, and there\'s no more specific rule
2135+-- matching the buyer).
2136+ppbBuyer :: Lens' PricePerBuyer (Maybe Buyer)
2137+ppbBuyer = lens _ppbBuyer (\ s a -> s{_ppbBuyer = a})
2138+
2139+instance FromJSON PricePerBuyer where
2140+ parseJSON
2141+ = withObject "PricePerBuyer"
2142+ (\ o ->
2143+ PricePerBuyer' <$>
2144+ (o .:? "price") <*>
2145+ (o .:? "advertiserIds" .!= mempty)
2146+ <*> (o .:? "buyer"))
2147+
2148+instance ToJSON PricePerBuyer where
2149+ toJSON PricePerBuyer'{..}
2150+ = object
2151+ (catMaybes
2152+ [("price" .=) <$> _ppbPrice,
2153+ ("advertiserIds" .=) <$> _ppbAdvertiserIds,
2154+ ("buyer" .=) <$> _ppbBuyer])
2155+
2156+-- | A creative and its classification data. Next ID: 39
2157+--
2158+-- /See:/ 'creative' smart constructor.
2159+data Creative = Creative'
2160+ { _cAPIUpdateTime :: !(Maybe DateTime')
2161+ , _cDetectedLanguages :: !(Maybe [Text])
2162+ , _cAdvertiserName :: !(Maybe Text)
2163+ , _cAdChoicesDestinationURL :: !(Maybe Text)
2164+ , _cAgencyId :: !(Maybe (Textual Int64))
2165+ , _cCorrections :: !(Maybe [Correction])
2166+ , _cClickThroughURLs :: !(Maybe [Text])
2167+ , _cRestrictedCategories :: !(Maybe [Text])
2168+ , _cDetectedProductCategories :: !(Maybe [Textual Int32])
2169+ , _cDealsStatus :: !(Maybe CreativeDealsStatus)
2170+ , _cCreativeId :: !(Maybe Text)
2171+ , _cVideo :: !(Maybe VideoContent)
2172+ , _cNATive :: !(Maybe NATiveContent)
2173+ , _cDetectedSensitiveCategories :: !(Maybe [Textual Int32])
2174+ , _cImpressionTrackingURLs :: !(Maybe [Text])
2175+ , _cAccountId :: !(Maybe Text)
2176+ , _cAttributes :: !(Maybe [Text])
2177+ , _cVersion :: !(Maybe (Textual Int32))
2178+ , _cVendorIds :: !(Maybe [Textual Int32])
2179+ , _cDetectedAdvertiserIds :: !(Maybe [Textual Int64])
2180+ , _cHTML :: !(Maybe HTMLContent)
2181+ , _cServingRestrictions :: !(Maybe [ServingRestriction])
2182+ , _cDetectedDomains :: !(Maybe [Text])
2183+ , _cOpenAuctionStatus :: !(Maybe CreativeOpenAuctionStatus)
2184+ , _cFilteringStats :: !(Maybe FilteringStats)
2185+ , _cDeclaredClickThroughURLs :: !(Maybe [Text])
2186+ } deriving (Eq,Show,Data,Typeable,Generic)
2187+
2188+-- | Creates a value of 'Creative' with the minimum fields required to make a request.
2189+--
2190+-- Use one of the following lenses to modify other fields as desired:
2191+--
2192+-- * 'cAPIUpdateTime'
2193+--
2194+-- * 'cDetectedLanguages'
2195+--
2196+-- * 'cAdvertiserName'
2197+--
2198+-- * 'cAdChoicesDestinationURL'
2199+--
2200+-- * 'cAgencyId'
2201+--
2202+-- * 'cCorrections'
2203+--
2204+-- * 'cClickThroughURLs'
2205+--
2206+-- * 'cRestrictedCategories'
2207+--
2208+-- * 'cDetectedProductCategories'
2209+--
2210+-- * 'cDealsStatus'
2211+--
2212+-- * 'cCreativeId'
2213+--
2214+-- * 'cVideo'
2215+--
2216+-- * 'cNATive'
2217+--
2218+-- * 'cDetectedSensitiveCategories'
2219+--
2220+-- * 'cImpressionTrackingURLs'
2221+--
2222+-- * 'cAccountId'
2223+--
2224+-- * 'cAttributes'
2225+--
2226+-- * 'cVersion'
2227+--
2228+-- * 'cVendorIds'
2229+--
2230+-- * 'cDetectedAdvertiserIds'
2231+--
2232+-- * 'cHTML'
2233+--
2234+-- * 'cServingRestrictions'
2235+--
2236+-- * 'cDetectedDomains'
2237+--
2238+-- * 'cOpenAuctionStatus'
2239+--
2240+-- * 'cFilteringStats'
2241+--
2242+-- * 'cDeclaredClickThroughURLs'
2243+creative
2244+ :: Creative
2245+creative =
2246+ Creative'
2247+ { _cAPIUpdateTime = Nothing
2248+ , _cDetectedLanguages = Nothing
2249+ , _cAdvertiserName = Nothing
2250+ , _cAdChoicesDestinationURL = Nothing
2251+ , _cAgencyId = Nothing
2252+ , _cCorrections = Nothing
2253+ , _cClickThroughURLs = Nothing
2254+ , _cRestrictedCategories = Nothing
2255+ , _cDetectedProductCategories = Nothing
2256+ , _cDealsStatus = Nothing
2257+ , _cCreativeId = Nothing
2258+ , _cVideo = Nothing
2259+ , _cNATive = Nothing
2260+ , _cDetectedSensitiveCategories = Nothing
2261+ , _cImpressionTrackingURLs = Nothing
2262+ , _cAccountId = Nothing
2263+ , _cAttributes = Nothing
2264+ , _cVersion = Nothing
2265+ , _cVendorIds = Nothing
2266+ , _cDetectedAdvertiserIds = Nothing
2267+ , _cHTML = Nothing
2268+ , _cServingRestrictions = Nothing
2269+ , _cDetectedDomains = Nothing
2270+ , _cOpenAuctionStatus = Nothing
2271+ , _cFilteringStats = Nothing
2272+ , _cDeclaredClickThroughURLs = Nothing
2273+ }
2274+
2275+-- | \'OutputOnly The last update timestamp of the creative via API.
2276+cAPIUpdateTime :: Lens' Creative (Maybe UTCTime)
2277+cAPIUpdateTime
2278+ = lens _cAPIUpdateTime
2279+ (\ s a -> s{_cAPIUpdateTime = a})
2280+ . mapping _DateTime
2281+
2282+-- | \'OutputOnly The detected languages for this creative. The order is
2283+-- arbitrary. The codes are 2 or 5 characters and are documented at
2284+-- https:\/\/developers.google.com\/adwords\/api\/docs\/appendix\/languagecodes.
2285+cDetectedLanguages :: Lens' Creative [Text]
2286+cDetectedLanguages
2287+ = lens _cDetectedLanguages
2288+ (\ s a -> s{_cDetectedLanguages = a})
2289+ . _Default
2290+ . _Coerce
2291+
2292+-- | The name of the company being advertised in the creative.
2293+cAdvertiserName :: Lens' Creative (Maybe Text)
2294+cAdvertiserName
2295+ = lens _cAdvertiserName
2296+ (\ s a -> s{_cAdvertiserName = a})
2297+
2298+-- | The link to AdChoices destination page.
2299+cAdChoicesDestinationURL :: Lens' Creative (Maybe Text)
2300+cAdChoicesDestinationURL
2301+ = lens _cAdChoicesDestinationURL
2302+ (\ s a -> s{_cAdChoicesDestinationURL = a})
2303+
2304+-- | The agency ID for this creative.
2305+cAgencyId :: Lens' Creative (Maybe Int64)
2306+cAgencyId
2307+ = lens _cAgencyId (\ s a -> s{_cAgencyId = a}) .
2308+ mapping _Coerce
2309+
2310+-- | \'OutputOnly Shows any corrections that were applied to this creative.
2311+cCorrections :: Lens' Creative [Correction]
2312+cCorrections
2313+ = lens _cCorrections (\ s a -> s{_cCorrections = a})
2314+ . _Default
2315+ . _Coerce
2316+
2317+-- | The set of destination URLs for the creative.
2318+cClickThroughURLs :: Lens' Creative [Text]
2319+cClickThroughURLs
2320+ = lens _cClickThroughURLs
2321+ (\ s a -> s{_cClickThroughURLs = a})
2322+ . _Default
2323+ . _Coerce
2324+
2325+-- | All restricted categories for the ads that may be shown from this
2326+-- creative.
2327+cRestrictedCategories :: Lens' Creative [Text]
2328+cRestrictedCategories
2329+ = lens _cRestrictedCategories
2330+ (\ s a -> s{_cRestrictedCategories = a})
2331+ . _Default
2332+ . _Coerce
2333+
2334+-- | \'OutputOnly Detected product categories, if any. See the
2335+-- ad-product-categories.txt file in the technical documentation for a list
2336+-- of IDs.
2337+cDetectedProductCategories :: Lens' Creative [Int32]
2338+cDetectedProductCategories
2339+ = lens _cDetectedProductCategories
2340+ (\ s a -> s{_cDetectedProductCategories = a})
2341+ . _Default
2342+ . _Coerce
2343+
2344+-- | \'OutputOnly The top-level deals status of this creative. If
2345+-- disapproved, an entry for \'auctionType=DIRECT_DEALS\' (or \'ALL\') in
2346+-- serving_restrictions will also exist. Note that this may be nuanced with
2347+-- other contextual restrictions, in which case, it may be preferable to
2348+-- read from serving_restrictions directly. Can be used to filter the
2349+-- response of the creatives.list method.
2350+cDealsStatus :: Lens' Creative (Maybe CreativeDealsStatus)
2351+cDealsStatus
2352+ = lens _cDealsStatus (\ s a -> s{_cDealsStatus = a})
2353+
2354+-- | The buyer-defined creative ID of this creative. Can be used to filter
2355+-- the response of the creatives.list method.
2356+cCreativeId :: Lens' Creative (Maybe Text)
2357+cCreativeId
2358+ = lens _cCreativeId (\ s a -> s{_cCreativeId = a})
2359+
2360+-- | A video creative.
2361+cVideo :: Lens' Creative (Maybe VideoContent)
2362+cVideo = lens _cVideo (\ s a -> s{_cVideo = a})
2363+
2364+-- | A native creative.
2365+cNATive :: Lens' Creative (Maybe NATiveContent)
2366+cNATive = lens _cNATive (\ s a -> s{_cNATive = a})
2367+
2368+-- | \'OutputOnly Detected sensitive categories, if any. See the
2369+-- ad-sensitive-categories.txt file in the technical documentation for a
2370+-- list of IDs. You should use these IDs along with the
2371+-- excluded-sensitive-category field in the bid request to filter your
2372+-- bids.
2373+cDetectedSensitiveCategories :: Lens' Creative [Int32]
2374+cDetectedSensitiveCategories
2375+ = lens _cDetectedSensitiveCategories
2376+ (\ s a -> s{_cDetectedSensitiveCategories = a})
2377+ . _Default
2378+ . _Coerce
2379+
2380+-- | The set of URLs to be called to record an impression.
2381+cImpressionTrackingURLs :: Lens' Creative [Text]
2382+cImpressionTrackingURLs
2383+ = lens _cImpressionTrackingURLs
2384+ (\ s a -> s{_cImpressionTrackingURLs = a})
2385+ . _Default
2386+ . _Coerce
2387+
2388+-- | The account that this creative belongs to. Can be used to filter the
2389+-- response of the creatives.list method.
2390+cAccountId :: Lens' Creative (Maybe Text)
2391+cAccountId
2392+ = lens _cAccountId (\ s a -> s{_cAccountId = a})
2393+
2394+-- | All attributes for the ads that may be shown from this creative. Can be
2395+-- used to filter the response of the creatives.list method.
2396+cAttributes :: Lens' Creative [Text]
2397+cAttributes
2398+ = lens _cAttributes (\ s a -> s{_cAttributes = a}) .
2399+ _Default
2400+ . _Coerce
2401+
2402+-- | \'OutputOnly The version of this creative.
2403+cVersion :: Lens' Creative (Maybe Int32)
2404+cVersion
2405+ = lens _cVersion (\ s a -> s{_cVersion = a}) .
2406+ mapping _Coerce
2407+
2408+-- | All vendor IDs for the ads that may be shown from this creative. See
2409+-- https:\/\/storage.googleapis.com\/adx-rtb-dictionaries\/vendors.txt for
2410+-- possible values.
2411+cVendorIds :: Lens' Creative [Int32]
2412+cVendorIds
2413+ = lens _cVendorIds (\ s a -> s{_cVendorIds = a}) .
2414+ _Default
2415+ . _Coerce
2416+
2417+-- | \'OutputOnly Detected advertiser IDs, if any.
2418+cDetectedAdvertiserIds :: Lens' Creative [Int64]
2419+cDetectedAdvertiserIds
2420+ = lens _cDetectedAdvertiserIds
2421+ (\ s a -> s{_cDetectedAdvertiserIds = a})
2422+ . _Default
2423+ . _Coerce
2424+
2425+-- | An HTML creative.
2426+cHTML :: Lens' Creative (Maybe HTMLContent)
2427+cHTML = lens _cHTML (\ s a -> s{_cHTML = a})
2428+
2429+-- | \'OutputOnly The granular status of this ad in specific contexts. A
2430+-- context here relates to where something ultimately serves (for example,
2431+-- a physical location, a platform, an HTTPS vs HTTP request, or the type
2432+-- of auction).
2433+cServingRestrictions :: Lens' Creative [ServingRestriction]
2434+cServingRestrictions
2435+ = lens _cServingRestrictions
2436+ (\ s a -> s{_cServingRestrictions = a})
2437+ . _Default
2438+ . _Coerce
2439+
2440+-- | \'OutputOnly The detected domains for this creative.
2441+cDetectedDomains :: Lens' Creative [Text]
2442+cDetectedDomains
2443+ = lens _cDetectedDomains
2444+ (\ s a -> s{_cDetectedDomains = a})
2445+ . _Default
2446+ . _Coerce
2447+
2448+-- | \'OutputOnly The top-level open auction status of this creative. If
2449+-- disapproved, an entry for \'auctionType = OPEN_AUCTION\' (or \'ALL\') in
2450+-- serving_restrictions will also exist. Note that this may be nuanced with
2451+-- other contextual restrictions, in which case, it may be preferable to
2452+-- read from serving_restrictions directly. Can be used to filter the
2453+-- response of the creatives.list method.
2454+cOpenAuctionStatus :: Lens' Creative (Maybe CreativeOpenAuctionStatus)
2455+cOpenAuctionStatus
2456+ = lens _cOpenAuctionStatus
2457+ (\ s a -> s{_cOpenAuctionStatus = a})
2458+
2459+-- | \'OutputOnly The filtering stats for this creative.
2460+cFilteringStats :: Lens' Creative (Maybe FilteringStats)
2461+cFilteringStats
2462+ = lens _cFilteringStats
2463+ (\ s a -> s{_cFilteringStats = a})
2464+
2465+-- | The set of declared destination URLs for the creative.
2466+cDeclaredClickThroughURLs :: Lens' Creative [Text]
2467+cDeclaredClickThroughURLs
2468+ = lens _cDeclaredClickThroughURLs
2469+ (\ s a -> s{_cDeclaredClickThroughURLs = a})
2470+ . _Default
2471+ . _Coerce
2472+
2473+instance FromJSON Creative where
2474+ parseJSON
2475+ = withObject "Creative"
2476+ (\ o ->
2477+ Creative' <$>
2478+ (o .:? "apiUpdateTime") <*>
2479+ (o .:? "detectedLanguages" .!= mempty)
2480+ <*> (o .:? "advertiserName")
2481+ <*> (o .:? "adChoicesDestinationUrl")
2482+ <*> (o .:? "agencyId")
2483+ <*> (o .:? "corrections" .!= mempty)
2484+ <*> (o .:? "clickThroughUrls" .!= mempty)
2485+ <*> (o .:? "restrictedCategories" .!= mempty)
2486+ <*> (o .:? "detectedProductCategories" .!= mempty)
2487+ <*> (o .:? "dealsStatus")
2488+ <*> (o .:? "creativeId")
2489+ <*> (o .:? "video")
2490+ <*> (o .:? "native")
2491+ <*> (o .:? "detectedSensitiveCategories" .!= mempty)
2492+ <*> (o .:? "impressionTrackingUrls" .!= mempty)
2493+ <*> (o .:? "accountId")
2494+ <*> (o .:? "attributes" .!= mempty)
2495+ <*> (o .:? "version")
2496+ <*> (o .:? "vendorIds" .!= mempty)
2497+ <*> (o .:? "detectedAdvertiserIds" .!= mempty)
2498+ <*> (o .:? "html")
2499+ <*> (o .:? "servingRestrictions" .!= mempty)
2500+ <*> (o .:? "detectedDomains" .!= mempty)
2501+ <*> (o .:? "openAuctionStatus")
2502+ <*> (o .:? "filteringStats")
2503+ <*> (o .:? "declaredClickThroughUrls" .!= mempty))
2504+
2505+instance ToJSON Creative where
2506+ toJSON Creative'{..}
2507+ = object
2508+ (catMaybes
2509+ [("apiUpdateTime" .=) <$> _cAPIUpdateTime,
2510+ ("detectedLanguages" .=) <$> _cDetectedLanguages,
2511+ ("advertiserName" .=) <$> _cAdvertiserName,
2512+ ("adChoicesDestinationUrl" .=) <$>
2513+ _cAdChoicesDestinationURL,
2514+ ("agencyId" .=) <$> _cAgencyId,
2515+ ("corrections" .=) <$> _cCorrections,
2516+ ("clickThroughUrls" .=) <$> _cClickThroughURLs,
2517+ ("restrictedCategories" .=) <$>
2518+ _cRestrictedCategories,
2519+ ("detectedProductCategories" .=) <$>
2520+ _cDetectedProductCategories,
2521+ ("dealsStatus" .=) <$> _cDealsStatus,
2522+ ("creativeId" .=) <$> _cCreativeId,
2523+ ("video" .=) <$> _cVideo, ("native" .=) <$> _cNATive,
2524+ ("detectedSensitiveCategories" .=) <$>
2525+ _cDetectedSensitiveCategories,
2526+ ("impressionTrackingUrls" .=) <$>
2527+ _cImpressionTrackingURLs,
2528+ ("accountId" .=) <$> _cAccountId,
2529+ ("attributes" .=) <$> _cAttributes,
2530+ ("version" .=) <$> _cVersion,
2531+ ("vendorIds" .=) <$> _cVendorIds,
2532+ ("detectedAdvertiserIds" .=) <$>
2533+ _cDetectedAdvertiserIds,
2534+ ("html" .=) <$> _cHTML,
2535+ ("servingRestrictions" .=) <$> _cServingRestrictions,
2536+ ("detectedDomains" .=) <$> _cDetectedDomains,
2537+ ("openAuctionStatus" .=) <$> _cOpenAuctionStatus,
2538+ ("filteringStats" .=) <$> _cFilteringStats,
2539+ ("declaredClickThroughUrls" .=) <$>
2540+ _cDeclaredClickThroughURLs])
2541+
2542+-- | \'OutputOnly The app type the restriction applies to for mobile device.
2543+--
2544+-- /See:/ 'appContext' smart constructor.
2545+newtype AppContext = AppContext'
2546+ { _acAppTypes :: Maybe [Text]
2547+ } deriving (Eq,Show,Data,Typeable,Generic)
2548+
2549+-- | Creates a value of 'AppContext' with the minimum fields required to make a request.
2550+--
2551+-- Use one of the following lenses to modify other fields as desired:
2552+--
2553+-- * 'acAppTypes'
2554+appContext
2555+ :: AppContext
2556+appContext =
2557+ AppContext'
2558+ { _acAppTypes = Nothing
2559+ }
2560+
2561+-- | The app types this restriction applies to.
2562+acAppTypes :: Lens' AppContext [Text]
2563+acAppTypes
2564+ = lens _acAppTypes (\ s a -> s{_acAppTypes = a}) .
2565+ _Default
2566+ . _Coerce
2567+
2568+instance FromJSON AppContext where
2569+ parseJSON
2570+ = withObject "AppContext"
2571+ (\ o ->
2572+ AppContext' <$> (o .:? "appTypes" .!= mempty))
2573+
2574+instance ToJSON AppContext where
2575+ toJSON AppContext'{..}
2576+ = object
2577+ (catMaybes [("appTypes" .=) <$> _acAppTypes])
2578+
2579+-- | Targeting represents different criteria that can be used by advertisers
2580+-- to target ad inventory. For example, they can choose to target ad
2581+-- requests only if the user is in the US. Multiple types of targeting are
2582+-- always applied as a logical AND, unless noted otherwise.
2583+--
2584+-- /See:/ 'marketplaceTargeting' smart constructor.
2585+data MarketplaceTargeting = MarketplaceTargeting'
2586+ { _mtGeoTargeting :: !(Maybe CriteriaTargeting)
2587+ , _mtTechnologyTargeting :: !(Maybe TechnologyTargeting)
2588+ , _mtPlacementTargeting :: !(Maybe PlacementTargeting)
2589+ , _mtVideoTargeting :: !(Maybe VideoTargeting)
2590+ , _mtInventorySizeTargeting :: !(Maybe InventorySizeTargeting)
2591+ } deriving (Eq,Show,Data,Typeable,Generic)
2592+
2593+-- | Creates a value of 'MarketplaceTargeting' with the minimum fields required to make a request.
2594+--
2595+-- Use one of the following lenses to modify other fields as desired:
2596+--
2597+-- * 'mtGeoTargeting'
2598+--
2599+-- * 'mtTechnologyTargeting'
2600+--
2601+-- * 'mtPlacementTargeting'
2602+--
2603+-- * 'mtVideoTargeting'
2604+--
2605+-- * 'mtInventorySizeTargeting'
2606+marketplaceTargeting
2607+ :: MarketplaceTargeting
2608+marketplaceTargeting =
2609+ MarketplaceTargeting'
2610+ { _mtGeoTargeting = Nothing
2611+ , _mtTechnologyTargeting = Nothing
2612+ , _mtPlacementTargeting = Nothing
2613+ , _mtVideoTargeting = Nothing
2614+ , _mtInventorySizeTargeting = Nothing
2615+ }
2616+
2617+-- | Geo criteria IDs to be included\/excluded.
2618+mtGeoTargeting :: Lens' MarketplaceTargeting (Maybe CriteriaTargeting)
2619+mtGeoTargeting
2620+ = lens _mtGeoTargeting
2621+ (\ s a -> s{_mtGeoTargeting = a})
2622+
2623+-- | Technology targeting information, e.g., operating system, device
2624+-- category.
2625+mtTechnologyTargeting :: Lens' MarketplaceTargeting (Maybe TechnologyTargeting)
2626+mtTechnologyTargeting
2627+ = lens _mtTechnologyTargeting
2628+ (\ s a -> s{_mtTechnologyTargeting = a})
2629+
2630+-- | Placement targeting information, e.g., URL, mobile applications.
2631+mtPlacementTargeting :: Lens' MarketplaceTargeting (Maybe PlacementTargeting)
2632+mtPlacementTargeting
2633+ = lens _mtPlacementTargeting
2634+ (\ s a -> s{_mtPlacementTargeting = a})
2635+
2636+-- | Video targeting information.
2637+mtVideoTargeting :: Lens' MarketplaceTargeting (Maybe VideoTargeting)
2638+mtVideoTargeting
2639+ = lens _mtVideoTargeting
2640+ (\ s a -> s{_mtVideoTargeting = a})
2641+
2642+-- | Inventory sizes to be included\/excluded.
2643+mtInventorySizeTargeting :: Lens' MarketplaceTargeting (Maybe InventorySizeTargeting)
2644+mtInventorySizeTargeting
2645+ = lens _mtInventorySizeTargeting
2646+ (\ s a -> s{_mtInventorySizeTargeting = a})
2647+
2648+instance FromJSON MarketplaceTargeting where
2649+ parseJSON
2650+ = withObject "MarketplaceTargeting"
2651+ (\ o ->
2652+ MarketplaceTargeting' <$>
2653+ (o .:? "geoTargeting") <*>
2654+ (o .:? "technologyTargeting")
2655+ <*> (o .:? "placementTargeting")
2656+ <*> (o .:? "videoTargeting")
2657+ <*> (o .:? "inventorySizeTargeting"))
2658+
2659+instance ToJSON MarketplaceTargeting where
2660+ toJSON MarketplaceTargeting'{..}
2661+ = object
2662+ (catMaybes
2663+ [("geoTargeting" .=) <$> _mtGeoTargeting,
2664+ ("technologyTargeting" .=) <$>
2665+ _mtTechnologyTargeting,
2666+ ("placementTargeting" .=) <$> _mtPlacementTargeting,
2667+ ("videoTargeting" .=) <$> _mtVideoTargeting,
2668+ ("inventorySizeTargeting" .=) <$>
2669+ _mtInventorySizeTargeting])
2670+
2671+-- | Response message for listing all reasons that bid responses resulted in
2672+-- an error.
2673+--
2674+-- /See:/ 'listBidResponseErrorsResponse' smart constructor.
2675+data ListBidResponseErrorsResponse = ListBidResponseErrorsResponse'
2676+ { _lbrerNextPageToken :: !(Maybe Text)
2677+ , _lbrerCalloutStatusRows :: !(Maybe [CalloutStatusRow])
2678+ } deriving (Eq,Show,Data,Typeable,Generic)
2679+
2680+-- | Creates a value of 'ListBidResponseErrorsResponse' with the minimum fields required to make a request.
2681+--
2682+-- Use one of the following lenses to modify other fields as desired:
2683+--
2684+-- * 'lbrerNextPageToken'
2685+--
2686+-- * 'lbrerCalloutStatusRows'
2687+listBidResponseErrorsResponse
2688+ :: ListBidResponseErrorsResponse
2689+listBidResponseErrorsResponse =
2690+ ListBidResponseErrorsResponse'
2691+ { _lbrerNextPageToken = Nothing
2692+ , _lbrerCalloutStatusRows = Nothing
2693+ }
2694+
2695+-- | A token to retrieve the next page of results. Pass this value in the
2696+-- ListBidResponseErrorsRequest.pageToken field in the subsequent call to
2697+-- the bidResponseErrors.list method to retrieve the next page of results.
2698+lbrerNextPageToken :: Lens' ListBidResponseErrorsResponse (Maybe Text)
2699+lbrerNextPageToken
2700+ = lens _lbrerNextPageToken
2701+ (\ s a -> s{_lbrerNextPageToken = a})
2702+
2703+-- | List of rows, with counts of bid responses aggregated by callout status.
2704+lbrerCalloutStatusRows :: Lens' ListBidResponseErrorsResponse [CalloutStatusRow]
2705+lbrerCalloutStatusRows
2706+ = lens _lbrerCalloutStatusRows
2707+ (\ s a -> s{_lbrerCalloutStatusRows = a})
2708+ . _Default
2709+ . _Coerce
2710+
2711+instance FromJSON ListBidResponseErrorsResponse where
2712+ parseJSON
2713+ = withObject "ListBidResponseErrorsResponse"
2714+ (\ o ->
2715+ ListBidResponseErrorsResponse' <$>
2716+ (o .:? "nextPageToken") <*>
2717+ (o .:? "calloutStatusRows" .!= mempty))
2718+
2719+instance ToJSON ListBidResponseErrorsResponse where
2720+ toJSON ListBidResponseErrorsResponse'{..}
2721+ = object
2722+ (catMaybes
2723+ [("nextPageToken" .=) <$> _lbrerNextPageToken,
2724+ ("calloutStatusRows" .=) <$>
2725+ _lbrerCalloutStatusRows])
2726+
2727+-- | \'OutputOnly Shows any corrections that were applied to this creative.
2728+--
2729+-- /See:/ 'correction' smart constructor.
2730+data Correction = Correction'
2731+ { _cContexts :: !(Maybe [ServingContext])
2732+ , _cDetails :: !(Maybe [Text])
2733+ , _cType :: !(Maybe CorrectionType)
2734+ } deriving (Eq,Show,Data,Typeable,Generic)
2735+
2736+-- | Creates a value of 'Correction' with the minimum fields required to make a request.
2737+--
2738+-- Use one of the following lenses to modify other fields as desired:
2739+--
2740+-- * 'cContexts'
2741+--
2742+-- * 'cDetails'
2743+--
2744+-- * 'cType'
2745+correction
2746+ :: Correction
2747+correction =
2748+ Correction'
2749+ { _cContexts = Nothing
2750+ , _cDetails = Nothing
2751+ , _cType = Nothing
2752+ }
2753+
2754+-- | The contexts for the correction.
2755+cContexts :: Lens' Correction [ServingContext]
2756+cContexts
2757+ = lens _cContexts (\ s a -> s{_cContexts = a}) .
2758+ _Default
2759+ . _Coerce
2760+
2761+-- | Additional details about what was corrected.
2762+cDetails :: Lens' Correction [Text]
2763+cDetails
2764+ = lens _cDetails (\ s a -> s{_cDetails = a}) .
2765+ _Default
2766+ . _Coerce
2767+
2768+-- | The type of correction that was applied to the creative.
2769+cType :: Lens' Correction (Maybe CorrectionType)
2770+cType = lens _cType (\ s a -> s{_cType = a})
2771+
2772+instance FromJSON Correction where
2773+ parseJSON
2774+ = withObject "Correction"
2775+ (\ o ->
2776+ Correction' <$>
2777+ (o .:? "contexts" .!= mempty) <*>
2778+ (o .:? "details" .!= mempty)
2779+ <*> (o .:? "type"))
2780+
2781+instance ToJSON Correction where
2782+ toJSON Correction'{..}
2783+ = object
2784+ (catMaybes
2785+ [("contexts" .=) <$> _cContexts,
2786+ ("details" .=) <$> _cDetails,
2787+ ("type" .=) <$> _cType])
2788+
2789+-- | The association between a creative and a deal.
2790+--
2791+-- /See:/ 'creativeDealAssociation' smart constructor.
2792+data CreativeDealAssociation = CreativeDealAssociation'
2793+ { _cdaCreativeId :: !(Maybe Text)
2794+ , _cdaAccountId :: !(Maybe Text)
2795+ , _cdaDealsId :: !(Maybe Text)
2796+ } deriving (Eq,Show,Data,Typeable,Generic)
2797+
2798+-- | Creates a value of 'CreativeDealAssociation' with the minimum fields required to make a request.
2799+--
2800+-- Use one of the following lenses to modify other fields as desired:
2801+--
2802+-- * 'cdaCreativeId'
2803+--
2804+-- * 'cdaAccountId'
2805+--
2806+-- * 'cdaDealsId'
2807+creativeDealAssociation
2808+ :: CreativeDealAssociation
2809+creativeDealAssociation =
2810+ CreativeDealAssociation'
2811+ { _cdaCreativeId = Nothing
2812+ , _cdaAccountId = Nothing
2813+ , _cdaDealsId = Nothing
2814+ }
2815+
2816+-- | The ID of the creative associated with the deal.
2817+cdaCreativeId :: Lens' CreativeDealAssociation (Maybe Text)
2818+cdaCreativeId
2819+ = lens _cdaCreativeId
2820+ (\ s a -> s{_cdaCreativeId = a})
2821+
2822+-- | The account the creative belongs to.
2823+cdaAccountId :: Lens' CreativeDealAssociation (Maybe Text)
2824+cdaAccountId
2825+ = lens _cdaAccountId (\ s a -> s{_cdaAccountId = a})
2826+
2827+-- | The externalDealId for the deal associated with the creative.
2828+cdaDealsId :: Lens' CreativeDealAssociation (Maybe Text)
2829+cdaDealsId
2830+ = lens _cdaDealsId (\ s a -> s{_cdaDealsId = a})
2831+
2832+instance FromJSON CreativeDealAssociation where
2833+ parseJSON
2834+ = withObject "CreativeDealAssociation"
2835+ (\ o ->
2836+ CreativeDealAssociation' <$>
2837+ (o .:? "creativeId") <*> (o .:? "accountId") <*>
2838+ (o .:? "dealsId"))
2839+
2840+instance ToJSON CreativeDealAssociation where
2841+ toJSON CreativeDealAssociation'{..}
2842+ = object
2843+ (catMaybes
2844+ [("creativeId" .=) <$> _cdaCreativeId,
2845+ ("accountId" .=) <$> _cdaAccountId,
2846+ ("dealsId" .=) <$> _cdaDealsId])
2847+
2848+-- | Represents a seller of inventory. Each seller is identified by a unique
2849+-- Ad Manager account ID.
2850+--
2851+-- /See:/ 'seller' smart constructor.
2852+data Seller = Seller'
2853+ { _sAccountId :: !(Maybe Text)
2854+ , _sSubAccountId :: !(Maybe Text)
2855+ } deriving (Eq,Show,Data,Typeable,Generic)
2856+
2857+-- | Creates a value of 'Seller' with the minimum fields required to make a request.
2858+--
2859+-- Use one of the following lenses to modify other fields as desired:
2860+--
2861+-- * 'sAccountId'
2862+--
2863+-- * 'sSubAccountId'
2864+seller
2865+ :: Seller
2866+seller =
2867+ Seller'
2868+ { _sAccountId = Nothing
2869+ , _sSubAccountId = Nothing
2870+ }
2871+
2872+-- | The unique ID for the seller. The seller fills in this field. The seller
2873+-- account ID is then available to buyer in the product.
2874+sAccountId :: Lens' Seller (Maybe Text)
2875+sAccountId
2876+ = lens _sAccountId (\ s a -> s{_sAccountId = a})
2877+
2878+-- | Optional sub-account ID for the seller.
2879+sSubAccountId :: Lens' Seller (Maybe Text)
2880+sSubAccountId
2881+ = lens _sSubAccountId
2882+ (\ s a -> s{_sSubAccountId = a})
2883+
2884+instance FromJSON Seller where
2885+ parseJSON
2886+ = withObject "Seller"
2887+ (\ o ->
2888+ Seller' <$>
2889+ (o .:? "accountId") <*> (o .:? "subAccountId"))
2890+
2891+instance ToJSON Seller where
2892+ toJSON Seller'{..}
2893+ = object
2894+ (catMaybes
2895+ [("accountId" .=) <$> _sAccountId,
2896+ ("subAccountId" .=) <$> _sSubAccountId])
2897+
2898+-- | A response for listing creatives.
2899+--
2900+-- /See:/ 'listCreativesResponse' smart constructor.
2901+data ListCreativesResponse = ListCreativesResponse'
2902+ { _lcrNextPageToken :: !(Maybe Text)
2903+ , _lcrCreatives :: !(Maybe [Creative])
2904+ } deriving (Eq,Show,Data,Typeable,Generic)
2905+
2906+-- | Creates a value of 'ListCreativesResponse' with the minimum fields required to make a request.
2907+--
2908+-- Use one of the following lenses to modify other fields as desired:
2909+--
2910+-- * 'lcrNextPageToken'
2911+--
2912+-- * 'lcrCreatives'
2913+listCreativesResponse
2914+ :: ListCreativesResponse
2915+listCreativesResponse =
2916+ ListCreativesResponse'
2917+ { _lcrNextPageToken = Nothing
2918+ , _lcrCreatives = Nothing
2919+ }
2920+
2921+-- | A token to retrieve the next page of results. Pass this value in the
2922+-- ListCreativesRequest.page_token field in the subsequent call to
2923+-- \`ListCreatives\` method to retrieve the next page of results.
2924+lcrNextPageToken :: Lens' ListCreativesResponse (Maybe Text)
2925+lcrNextPageToken
2926+ = lens _lcrNextPageToken
2927+ (\ s a -> s{_lcrNextPageToken = a})
2928+
2929+-- | The list of creatives.
2930+lcrCreatives :: Lens' ListCreativesResponse [Creative]
2931+lcrCreatives
2932+ = lens _lcrCreatives (\ s a -> s{_lcrCreatives = a})
2933+ . _Default
2934+ . _Coerce
2935+
2936+instance FromJSON ListCreativesResponse where
2937+ parseJSON
2938+ = withObject "ListCreativesResponse"
2939+ (\ o ->
2940+ ListCreativesResponse' <$>
2941+ (o .:? "nextPageToken") <*>
2942+ (o .:? "creatives" .!= mempty))
2943+
2944+instance ToJSON ListCreativesResponse where
2945+ toJSON ListCreativesResponse'{..}
2946+ = object
2947+ (catMaybes
2948+ [("nextPageToken" .=) <$> _lcrNextPageToken,
2949+ ("creatives" .=) <$> _lcrCreatives])
2950+
2951+-- | A response may include multiple rows, breaking down along various
2952+-- dimensions. Encapsulates the values of all dimensions for a given row.
2953+--
2954+-- /See:/ 'rowDimensions' smart constructor.
2955+data RowDimensions = RowDimensions'
2956+ { _rdPublisherIdentifier :: !(Maybe Text)
2957+ , _rdTimeInterval :: !(Maybe TimeInterval)
2958+ } deriving (Eq,Show,Data,Typeable,Generic)
2959+
2960+-- | Creates a value of 'RowDimensions' with the minimum fields required to make a request.
2961+--
2962+-- Use one of the following lenses to modify other fields as desired:
2963+--
2964+-- * 'rdPublisherIdentifier'
2965+--
2966+-- * 'rdTimeInterval'
2967+rowDimensions
2968+ :: RowDimensions
2969+rowDimensions =
2970+ RowDimensions'
2971+ { _rdPublisherIdentifier = Nothing
2972+ , _rdTimeInterval = Nothing
2973+ }
2974+
2975+-- | The publisher identifier for this row, if a breakdown by
2976+-- [BreakdownDimension.PUBLISHER_IDENTIFIER](https:\/\/developers.google.com\/authorized-buyers\/apis\/reference\/rest\/v2beta1\/bidders.accounts.filterSets#FilterSet.BreakdownDimension)
2977+-- was requested.
2978+rdPublisherIdentifier :: Lens' RowDimensions (Maybe Text)
2979+rdPublisherIdentifier
2980+ = lens _rdPublisherIdentifier
2981+ (\ s a -> s{_rdPublisherIdentifier = a})
2982+
2983+-- | The time interval that this row represents.
2984+rdTimeInterval :: Lens' RowDimensions (Maybe TimeInterval)
2985+rdTimeInterval
2986+ = lens _rdTimeInterval
2987+ (\ s a -> s{_rdTimeInterval = a})
2988+
2989+instance FromJSON RowDimensions where
2990+ parseJSON
2991+ = withObject "RowDimensions"
2992+ (\ o ->
2993+ RowDimensions' <$>
2994+ (o .:? "publisherIdentifier") <*>
2995+ (o .:? "timeInterval"))
2996+
2997+instance ToJSON RowDimensions where
2998+ toJSON RowDimensions'{..}
2999+ = object
3000+ (catMaybes
3001+ [("publisherIdentifier" .=) <$>
3002+ _rdPublisherIdentifier,
3003+ ("timeInterval" .=) <$> _rdTimeInterval])
3004+
3005+-- | Represents targeting information for operating systems.
3006+--
3007+-- /See:/ 'operatingSystemTargeting' smart constructor.
3008+data OperatingSystemTargeting = OperatingSystemTargeting'
3009+ { _ostOperatingSystemVersionCriteria :: !(Maybe CriteriaTargeting)
3010+ , _ostOperatingSystemCriteria :: !(Maybe CriteriaTargeting)
3011+ } deriving (Eq,Show,Data,Typeable,Generic)
3012+
3013+-- | Creates a value of 'OperatingSystemTargeting' with the minimum fields required to make a request.
3014+--
3015+-- Use one of the following lenses to modify other fields as desired:
3016+--
3017+-- * 'ostOperatingSystemVersionCriteria'
3018+--
3019+-- * 'ostOperatingSystemCriteria'
3020+operatingSystemTargeting
3021+ :: OperatingSystemTargeting
3022+operatingSystemTargeting =
3023+ OperatingSystemTargeting'
3024+ { _ostOperatingSystemVersionCriteria = Nothing
3025+ , _ostOperatingSystemCriteria = Nothing
3026+ }
3027+
3028+-- | IDs of operating system versions to be included\/excluded.
3029+ostOperatingSystemVersionCriteria :: Lens' OperatingSystemTargeting (Maybe CriteriaTargeting)
3030+ostOperatingSystemVersionCriteria
3031+ = lens _ostOperatingSystemVersionCriteria
3032+ (\ s a -> s{_ostOperatingSystemVersionCriteria = a})
3033+
3034+-- | IDs of operating systems to be included\/excluded.
3035+ostOperatingSystemCriteria :: Lens' OperatingSystemTargeting (Maybe CriteriaTargeting)
3036+ostOperatingSystemCriteria
3037+ = lens _ostOperatingSystemCriteria
3038+ (\ s a -> s{_ostOperatingSystemCriteria = a})
3039+
3040+instance FromJSON OperatingSystemTargeting where
3041+ parseJSON
3042+ = withObject "OperatingSystemTargeting"
3043+ (\ o ->
3044+ OperatingSystemTargeting' <$>
3045+ (o .:? "operatingSystemVersionCriteria") <*>
3046+ (o .:? "operatingSystemCriteria"))
3047+
3048+instance ToJSON OperatingSystemTargeting where
3049+ toJSON OperatingSystemTargeting'{..}
3050+ = object
3051+ (catMaybes
3052+ [("operatingSystemVersionCriteria" .=) <$>
3053+ _ostOperatingSystemVersionCriteria,
3054+ ("operatingSystemCriteria" .=) <$>
3055+ _ostOperatingSystemCriteria])
3056+
3057+-- | Response message for listing all details associated with a given
3058+-- filtered bid reason.
3059+--
3060+-- /See:/ 'listCreativeStatusBreakdownByDetailResponse' smart constructor.
3061+data ListCreativeStatusBreakdownByDetailResponse = ListCreativeStatusBreakdownByDetailResponse'
3062+ { _lcsbbdrNextPageToken :: !(Maybe Text)
3063+ , _lcsbbdrDetailType :: !(Maybe ListCreativeStatusBreakdownByDetailResponseDetailType)
3064+ , _lcsbbdrFilteredBidDetailRows :: !(Maybe [FilteredBidDetailRow])
3065+ } deriving (Eq,Show,Data,Typeable,Generic)
3066+
3067+-- | Creates a value of 'ListCreativeStatusBreakdownByDetailResponse' with the minimum fields required to make a request.
3068+--
3069+-- Use one of the following lenses to modify other fields as desired:
3070+--
3071+-- * 'lcsbbdrNextPageToken'
3072+--
3073+-- * 'lcsbbdrDetailType'
3074+--
3075+-- * 'lcsbbdrFilteredBidDetailRows'
3076+listCreativeStatusBreakdownByDetailResponse
3077+ :: ListCreativeStatusBreakdownByDetailResponse
3078+listCreativeStatusBreakdownByDetailResponse =
3079+ ListCreativeStatusBreakdownByDetailResponse'
3080+ { _lcsbbdrNextPageToken = Nothing
3081+ , _lcsbbdrDetailType = Nothing
3082+ , _lcsbbdrFilteredBidDetailRows = Nothing
3083+ }
3084+
3085+-- | A token to retrieve the next page of results. Pass this value in the
3086+-- ListCreativeStatusBreakdownByDetailRequest.pageToken field in the
3087+-- subsequent call to the filteredBids.details.list method to retrieve the
3088+-- next page of results.
3089+lcsbbdrNextPageToken :: Lens' ListCreativeStatusBreakdownByDetailResponse (Maybe Text)
3090+lcsbbdrNextPageToken
3091+ = lens _lcsbbdrNextPageToken
3092+ (\ s a -> s{_lcsbbdrNextPageToken = a})
3093+
3094+-- | The type of detail that the detail IDs represent.
3095+lcsbbdrDetailType :: Lens' ListCreativeStatusBreakdownByDetailResponse (Maybe ListCreativeStatusBreakdownByDetailResponseDetailType)
3096+lcsbbdrDetailType
3097+ = lens _lcsbbdrDetailType
3098+ (\ s a -> s{_lcsbbdrDetailType = a})
3099+
3100+-- | List of rows, with counts of bids with a given creative status
3101+-- aggregated by detail.
3102+lcsbbdrFilteredBidDetailRows :: Lens' ListCreativeStatusBreakdownByDetailResponse [FilteredBidDetailRow]
3103+lcsbbdrFilteredBidDetailRows
3104+ = lens _lcsbbdrFilteredBidDetailRows
3105+ (\ s a -> s{_lcsbbdrFilteredBidDetailRows = a})
3106+ . _Default
3107+ . _Coerce
3108+
3109+instance FromJSON
3110+ ListCreativeStatusBreakdownByDetailResponse where
3111+ parseJSON
3112+ = withObject
3113+ "ListCreativeStatusBreakdownByDetailResponse"
3114+ (\ o ->
3115+ ListCreativeStatusBreakdownByDetailResponse' <$>
3116+ (o .:? "nextPageToken") <*> (o .:? "detailType") <*>
3117+ (o .:? "filteredBidDetailRows" .!= mempty))
3118+
3119+instance ToJSON
3120+ ListCreativeStatusBreakdownByDetailResponse where
3121+ toJSON
3122+ ListCreativeStatusBreakdownByDetailResponse'{..}
3123+ = object
3124+ (catMaybes
3125+ [("nextPageToken" .=) <$> _lcsbbdrNextPageToken,
3126+ ("detailType" .=) <$> _lcsbbdrDetailType,
3127+ ("filteredBidDetailRows" .=) <$>
3128+ _lcsbbdrFilteredBidDetailRows])
3129+
3130+-- | \'OutputOnly A security context.
3131+--
3132+-- /See:/ 'securityContext' smart constructor.
3133+newtype SecurityContext = SecurityContext'
3134+ { _scSecurities :: Maybe [Text]
3135+ } deriving (Eq,Show,Data,Typeable,Generic)
3136+
3137+-- | Creates a value of 'SecurityContext' with the minimum fields required to make a request.
3138+--
3139+-- Use one of the following lenses to modify other fields as desired:
3140+--
3141+-- * 'scSecurities'
3142+securityContext
3143+ :: SecurityContext
3144+securityContext =
3145+ SecurityContext'
3146+ { _scSecurities = Nothing
3147+ }
3148+
3149+-- | The security types in this context.
3150+scSecurities :: Lens' SecurityContext [Text]
3151+scSecurities
3152+ = lens _scSecurities (\ s a -> s{_scSecurities = a})
3153+ . _Default
3154+ . _Coerce
3155+
3156+instance FromJSON SecurityContext where
3157+ parseJSON
3158+ = withObject "SecurityContext"
3159+ (\ o ->
3160+ SecurityContext' <$> (o .:? "securities" .!= mempty))
3161+
3162+instance ToJSON SecurityContext where
3163+ toJSON SecurityContext'{..}
3164+ = object
3165+ (catMaybes [("securities" .=) <$> _scSecurities])
3166+
3167+-- | Represents a whole or partial calendar date, e.g. a birthday. The time
3168+-- of day and time zone are either specified elsewhere or are not
3169+-- significant. The date is relative to the Proleptic Gregorian Calendar.
3170+-- This can represent: * A full date, with non-zero year, month and day
3171+-- values * A month and day value, with a zero year, e.g. an anniversary *
3172+-- A year on its own, with zero month and day values * A year and month
3173+-- value, with a zero day, e.g. a credit card expiration date Related types
3174+-- are google.type.TimeOfDay and \`google.protobuf.Timestamp\`.
3175+--
3176+-- /See:/ 'date' smart constructor.
3177+data Date = Date'
3178+ { _dDay :: !(Maybe (Textual Int32))
3179+ , _dYear :: !(Maybe (Textual Int32))
3180+ , _dMonth :: !(Maybe (Textual Int32))
3181+ } deriving (Eq,Show,Data,Typeable,Generic)
3182+
3183+-- | Creates a value of 'Date' with the minimum fields required to make a request.
3184+--
3185+-- Use one of the following lenses to modify other fields as desired:
3186+--
3187+-- * 'dDay'
3188+--
3189+-- * 'dYear'
3190+--
3191+-- * 'dMonth'
3192+date
3193+ :: Date
3194+date =
3195+ Date'
3196+ { _dDay = Nothing
3197+ , _dYear = Nothing
3198+ , _dMonth = Nothing
3199+ }
3200+
3201+-- | Day of month. Must be from 1 to 31 and valid for the year and month, or
3202+-- 0 if specifying a year by itself or a year and month where the day is
3203+-- not significant.
3204+dDay :: Lens' Date (Maybe Int32)
3205+dDay
3206+ = lens _dDay (\ s a -> s{_dDay = a}) .
3207+ mapping _Coerce
3208+
3209+-- | Year of date. Must be from 1 to 9999, or 0 if specifying a date without
3210+-- a year.
3211+dYear :: Lens' Date (Maybe Int32)
3212+dYear
3213+ = lens _dYear (\ s a -> s{_dYear = a}) .
3214+ mapping _Coerce
3215+
3216+-- | Month of year. Must be from 1 to 12, or 0 if specifying a year without a
3217+-- month and day.
3218+dMonth :: Lens' Date (Maybe Int32)
3219+dMonth
3220+ = lens _dMonth (\ s a -> s{_dMonth = a}) .
3221+ mapping _Coerce
3222+
3223+instance FromJSON Date where
3224+ parseJSON
3225+ = withObject "Date"
3226+ (\ o ->
3227+ Date' <$>
3228+ (o .:? "day") <*> (o .:? "year") <*> (o .:? "month"))
3229+
3230+instance ToJSON Date where
3231+ toJSON Date'{..}
3232+ = object
3233+ (catMaybes
3234+ [("day" .=) <$> _dDay, ("year" .=) <$> _dYear,
3235+ ("month" .=) <$> _dMonth])
3236+
3237+-- | Request to cancel an ongoing negotiation.
3238+--
3239+-- /See:/ 'cancelNegotiationRequest' smart constructor.
3240+data CancelNegotiationRequest =
3241+ CancelNegotiationRequest'
3242+ deriving (Eq,Show,Data,Typeable,Generic)
3243+
3244+-- | Creates a value of 'CancelNegotiationRequest' with the minimum fields required to make a request.
3245+--
3246+cancelNegotiationRequest
3247+ :: CancelNegotiationRequest
3248+cancelNegotiationRequest = CancelNegotiationRequest'
3249+
3250+instance FromJSON CancelNegotiationRequest where
3251+ parseJSON
3252+ = withObject "CancelNegotiationRequest"
3253+ (\ o -> pure CancelNegotiationRequest')
3254+
3255+instance ToJSON CancelNegotiationRequest where
3256+ toJSON = const emptyObject
3257+
3258+-- | Contains information on how a buyer or seller can be reached.
3259+--
3260+-- /See:/ 'contactInformation' smart constructor.
3261+data ContactInformation = ContactInformation'
3262+ { _ciEmail :: !(Maybe Text)
3263+ , _ciName :: !(Maybe Text)
3264+ } deriving (Eq,Show,Data,Typeable,Generic)
3265+
3266+-- | Creates a value of 'ContactInformation' with the minimum fields required to make a request.
3267+--
3268+-- Use one of the following lenses to modify other fields as desired:
3269+--
3270+-- * 'ciEmail'
3271+--
3272+-- * 'ciName'
3273+contactInformation
3274+ :: ContactInformation
3275+contactInformation =
3276+ ContactInformation'
3277+ { _ciEmail = Nothing
3278+ , _ciName = Nothing
3279+ }
3280+
3281+-- | Email address for the contact.
3282+ciEmail :: Lens' ContactInformation (Maybe Text)
3283+ciEmail = lens _ciEmail (\ s a -> s{_ciEmail = a})
3284+
3285+-- | The name of the contact.
3286+ciName :: Lens' ContactInformation (Maybe Text)
3287+ciName = lens _ciName (\ s a -> s{_ciName = a})
3288+
3289+instance FromJSON ContactInformation where
3290+ parseJSON
3291+ = withObject "ContactInformation"
3292+ (\ o ->
3293+ ContactInformation' <$>
3294+ (o .:? "email") <*> (o .:? "name"))
3295+
3296+instance ToJSON ContactInformation where
3297+ toJSON ContactInformation'{..}
3298+ = object
3299+ (catMaybes
3300+ [("email" .=) <$> _ciEmail, ("name" .=) <$> _ciName])
3301+
3302+-- | An absolute date range, specified by its start date and end date. The
3303+-- supported range of dates begins 30 days before today and ends today.
3304+-- Validity checked upon filter set creation. If a filter set with an
3305+-- absolute date range is run at a later date more than 30 days after
3306+-- start_date, it will fail.
3307+--
3308+-- /See:/ 'absoluteDateRange' smart constructor.
3309+data AbsoluteDateRange = AbsoluteDateRange'
3310+ { _adrEndDate :: !(Maybe Date)
3311+ , _adrStartDate :: !(Maybe Date)
3312+ } deriving (Eq,Show,Data,Typeable,Generic)
3313+
3314+-- | Creates a value of 'AbsoluteDateRange' with the minimum fields required to make a request.
3315+--
3316+-- Use one of the following lenses to modify other fields as desired:
3317+--
3318+-- * 'adrEndDate'
3319+--
3320+-- * 'adrStartDate'
3321+absoluteDateRange
3322+ :: AbsoluteDateRange
3323+absoluteDateRange =
3324+ AbsoluteDateRange'
3325+ { _adrEndDate = Nothing
3326+ , _adrStartDate = Nothing
3327+ }
3328+
3329+-- | The end date of the range (inclusive). Must be within the 30 days
3330+-- leading up to current date, and must be equal to or after start_date.
3331+adrEndDate :: Lens' AbsoluteDateRange (Maybe Date)
3332+adrEndDate
3333+ = lens _adrEndDate (\ s a -> s{_adrEndDate = a})
3334+
3335+-- | The start date of the range (inclusive). Must be within the 30 days
3336+-- leading up to current date, and must be equal to or before end_date.
3337+adrStartDate :: Lens' AbsoluteDateRange (Maybe Date)
3338+adrStartDate
3339+ = lens _adrStartDate (\ s a -> s{_adrStartDate = a})
3340+
3341+instance FromJSON AbsoluteDateRange where
3342+ parseJSON
3343+ = withObject "AbsoluteDateRange"
3344+ (\ o ->
3345+ AbsoluteDateRange' <$>
3346+ (o .:? "endDate") <*> (o .:? "startDate"))
3347+
3348+instance ToJSON AbsoluteDateRange where
3349+ toJSON AbsoluteDateRange'{..}
3350+ = object
3351+ (catMaybes
3352+ [("endDate" .=) <$> _adrEndDate,
3353+ ("startDate" .=) <$> _adrStartDate])
3354+
3355+-- | A specific filtering status and how many times it occurred.
3356+--
3357+-- /See:/ 'reason' smart constructor.
3358+data Reason = Reason'
3359+ { _rStatus :: !(Maybe (Textual Int32))
3360+ , _rCount :: !(Maybe (Textual Int64))
3361+ } deriving (Eq,Show,Data,Typeable,Generic)
3362+
3363+-- | Creates a value of 'Reason' with the minimum fields required to make a request.
3364+--
3365+-- Use one of the following lenses to modify other fields as desired:
3366+--
3367+-- * 'rStatus'
3368+--
3369+-- * 'rCount'
3370+reason
3371+ :: Reason
3372+reason =
3373+ Reason'
3374+ { _rStatus = Nothing
3375+ , _rCount = Nothing
3376+ }
3377+
3378+-- | The filtering status code. Please refer to the
3379+-- [creative-status-codes.txt](https:\/\/storage.googleapis.com\/adx-rtb-dictionaries\/creative-status-codes.txt)
3380+-- file for different statuses.
3381+rStatus :: Lens' Reason (Maybe Int32)
3382+rStatus
3383+ = lens _rStatus (\ s a -> s{_rStatus = a}) .
3384+ mapping _Coerce
3385+
3386+-- | The number of times the creative was filtered for the status. The count
3387+-- is aggregated across all publishers on the exchange.
3388+rCount :: Lens' Reason (Maybe Int64)
3389+rCount
3390+ = lens _rCount (\ s a -> s{_rCount = a}) .
3391+ mapping _Coerce
3392+
3393+instance FromJSON Reason where
3394+ parseJSON
3395+ = withObject "Reason"
3396+ (\ o ->
3397+ Reason' <$> (o .:? "status") <*> (o .:? "count"))
3398+
3399+instance ToJSON Reason where
3400+ toJSON Reason'{..}
3401+ = object
3402+ (catMaybes
3403+ [("status" .=) <$> _rStatus,
3404+ ("count" .=) <$> _rCount])
3405+
3406+-- | \'OutputOnly The auction type the restriction applies to.
3407+--
3408+-- /See:/ 'auctionContext' smart constructor.
3409+newtype AuctionContext = AuctionContext'
3410+ { _acAuctionTypes :: Maybe [Text]
3411+ } deriving (Eq,Show,Data,Typeable,Generic)
3412+
3413+-- | Creates a value of 'AuctionContext' with the minimum fields required to make a request.
3414+--
3415+-- Use one of the following lenses to modify other fields as desired:
3416+--
3417+-- * 'acAuctionTypes'
3418+auctionContext
3419+ :: AuctionContext
3420+auctionContext =
3421+ AuctionContext'
3422+ { _acAuctionTypes = Nothing
3423+ }
3424+
3425+-- | The auction types this restriction applies to.
3426+acAuctionTypes :: Lens' AuctionContext [Text]
3427+acAuctionTypes
3428+ = lens _acAuctionTypes
3429+ (\ s a -> s{_acAuctionTypes = a})
3430+ . _Default
3431+ . _Coerce
3432+
3433+instance FromJSON AuctionContext where
3434+ parseJSON
3435+ = withObject "AuctionContext"
3436+ (\ o ->
3437+ AuctionContext' <$>
3438+ (o .:? "auctionTypes" .!= mempty))
3439+
3440+instance ToJSON AuctionContext where
3441+ toJSON AuctionContext'{..}
3442+ = object
3443+ (catMaybes [("auctionTypes" .=) <$> _acAuctionTypes])
3444+
3445+-- | A deal represents a segment of inventory for displaying ads on. A
3446+-- proposal can contain multiple deals. A deal contains the terms and
3447+-- targeting information that is used for serving.
3448+--
3449+-- /See:/ 'deal' smart constructor.
3450+data Deal = Deal'
3451+ { _dAvailableStartTime :: !(Maybe DateTime')
3452+ , _dExternalDealId :: !(Maybe Text)
3453+ , _dBuyerPrivateData :: !(Maybe PrivateData)
3454+ , _dIsSetupComplete :: !(Maybe Bool)
3455+ , _dWebPropertyCode :: !(Maybe Text)
3456+ , _dDeliveryControl :: !(Maybe DeliveryControl)
3457+ , _dDealServingMetadata :: !(Maybe DealServingMetadata)
3458+ , _dProposalId :: !(Maybe Text)
3459+ , _dTargeting :: !(Maybe MarketplaceTargeting)
3460+ , _dDealId :: !(Maybe Text)
3461+ , _dCreativeRestrictions :: !(Maybe CreativeRestrictions)
3462+ , _dSyndicationProduct :: !(Maybe DealSyndicationProduct)
3463+ , _dCreateProductRevision :: !(Maybe (Textual Int64))
3464+ , _dUpdateTime :: !(Maybe DateTime')
3465+ , _dTargetingCriterion :: !(Maybe [TargetingCriteria])
3466+ , _dSellerContacts :: !(Maybe [ContactInformation])
3467+ , _dCreateProductId :: !(Maybe Text)
3468+ , _dDisplayName :: !(Maybe Text)
3469+ , _dProgrammaticCreativeSource :: !(Maybe DealProgrammaticCreativeSource)
3470+ , _dAvailableEndTime :: !(Maybe DateTime')
3471+ , _dCreativePreApprovalPolicy :: !(Maybe DealCreativePreApprovalPolicy)
3472+ , _dDescription :: !(Maybe Text)
3473+ , _dCreateTime :: !(Maybe DateTime')
3474+ , _dCreativeSafeFrameCompatibility :: !(Maybe DealCreativeSafeFrameCompatibility)
3475+ , _dDealTerms :: !(Maybe DealTerms)
3476+ } deriving (Eq,Show,Data,Typeable,Generic)
3477+
3478+-- | Creates a value of 'Deal' with the minimum fields required to make a request.
3479+--
3480+-- Use one of the following lenses to modify other fields as desired:
3481+--
3482+-- * 'dAvailableStartTime'
3483+--
3484+-- * 'dExternalDealId'
3485+--
3486+-- * 'dBuyerPrivateData'
3487+--
3488+-- * 'dIsSetupComplete'
3489+--
3490+-- * 'dWebPropertyCode'
3491+--
3492+-- * 'dDeliveryControl'
3493+--
3494+-- * 'dDealServingMetadata'
3495+--
3496+-- * 'dProposalId'
3497+--
3498+-- * 'dTargeting'
3499+--
3500+-- * 'dDealId'
3501+--
3502+-- * 'dCreativeRestrictions'
3503+--
3504+-- * 'dSyndicationProduct'
3505+--
3506+-- * 'dCreateProductRevision'
3507+--
3508+-- * 'dUpdateTime'
3509+--
3510+-- * 'dTargetingCriterion'
3511+--
3512+-- * 'dSellerContacts'
3513+--
3514+-- * 'dCreateProductId'
3515+--
3516+-- * 'dDisplayName'
3517+--
3518+-- * 'dProgrammaticCreativeSource'
3519+--
3520+-- * 'dAvailableEndTime'
3521+--
3522+-- * 'dCreativePreApprovalPolicy'
3523+--
3524+-- * 'dDescription'
3525+--
3526+-- * 'dCreateTime'
3527+--
3528+-- * 'dCreativeSafeFrameCompatibility'
3529+--
3530+-- * 'dDealTerms'
3531+deal
3532+ :: Deal
3533+deal =
3534+ Deal'
3535+ { _dAvailableStartTime = Nothing
3536+ , _dExternalDealId = Nothing
3537+ , _dBuyerPrivateData = Nothing
3538+ , _dIsSetupComplete = Nothing
3539+ , _dWebPropertyCode = Nothing
3540+ , _dDeliveryControl = Nothing
3541+ , _dDealServingMetadata = Nothing
3542+ , _dProposalId = Nothing
3543+ , _dTargeting = Nothing
3544+ , _dDealId = Nothing
3545+ , _dCreativeRestrictions = Nothing
3546+ , _dSyndicationProduct = Nothing
3547+ , _dCreateProductRevision = Nothing
3548+ , _dUpdateTime = Nothing
3549+ , _dTargetingCriterion = Nothing
3550+ , _dSellerContacts = Nothing
3551+ , _dCreateProductId = Nothing
3552+ , _dDisplayName = Nothing
3553+ , _dProgrammaticCreativeSource = Nothing
3554+ , _dAvailableEndTime = Nothing
3555+ , _dCreativePreApprovalPolicy = Nothing
3556+ , _dDescription = Nothing
3557+ , _dCreateTime = Nothing
3558+ , _dCreativeSafeFrameCompatibility = Nothing
3559+ , _dDealTerms = Nothing
3560+ }
3561+
3562+-- | Optional proposed flight start time of the deal. This will generally be
3563+-- stored in the granularity of one second since deal serving starts at
3564+-- seconds boundary. Any time specified with more granularity (e.g., in
3565+-- milliseconds) will be truncated towards the start of time in seconds.
3566+dAvailableStartTime :: Lens' Deal (Maybe UTCTime)
3567+dAvailableStartTime
3568+ = lens _dAvailableStartTime
3569+ (\ s a -> s{_dAvailableStartTime = a})
3570+ . mapping _DateTime
3571+
3572+-- | The external deal ID assigned to this deal once the deal is finalized.
3573+-- This is the deal ID that shows up in serving\/reporting etc.
3574+-- \'OutputOnly
3575+dExternalDealId :: Lens' Deal (Maybe Text)
3576+dExternalDealId
3577+ = lens _dExternalDealId
3578+ (\ s a -> s{_dExternalDealId = a})
3579+
3580+-- | Buyer private data (hidden from seller).
3581+dBuyerPrivateData :: Lens' Deal (Maybe PrivateData)
3582+dBuyerPrivateData
3583+ = lens _dBuyerPrivateData
3584+ (\ s a -> s{_dBuyerPrivateData = a})
3585+
3586+-- | True, if the buyside inventory setup is complete for this deal.
3587+-- \'OutputOnly
3588+dIsSetupComplete :: Lens' Deal (Maybe Bool)
3589+dIsSetupComplete
3590+ = lens _dIsSetupComplete
3591+ (\ s a -> s{_dIsSetupComplete = a})
3592+
3593+-- | The web property code for the seller copied over from the product.
3594+dWebPropertyCode :: Lens' Deal (Maybe Text)
3595+dWebPropertyCode
3596+ = lens _dWebPropertyCode
3597+ (\ s a -> s{_dWebPropertyCode = a})
3598+
3599+-- | The set of fields around delivery control that are interesting for a
3600+-- buyer to see but are non-negotiable. These are set by the publisher.
3601+dDeliveryControl :: Lens' Deal (Maybe DeliveryControl)
3602+dDeliveryControl
3603+ = lens _dDeliveryControl
3604+ (\ s a -> s{_dDeliveryControl = a})
3605+
3606+-- | Metadata about the serving status of this deal. \'OutputOnly
3607+dDealServingMetadata :: Lens' Deal (Maybe DealServingMetadata)
3608+dDealServingMetadata
3609+ = lens _dDealServingMetadata
3610+ (\ s a -> s{_dDealServingMetadata = a})
3611+
3612+-- | ID of the proposal that this deal is part of. \'OutputOnly
3613+dProposalId :: Lens' Deal (Maybe Text)
3614+dProposalId
3615+ = lens _dProposalId (\ s a -> s{_dProposalId = a})
3616+
3617+-- | Specifies the subset of inventory targeted by the deal. \'OutputOnly
3618+dTargeting :: Lens' Deal (Maybe MarketplaceTargeting)
3619+dTargeting
3620+ = lens _dTargeting (\ s a -> s{_dTargeting = a})
3621+
3622+-- | A unique deal ID for the deal (server-assigned). \'OutputOnly
3623+dDealId :: Lens' Deal (Maybe Text)
3624+dDealId = lens _dDealId (\ s a -> s{_dDealId = a})
3625+
3626+-- | Restricitions about the creatives associated with the deal (i.e., size)
3627+-- This is available for Programmatic Guaranteed\/Preferred Deals in Ad
3628+-- Manager. \'OutputOnly
3629+dCreativeRestrictions :: Lens' Deal (Maybe CreativeRestrictions)
3630+dCreativeRestrictions
3631+ = lens _dCreativeRestrictions
3632+ (\ s a -> s{_dCreativeRestrictions = a})
3633+
3634+-- | The syndication product associated with the deal. Note: This field may
3635+-- be set only when creating the resource. Modifying this field while
3636+-- updating the resource will result in an error.
3637+dSyndicationProduct :: Lens' Deal (Maybe DealSyndicationProduct)
3638+dSyndicationProduct
3639+ = lens _dSyndicationProduct
3640+ (\ s a -> s{_dSyndicationProduct = a})
3641+
3642+-- | Optional revision number of the product that the deal was created from.
3643+-- If present on create, and the server \`product_revision\` has advanced
3644+-- sinced the passed-in \`create_product_revision\`, an \`ABORTED\` error
3645+-- will be returned. Note: This field may be set only when creating the
3646+-- resource. Modifying this field while updating the resource will result
3647+-- in an error.
3648+dCreateProductRevision :: Lens' Deal (Maybe Int64)
3649+dCreateProductRevision
3650+ = lens _dCreateProductRevision
3651+ (\ s a -> s{_dCreateProductRevision = a})
3652+ . mapping _Coerce
3653+
3654+-- | The time when the deal was last updated. \'OutputOnly
3655+dUpdateTime :: Lens' Deal (Maybe UTCTime)
3656+dUpdateTime
3657+ = lens _dUpdateTime (\ s a -> s{_dUpdateTime = a}) .
3658+ mapping _DateTime
3659+
3660+-- | The shared targeting visible to buyers and sellers. Each shared
3661+-- targeting entity is AND\'d together.
3662+dTargetingCriterion :: Lens' Deal [TargetingCriteria]
3663+dTargetingCriterion
3664+ = lens _dTargetingCriterion
3665+ (\ s a -> s{_dTargetingCriterion = a})
3666+ . _Default
3667+ . _Coerce
3668+
3669+-- | Seller contact information for the deal. \'OutputOnly
3670+dSellerContacts :: Lens' Deal [ContactInformation]
3671+dSellerContacts
3672+ = lens _dSellerContacts
3673+ (\ s a -> s{_dSellerContacts = a})
3674+ . _Default
3675+ . _Coerce
3676+
3677+-- | The product ID from which this deal was created. Note: This field may be
3678+-- set only when creating the resource. Modifying this field while updating
3679+-- the resource will result in an error.
3680+dCreateProductId :: Lens' Deal (Maybe Text)
3681+dCreateProductId
3682+ = lens _dCreateProductId
3683+ (\ s a -> s{_dCreateProductId = a})
3684+
3685+-- | The name of the deal.
3686+dDisplayName :: Lens' Deal (Maybe Text)
3687+dDisplayName
3688+ = lens _dDisplayName (\ s a -> s{_dDisplayName = a})
3689+
3690+-- | Specifies the creative source for programmatic deals. PUBLISHER means
3691+-- creative is provided by seller and ADVERTISER means creative is provided
3692+-- by buyer. \'OutputOnly
3693+dProgrammaticCreativeSource :: Lens' Deal (Maybe DealProgrammaticCreativeSource)
3694+dProgrammaticCreativeSource
3695+ = lens _dProgrammaticCreativeSource
3696+ (\ s a -> s{_dProgrammaticCreativeSource = a})
3697+
3698+-- | Proposed flight end time of the deal. This will generally be stored in a
3699+-- granularity of a second. A value is not required for Private Auction
3700+-- deals or Preferred Deals.
3701+dAvailableEndTime :: Lens' Deal (Maybe UTCTime)
3702+dAvailableEndTime
3703+ = lens _dAvailableEndTime
3704+ (\ s a -> s{_dAvailableEndTime = a})
3705+ . mapping _DateTime
3706+
3707+-- | Specifies the creative pre-approval policy. \'OutputOnly
3708+dCreativePreApprovalPolicy :: Lens' Deal (Maybe DealCreativePreApprovalPolicy)
3709+dCreativePreApprovalPolicy
3710+ = lens _dCreativePreApprovalPolicy
3711+ (\ s a -> s{_dCreativePreApprovalPolicy = a})
3712+
3713+-- | Description for the deal terms.
3714+dDescription :: Lens' Deal (Maybe Text)
3715+dDescription
3716+ = lens _dDescription (\ s a -> s{_dDescription = a})
3717+
3718+-- | The time of the deal creation. \'OutputOnly
3719+dCreateTime :: Lens' Deal (Maybe UTCTime)
3720+dCreateTime
3721+ = lens _dCreateTime (\ s a -> s{_dCreateTime = a}) .
3722+ mapping _DateTime
3723+
3724+-- | Specifies whether the creative is safeFrame compatible. \'OutputOnly
3725+dCreativeSafeFrameCompatibility :: Lens' Deal (Maybe DealCreativeSafeFrameCompatibility)
3726+dCreativeSafeFrameCompatibility
3727+ = lens _dCreativeSafeFrameCompatibility
3728+ (\ s a -> s{_dCreativeSafeFrameCompatibility = a})
3729+
3730+-- | The negotiable terms of the deal.
3731+dDealTerms :: Lens' Deal (Maybe DealTerms)
3732+dDealTerms
3733+ = lens _dDealTerms (\ s a -> s{_dDealTerms = a})
3734+
3735+instance FromJSON Deal where
3736+ parseJSON
3737+ = withObject "Deal"
3738+ (\ o ->
3739+ Deal' <$>
3740+ (o .:? "availableStartTime") <*>
3741+ (o .:? "externalDealId")
3742+ <*> (o .:? "buyerPrivateData")
3743+ <*> (o .:? "isSetupComplete")
3744+ <*> (o .:? "webPropertyCode")
3745+ <*> (o .:? "deliveryControl")
3746+ <*> (o .:? "dealServingMetadata")
3747+ <*> (o .:? "proposalId")
3748+ <*> (o .:? "targeting")
3749+ <*> (o .:? "dealId")
3750+ <*> (o .:? "creativeRestrictions")
3751+ <*> (o .:? "syndicationProduct")
3752+ <*> (o .:? "createProductRevision")
3753+ <*> (o .:? "updateTime")
3754+ <*> (o .:? "targetingCriterion" .!= mempty)
3755+ <*> (o .:? "sellerContacts" .!= mempty)
3756+ <*> (o .:? "createProductId")
3757+ <*> (o .:? "displayName")
3758+ <*> (o .:? "programmaticCreativeSource")
3759+ <*> (o .:? "availableEndTime")
3760+ <*> (o .:? "creativePreApprovalPolicy")
3761+ <*> (o .:? "description")
3762+ <*> (o .:? "createTime")
3763+ <*> (o .:? "creativeSafeFrameCompatibility")
3764+ <*> (o .:? "dealTerms"))
3765+
3766+instance ToJSON Deal where
3767+ toJSON Deal'{..}
3768+ = object
3769+ (catMaybes
3770+ [("availableStartTime" .=) <$> _dAvailableStartTime,
3771+ ("externalDealId" .=) <$> _dExternalDealId,
3772+ ("buyerPrivateData" .=) <$> _dBuyerPrivateData,
3773+ ("isSetupComplete" .=) <$> _dIsSetupComplete,
3774+ ("webPropertyCode" .=) <$> _dWebPropertyCode,
3775+ ("deliveryControl" .=) <$> _dDeliveryControl,
3776+ ("dealServingMetadata" .=) <$> _dDealServingMetadata,
3777+ ("proposalId" .=) <$> _dProposalId,
3778+ ("targeting" .=) <$> _dTargeting,
3779+ ("dealId" .=) <$> _dDealId,
3780+ ("creativeRestrictions" .=) <$>
3781+ _dCreativeRestrictions,
3782+ ("syndicationProduct" .=) <$> _dSyndicationProduct,
3783+ ("createProductRevision" .=) <$>
3784+ _dCreateProductRevision,
3785+ ("updateTime" .=) <$> _dUpdateTime,
3786+ ("targetingCriterion" .=) <$> _dTargetingCriterion,
3787+ ("sellerContacts" .=) <$> _dSellerContacts,
3788+ ("createProductId" .=) <$> _dCreateProductId,
3789+ ("displayName" .=) <$> _dDisplayName,
3790+ ("programmaticCreativeSource" .=) <$>
3791+ _dProgrammaticCreativeSource,
3792+ ("availableEndTime" .=) <$> _dAvailableEndTime,
3793+ ("creativePreApprovalPolicy" .=) <$>
3794+ _dCreativePreApprovalPolicy,
3795+ ("description" .=) <$> _dDescription,
3796+ ("createTime" .=) <$> _dCreateTime,
3797+ ("creativeSafeFrameCompatibility" .=) <$>
3798+ _dCreativeSafeFrameCompatibility,
3799+ ("dealTerms" .=) <$> _dDealTerms])
3800+
3801+-- | Represents creative restrictions associated to Programmatic Guaranteed\/
3802+-- Preferred Deal in Ad Manager. This doesn\'t apply to Private Auction and
3803+-- AdX Preferred Deals.
3804+--
3805+-- /See:/ 'creativeRestrictions' smart constructor.
3806+data CreativeRestrictions = CreativeRestrictions'
3807+ { _crCreativeFormat :: !(Maybe CreativeRestrictionsCreativeFormat)
3808+ , _crSkippableAdType :: !(Maybe CreativeRestrictionsSkippableAdType)
3809+ , _crCreativeSpecifications :: !(Maybe [CreativeSpecification])
3810+ } deriving (Eq,Show,Data,Typeable,Generic)
3811+
3812+-- | Creates a value of 'CreativeRestrictions' with the minimum fields required to make a request.
3813+--
3814+-- Use one of the following lenses to modify other fields as desired:
3815+--
3816+-- * 'crCreativeFormat'
3817+--
3818+-- * 'crSkippableAdType'
3819+--
3820+-- * 'crCreativeSpecifications'
3821+creativeRestrictions
3822+ :: CreativeRestrictions
3823+creativeRestrictions =
3824+ CreativeRestrictions'
3825+ { _crCreativeFormat = Nothing
3826+ , _crSkippableAdType = Nothing
3827+ , _crCreativeSpecifications = Nothing
3828+ }
3829+
3830+-- | The format of the environment that the creatives will be displayed in.
3831+crCreativeFormat :: Lens' CreativeRestrictions (Maybe CreativeRestrictionsCreativeFormat)
3832+crCreativeFormat
3833+ = lens _crCreativeFormat
3834+ (\ s a -> s{_crCreativeFormat = a})
3835+
3836+-- | Skippable video ads allow viewers to skip ads after 5 seconds.
3837+crSkippableAdType :: Lens' CreativeRestrictions (Maybe CreativeRestrictionsSkippableAdType)
3838+crSkippableAdType
3839+ = lens _crSkippableAdType
3840+ (\ s a -> s{_crSkippableAdType = a})
3841+
3842+crCreativeSpecifications :: Lens' CreativeRestrictions [CreativeSpecification]
3843+crCreativeSpecifications
3844+ = lens _crCreativeSpecifications
3845+ (\ s a -> s{_crCreativeSpecifications = a})
3846+ . _Default
3847+ . _Coerce
3848+
3849+instance FromJSON CreativeRestrictions where
3850+ parseJSON
3851+ = withObject "CreativeRestrictions"
3852+ (\ o ->
3853+ CreativeRestrictions' <$>
3854+ (o .:? "creativeFormat") <*>
3855+ (o .:? "skippableAdType")
3856+ <*> (o .:? "creativeSpecifications" .!= mempty))
3857+
3858+instance ToJSON CreativeRestrictions where
3859+ toJSON CreativeRestrictions'{..}
3860+ = object
3861+ (catMaybes
3862+ [("creativeFormat" .=) <$> _crCreativeFormat,
3863+ ("skippableAdType" .=) <$> _crSkippableAdType,
3864+ ("creativeSpecifications" .=) <$>
3865+ _crCreativeSpecifications])
3866+
3867+-- | Note: this resource requires whitelisting for access. Please contact
3868+-- your account manager for access to Marketplace resources. Represents a
3869+-- proposal in the Marketplace. A proposal is the unit of negotiation
3870+-- between a seller and a buyer and contains deals which are served. Note:
3871+-- you can not update, create, or otherwise modify Private Auction or
3872+-- Preferred Deals deals through the API. Fields are updatable unless noted
3873+-- otherwise.
3874+--
3875+-- /See:/ 'proposal' smart constructor.
3876+data Proposal = Proposal'
3877+ { _pBuyerPrivateData :: !(Maybe PrivateData)
3878+ , _pIsSetupComplete :: !(Maybe Bool)
3879+ , _pDeals :: !(Maybe [Deal])
3880+ , _pProposalRevision :: !(Maybe (Textual Int64))
3881+ , _pBuyerContacts :: !(Maybe [ContactInformation])
3882+ , _pOriginatorRole :: !(Maybe ProposalOriginatorRole)
3883+ , _pBilledBuyer :: !(Maybe Buyer)
3884+ , _pPrivateAuctionId :: !(Maybe Text)
3885+ , _pIsRenegotiating :: !(Maybe Bool)
3886+ , _pSeller :: !(Maybe Seller)
3887+ , _pProposalId :: !(Maybe Text)
3888+ , _pUpdateTime :: !(Maybe DateTime')
3889+ , _pSellerContacts :: !(Maybe [ContactInformation])
3890+ , _pDisplayName :: !(Maybe Text)
3891+ , _pNotes :: !(Maybe [Note])
3892+ , _pProposalState :: !(Maybe ProposalProposalState)
3893+ , _pLastUpdaterOrCommentorRole :: !(Maybe ProposalLastUpdaterOrCommentorRole)
3894+ , _pBuyer :: !(Maybe Buyer)
3895+ } deriving (Eq,Show,Data,Typeable,Generic)
3896+
3897+-- | Creates a value of 'Proposal' with the minimum fields required to make a request.
3898+--
3899+-- Use one of the following lenses to modify other fields as desired:
3900+--
3901+-- * 'pBuyerPrivateData'
3902+--
3903+-- * 'pIsSetupComplete'
3904+--
3905+-- * 'pDeals'
3906+--
3907+-- * 'pProposalRevision'
3908+--
3909+-- * 'pBuyerContacts'
3910+--
3911+-- * 'pOriginatorRole'
3912+--
3913+-- * 'pBilledBuyer'
3914+--
3915+-- * 'pPrivateAuctionId'
3916+--
3917+-- * 'pIsRenegotiating'
3918+--
3919+-- * 'pSeller'
3920+--
3921+-- * 'pProposalId'
3922+--
3923+-- * 'pUpdateTime'
3924+--
3925+-- * 'pSellerContacts'
3926+--
3927+-- * 'pDisplayName'
3928+--
3929+-- * 'pNotes'
3930+--
3931+-- * 'pProposalState'
3932+--
3933+-- * 'pLastUpdaterOrCommentorRole'
3934+--
3935+-- * 'pBuyer'
3936+proposal
3937+ :: Proposal
3938+proposal =
3939+ Proposal'
3940+ { _pBuyerPrivateData = Nothing
3941+ , _pIsSetupComplete = Nothing
3942+ , _pDeals = Nothing
3943+ , _pProposalRevision = Nothing
3944+ , _pBuyerContacts = Nothing
3945+ , _pOriginatorRole = Nothing
3946+ , _pBilledBuyer = Nothing
3947+ , _pPrivateAuctionId = Nothing
3948+ , _pIsRenegotiating = Nothing
3949+ , _pSeller = Nothing
3950+ , _pProposalId = Nothing
3951+ , _pUpdateTime = Nothing
3952+ , _pSellerContacts = Nothing
3953+ , _pDisplayName = Nothing
3954+ , _pNotes = Nothing
3955+ , _pProposalState = Nothing
3956+ , _pLastUpdaterOrCommentorRole = Nothing
3957+ , _pBuyer = Nothing
3958+ }
3959+
3960+-- | Private data for buyer. (hidden from seller).
3961+pBuyerPrivateData :: Lens' Proposal (Maybe PrivateData)
3962+pBuyerPrivateData
3963+ = lens _pBuyerPrivateData
3964+ (\ s a -> s{_pBuyerPrivateData = a})
3965+
3966+-- | True, if the buyside inventory setup is complete for this proposal.
3967+-- \'OutputOnly
3968+pIsSetupComplete :: Lens' Proposal (Maybe Bool)
3969+pIsSetupComplete
3970+ = lens _pIsSetupComplete
3971+ (\ s a -> s{_pIsSetupComplete = a})
3972+
3973+-- | The deals associated with this proposal. For Private Auction proposals
3974+-- (whose deals have NonGuaranteedAuctionTerms), there will only be one
3975+-- deal.
3976+pDeals :: Lens' Proposal [Deal]
3977+pDeals
3978+ = lens _pDeals (\ s a -> s{_pDeals = a}) . _Default .
3979+ _Coerce
3980+
3981+-- | The revision number for the proposal. Each update to the proposal or the
3982+-- deal causes the proposal revision number to auto-increment. The buyer
3983+-- keeps track of the last revision number they know of and pass it in when
3984+-- making an update. If the head revision number on the server has since
3985+-- incremented, then an ABORTED error is returned during the update
3986+-- operation to let the buyer know that a subsequent update was made.
3987+-- \'OutputOnly
3988+pProposalRevision :: Lens' Proposal (Maybe Int64)
3989+pProposalRevision
3990+ = lens _pProposalRevision
3991+ (\ s a -> s{_pProposalRevision = a})
3992+ . mapping _Coerce
3993+
3994+-- | Contact information for the buyer.
3995+pBuyerContacts :: Lens' Proposal [ContactInformation]
3996+pBuyerContacts
3997+ = lens _pBuyerContacts
3998+ (\ s a -> s{_pBuyerContacts = a})
3999+ . _Default
4000+ . _Coerce
4001+
4002+-- | Indicates whether the buyer\/seller created the proposal. \'OutputOnly
4003+pOriginatorRole :: Lens' Proposal (Maybe ProposalOriginatorRole)
4004+pOriginatorRole
4005+ = lens _pOriginatorRole
4006+ (\ s a -> s{_pOriginatorRole = a})
4007+
4008+-- | Reference to the buyer that will get billed for this proposal.
4009+-- \'OutputOnly
4010+pBilledBuyer :: Lens' Proposal (Maybe Buyer)
4011+pBilledBuyer
4012+ = lens _pBilledBuyer (\ s a -> s{_pBilledBuyer = a})
4013+
4014+-- | Private auction ID if this proposal is a private auction proposal.
4015+-- \'OutputOnly
4016+pPrivateAuctionId :: Lens' Proposal (Maybe Text)
4017+pPrivateAuctionId
4018+ = lens _pPrivateAuctionId
4019+ (\ s a -> s{_pPrivateAuctionId = a})
4020+
4021+-- | True if the proposal is being renegotiated. \'OutputOnly
4022+pIsRenegotiating :: Lens' Proposal (Maybe Bool)
4023+pIsRenegotiating
4024+ = lens _pIsRenegotiating
4025+ (\ s a -> s{_pIsRenegotiating = a})
4026+
4027+-- | Reference to the seller on the proposal. Note: This field may be set
4028+-- only when creating the resource. Modifying this field while updating the
4029+-- resource will result in an error.
4030+pSeller :: Lens' Proposal (Maybe Seller)
4031+pSeller = lens _pSeller (\ s a -> s{_pSeller = a})
4032+
4033+-- | The unique ID of the proposal. \'OutputOnly
4034+pProposalId :: Lens' Proposal (Maybe Text)
4035+pProposalId
4036+ = lens _pProposalId (\ s a -> s{_pProposalId = a})
4037+
4038+-- | The time when the proposal was last revised. \'OutputOnly
4039+pUpdateTime :: Lens' Proposal (Maybe UTCTime)
4040+pUpdateTime
4041+ = lens _pUpdateTime (\ s a -> s{_pUpdateTime = a}) .
4042+ mapping _DateTime
4043+
4044+-- | Contact information for the seller. \'OutputOnly
4045+pSellerContacts :: Lens' Proposal [ContactInformation]
4046+pSellerContacts
4047+ = lens _pSellerContacts
4048+ (\ s a -> s{_pSellerContacts = a})
4049+ . _Default
4050+ . _Coerce
4051+
4052+-- | The name for the proposal.
4053+pDisplayName :: Lens' Proposal (Maybe Text)
4054+pDisplayName
4055+ = lens _pDisplayName (\ s a -> s{_pDisplayName = a})
4056+
4057+-- | The notes associated with this proposal. \'OutputOnly
4058+pNotes :: Lens' Proposal [Note]
4059+pNotes
4060+ = lens _pNotes (\ s a -> s{_pNotes = a}) . _Default .
4061+ _Coerce
4062+
4063+-- | The current state of the proposal. \'OutputOnly
4064+pProposalState :: Lens' Proposal (Maybe ProposalProposalState)
4065+pProposalState
4066+ = lens _pProposalState
4067+ (\ s a -> s{_pProposalState = a})
4068+
4069+-- | The role of the last user that either updated the proposal or left a
4070+-- comment. \'OutputOnly
4071+pLastUpdaterOrCommentorRole :: Lens' Proposal (Maybe ProposalLastUpdaterOrCommentorRole)
4072+pLastUpdaterOrCommentorRole
4073+ = lens _pLastUpdaterOrCommentorRole
4074+ (\ s a -> s{_pLastUpdaterOrCommentorRole = a})
4075+
4076+-- | Reference to the buyer on the proposal. Note: This field may be set only
4077+-- when creating the resource. Modifying this field while updating the
4078+-- resource will result in an error.
4079+pBuyer :: Lens' Proposal (Maybe Buyer)
4080+pBuyer = lens _pBuyer (\ s a -> s{_pBuyer = a})
4081+
4082+instance FromJSON Proposal where
4083+ parseJSON
4084+ = withObject "Proposal"
4085+ (\ o ->
4086+ Proposal' <$>
4087+ (o .:? "buyerPrivateData") <*>
4088+ (o .:? "isSetupComplete")
4089+ <*> (o .:? "deals" .!= mempty)
4090+ <*> (o .:? "proposalRevision")
4091+ <*> (o .:? "buyerContacts" .!= mempty)
4092+ <*> (o .:? "originatorRole")
4093+ <*> (o .:? "billedBuyer")
4094+ <*> (o .:? "privateAuctionId")
4095+ <*> (o .:? "isRenegotiating")
4096+ <*> (o .:? "seller")
4097+ <*> (o .:? "proposalId")
4098+ <*> (o .:? "updateTime")
4099+ <*> (o .:? "sellerContacts" .!= mempty)
4100+ <*> (o .:? "displayName")
4101+ <*> (o .:? "notes" .!= mempty)
4102+ <*> (o .:? "proposalState")
4103+ <*> (o .:? "lastUpdaterOrCommentorRole")
4104+ <*> (o .:? "buyer"))
4105+
4106+instance ToJSON Proposal where
4107+ toJSON Proposal'{..}
4108+ = object
4109+ (catMaybes
4110+ [("buyerPrivateData" .=) <$> _pBuyerPrivateData,
4111+ ("isSetupComplete" .=) <$> _pIsSetupComplete,
4112+ ("deals" .=) <$> _pDeals,
4113+ ("proposalRevision" .=) <$> _pProposalRevision,
4114+ ("buyerContacts" .=) <$> _pBuyerContacts,
4115+ ("originatorRole" .=) <$> _pOriginatorRole,
4116+ ("billedBuyer" .=) <$> _pBilledBuyer,
4117+ ("privateAuctionId" .=) <$> _pPrivateAuctionId,
4118+ ("isRenegotiating" .=) <$> _pIsRenegotiating,
4119+ ("seller" .=) <$> _pSeller,
4120+ ("proposalId" .=) <$> _pProposalId,
4121+ ("updateTime" .=) <$> _pUpdateTime,
4122+ ("sellerContacts" .=) <$> _pSellerContacts,
4123+ ("displayName" .=) <$> _pDisplayName,
4124+ ("notes" .=) <$> _pNotes,
4125+ ("proposalState" .=) <$> _pProposalState,
4126+ ("lastUpdaterOrCommentorRole" .=) <$>
4127+ _pLastUpdaterOrCommentorRole,
4128+ ("buyer" .=) <$> _pBuyer])
4129+
4130+-- | A relative date range, specified by an offset and a duration. The
4131+-- supported range of dates begins 30 days before today and ends today,
4132+-- i.e., the limits for these values are: offset_days >= 0 duration_days >=
4133+-- 1 offset_days + duration_days \<= 30
4134+--
4135+-- /See:/ 'relativeDateRange' smart constructor.
4136+data RelativeDateRange = RelativeDateRange'
4137+ { _rdrOffSetDays :: !(Maybe (Textual Int32))
4138+ , _rdrDurationDays :: !(Maybe (Textual Int32))
4139+ } deriving (Eq,Show,Data,Typeable,Generic)
4140+
4141+-- | Creates a value of 'RelativeDateRange' with the minimum fields required to make a request.
4142+--
4143+-- Use one of the following lenses to modify other fields as desired:
4144+--
4145+-- * 'rdrOffSetDays'
4146+--
4147+-- * 'rdrDurationDays'
4148+relativeDateRange
4149+ :: RelativeDateRange
4150+relativeDateRange =
4151+ RelativeDateRange'
4152+ { _rdrOffSetDays = Nothing
4153+ , _rdrDurationDays = Nothing
4154+ }
4155+
4156+-- | The end date of the filter set, specified as the number of days before
4157+-- today, e.g., for a range where the last date is today: 0.
4158+rdrOffSetDays :: Lens' RelativeDateRange (Maybe Int32)
4159+rdrOffSetDays
4160+ = lens _rdrOffSetDays
4161+ (\ s a -> s{_rdrOffSetDays = a})
4162+ . mapping _Coerce
4163+
4164+-- | The number of days in the requested date range, e.g., for a range
4165+-- spanning today: 1. For a range spanning the last 7 days: 7.
4166+rdrDurationDays :: Lens' RelativeDateRange (Maybe Int32)
4167+rdrDurationDays
4168+ = lens _rdrDurationDays
4169+ (\ s a -> s{_rdrDurationDays = a})
4170+ . mapping _Coerce
4171+
4172+instance FromJSON RelativeDateRange where
4173+ parseJSON
4174+ = withObject "RelativeDateRange"
4175+ (\ o ->
4176+ RelativeDateRange' <$>
4177+ (o .:? "offsetDays") <*> (o .:? "durationDays"))
4178+
4179+instance ToJSON RelativeDateRange where
4180+ toJSON RelativeDateRange'{..}
4181+ = object
4182+ (catMaybes
4183+ [("offsetDays" .=) <$> _rdrOffSetDays,
4184+ ("durationDays" .=) <$> _rdrDurationDays])
4185+
4186+-- | Request message to pause serving for an already-finalized proposal.
4187+--
4188+-- /See:/ 'pauseProposalRequest' smart constructor.
4189+newtype PauseProposalRequest = PauseProposalRequest'
4190+ { _pprReason :: Maybe Text
4191+ } deriving (Eq,Show,Data,Typeable,Generic)
4192+
4193+-- | Creates a value of 'PauseProposalRequest' with the minimum fields required to make a request.
4194+--
4195+-- Use one of the following lenses to modify other fields as desired:
4196+--
4197+-- * 'pprReason'
4198+pauseProposalRequest
4199+ :: PauseProposalRequest
4200+pauseProposalRequest =
4201+ PauseProposalRequest'
4202+ { _pprReason = Nothing
4203+ }
4204+
4205+-- | The reason why the proposal is being paused. This human readable message
4206+-- will be displayed in the seller\'s UI. (Max length: 100 unicode code
4207+-- units.)
4208+pprReason :: Lens' PauseProposalRequest (Maybe Text)
4209+pprReason
4210+ = lens _pprReason (\ s a -> s{_pprReason = a})
4211+
4212+instance FromJSON PauseProposalRequest where
4213+ parseJSON
4214+ = withObject "PauseProposalRequest"
4215+ (\ o -> PauseProposalRequest' <$> (o .:? "reason"))
4216+
4217+instance ToJSON PauseProposalRequest where
4218+ toJSON PauseProposalRequest'{..}
4219+ = object (catMaybes [("reason" .=) <$> _pprReason])
4220+
4221+-- | Represents a list of targeted and excluded mobile application IDs that
4222+-- publishers own. Mobile application IDs are from App Store and Google
4223+-- Play Store. Android App ID, for example, com.google.android.apps.maps,
4224+-- can be found in Google Play Store URL. iOS App ID (which is a number)
4225+-- can be found at the end of iTunes store URL. First party mobile
4226+-- applications is either included or excluded.
4227+--
4228+-- /See:/ 'firstPartyMobileApplicationTargeting' smart constructor.
4229+data FirstPartyMobileApplicationTargeting = FirstPartyMobileApplicationTargeting'
4230+ { _fpmatTargetedAppIds :: !(Maybe [Text])
4231+ , _fpmatExcludedAppIds :: !(Maybe [Text])
4232+ } deriving (Eq,Show,Data,Typeable,Generic)
4233+
4234+-- | Creates a value of 'FirstPartyMobileApplicationTargeting' with the minimum fields required to make a request.
4235+--
4236+-- Use one of the following lenses to modify other fields as desired:
4237+--
4238+-- * 'fpmatTargetedAppIds'
4239+--
4240+-- * 'fpmatExcludedAppIds'
4241+firstPartyMobileApplicationTargeting
4242+ :: FirstPartyMobileApplicationTargeting
4243+firstPartyMobileApplicationTargeting =
4244+ FirstPartyMobileApplicationTargeting'
4245+ { _fpmatTargetedAppIds = Nothing
4246+ , _fpmatExcludedAppIds = Nothing
4247+ }
4248+
4249+-- | A list of application IDs to be included.
4250+fpmatTargetedAppIds :: Lens' FirstPartyMobileApplicationTargeting [Text]
4251+fpmatTargetedAppIds
4252+ = lens _fpmatTargetedAppIds
4253+ (\ s a -> s{_fpmatTargetedAppIds = a})
4254+ . _Default
4255+ . _Coerce
4256+
4257+-- | A list of application IDs to be excluded.
4258+fpmatExcludedAppIds :: Lens' FirstPartyMobileApplicationTargeting [Text]
4259+fpmatExcludedAppIds
4260+ = lens _fpmatExcludedAppIds
4261+ (\ s a -> s{_fpmatExcludedAppIds = a})
4262+ . _Default
4263+ . _Coerce
4264+
4265+instance FromJSON
4266+ FirstPartyMobileApplicationTargeting where
4267+ parseJSON
4268+ = withObject "FirstPartyMobileApplicationTargeting"
4269+ (\ o ->
4270+ FirstPartyMobileApplicationTargeting' <$>
4271+ (o .:? "targetedAppIds" .!= mempty) <*>
4272+ (o .:? "excludedAppIds" .!= mempty))
4273+
4274+instance ToJSON FirstPartyMobileApplicationTargeting
4275+ where
4276+ toJSON FirstPartyMobileApplicationTargeting'{..}
4277+ = object
4278+ (catMaybes
4279+ [("targetedAppIds" .=) <$> _fpmatTargetedAppIds,
4280+ ("excludedAppIds" .=) <$> _fpmatExcludedAppIds])
4281+
4282+-- | A metric value, with an expected value and a variance; represents a
4283+-- count that may be either exact or estimated (i.e. when sampled).
4284+--
4285+-- /See:/ 'metricValue' smart constructor.
4286+data MetricValue = MetricValue'
4287+ { _mvValue :: !(Maybe (Textual Int64))
4288+ , _mvVariance :: !(Maybe (Textual Int64))
4289+ } deriving (Eq,Show,Data,Typeable,Generic)
4290+
4291+-- | Creates a value of 'MetricValue' with the minimum fields required to make a request.
4292+--
4293+-- Use one of the following lenses to modify other fields as desired:
4294+--
4295+-- * 'mvValue'
4296+--
4297+-- * 'mvVariance'
4298+metricValue
4299+ :: MetricValue
4300+metricValue =
4301+ MetricValue'
4302+ { _mvValue = Nothing
4303+ , _mvVariance = Nothing
4304+ }
4305+
4306+-- | The expected value of the metric.
4307+mvValue :: Lens' MetricValue (Maybe Int64)
4308+mvValue
4309+ = lens _mvValue (\ s a -> s{_mvValue = a}) .
4310+ mapping _Coerce
4311+
4312+-- | The variance (i.e. square of the standard deviation) of the metric
4313+-- value. If value is exact, variance is 0. Can be used to calculate margin
4314+-- of error as a percentage of value, using the following formula, where Z
4315+-- is the standard constant that depends on the desired size of the
4316+-- confidence interval (e.g. for 90% confidence interval, use Z = 1.645):
4317+-- marginOfError = 100 * Z * sqrt(variance) \/ value
4318+mvVariance :: Lens' MetricValue (Maybe Int64)
4319+mvVariance
4320+ = lens _mvVariance (\ s a -> s{_mvVariance = a}) .
4321+ mapping _Coerce
4322+
4323+instance FromJSON MetricValue where
4324+ parseJSON
4325+ = withObject "MetricValue"
4326+ (\ o ->
4327+ MetricValue' <$>
4328+ (o .:? "value") <*> (o .:? "variance"))
4329+
4330+instance ToJSON MetricValue where
4331+ toJSON MetricValue'{..}
4332+ = object
4333+ (catMaybes
4334+ [("value" .=) <$> _mvValue,
4335+ ("variance" .=) <$> _mvVariance])
4336+
4337+-- | Request message for indicating that the proposal\'s setup step is
4338+-- complete.
4339+--
4340+-- /See:/ 'completeSetupRequest' smart constructor.
4341+data CompleteSetupRequest =
4342+ CompleteSetupRequest'
4343+ deriving (Eq,Show,Data,Typeable,Generic)
4344+
4345+-- | Creates a value of 'CompleteSetupRequest' with the minimum fields required to make a request.
4346+--
4347+completeSetupRequest
4348+ :: CompleteSetupRequest
4349+completeSetupRequest = CompleteSetupRequest'
4350+
4351+instance FromJSON CompleteSetupRequest where
4352+ parseJSON
4353+ = withObject "CompleteSetupRequest"
4354+ (\ o -> pure CompleteSetupRequest')
4355+
4356+instance ToJSON CompleteSetupRequest where
4357+ toJSON = const emptyObject
4358+
4359+-- | The number of filtered bids with the specified dimension values that
4360+-- have the specified creative.
4361+--
4362+-- /See:/ 'filteredBidCreativeRow' smart constructor.
4363+data FilteredBidCreativeRow = FilteredBidCreativeRow'
4364+ { _fbcrCreativeId :: !(Maybe Text)
4365+ , _fbcrRowDimensions :: !(Maybe RowDimensions)
4366+ , _fbcrBidCount :: !(Maybe MetricValue)
4367+ } deriving (Eq,Show,Data,Typeable,Generic)
4368+
4369+-- | Creates a value of 'FilteredBidCreativeRow' with the minimum fields required to make a request.
4370+--
4371+-- Use one of the following lenses to modify other fields as desired:
4372+--
4373+-- * 'fbcrCreativeId'
4374+--
4375+-- * 'fbcrRowDimensions'
4376+--
4377+-- * 'fbcrBidCount'
4378+filteredBidCreativeRow
4379+ :: FilteredBidCreativeRow
4380+filteredBidCreativeRow =
4381+ FilteredBidCreativeRow'
4382+ { _fbcrCreativeId = Nothing
4383+ , _fbcrRowDimensions = Nothing
4384+ , _fbcrBidCount = Nothing
4385+ }
4386+
4387+-- | The ID of the creative.
4388+fbcrCreativeId :: Lens' FilteredBidCreativeRow (Maybe Text)
4389+fbcrCreativeId
4390+ = lens _fbcrCreativeId
4391+ (\ s a -> s{_fbcrCreativeId = a})
4392+
4393+-- | The values of all dimensions associated with metric values in this row.
4394+fbcrRowDimensions :: Lens' FilteredBidCreativeRow (Maybe RowDimensions)
4395+fbcrRowDimensions
4396+ = lens _fbcrRowDimensions
4397+ (\ s a -> s{_fbcrRowDimensions = a})
4398+
4399+-- | The number of bids with the specified creative.
4400+fbcrBidCount :: Lens' FilteredBidCreativeRow (Maybe MetricValue)
4401+fbcrBidCount
4402+ = lens _fbcrBidCount (\ s a -> s{_fbcrBidCount = a})
4403+
4404+instance FromJSON FilteredBidCreativeRow where
4405+ parseJSON
4406+ = withObject "FilteredBidCreativeRow"
4407+ (\ o ->
4408+ FilteredBidCreativeRow' <$>
4409+ (o .:? "creativeId") <*> (o .:? "rowDimensions") <*>
4410+ (o .:? "bidCount"))
4411+
4412+instance ToJSON FilteredBidCreativeRow where
4413+ toJSON FilteredBidCreativeRow'{..}
4414+ = object
4415+ (catMaybes
4416+ [("creativeId" .=) <$> _fbcrCreativeId,
4417+ ("rowDimensions" .=) <$> _fbcrRowDimensions,
4418+ ("bidCount" .=) <$> _fbcrBidCount])
4419+
4420+-- | \'OutputOnly The Geo criteria the restriction applies to.
4421+--
4422+-- /See:/ 'locationContext' smart constructor.
4423+newtype LocationContext = LocationContext'
4424+ { _lcGeoCriteriaIds :: Maybe [Textual Int32]
4425+ } deriving (Eq,Show,Data,Typeable,Generic)
4426+
4427+-- | Creates a value of 'LocationContext' with the minimum fields required to make a request.
4428+--
4429+-- Use one of the following lenses to modify other fields as desired:
4430+--
4431+-- * 'lcGeoCriteriaIds'
4432+locationContext
4433+ :: LocationContext
4434+locationContext =
4435+ LocationContext'
4436+ { _lcGeoCriteriaIds = Nothing
4437+ }
4438+
4439+-- | IDs representing the geo location for this context. Please refer to the
4440+-- [geo-table.csv](https:\/\/storage.googleapis.com\/adx-rtb-dictionaries\/geo-table.csv)
4441+-- file for different geo criteria IDs.
4442+lcGeoCriteriaIds :: Lens' LocationContext [Int32]
4443+lcGeoCriteriaIds
4444+ = lens _lcGeoCriteriaIds
4445+ (\ s a -> s{_lcGeoCriteriaIds = a})
4446+ . _Default
4447+ . _Coerce
4448+
4449+instance FromJSON LocationContext where
4450+ parseJSON
4451+ = withObject "LocationContext"
4452+ (\ o ->
4453+ LocationContext' <$>
4454+ (o .:? "geoCriteriaIds" .!= mempty))
4455+
4456+instance ToJSON LocationContext where
4457+ toJSON LocationContext'{..}
4458+ = object
4459+ (catMaybes
4460+ [("geoCriteriaIds" .=) <$> _lcGeoCriteriaIds])
4461+
4462+-- | Advertisers can target different attributes of an ad slot. For example,
4463+-- they can choose to show ads only if the user is in the U.S. Such
4464+-- targeting criteria can be specified as part of Shared Targeting.
4465+--
4466+-- /See:/ 'targetingCriteria' smart constructor.
4467+data TargetingCriteria = TargetingCriteria'
4468+ { _tcKey :: !(Maybe Text)
4469+ , _tcExclusions :: !(Maybe [TargetingValue])
4470+ , _tcInclusions :: !(Maybe [TargetingValue])
4471+ } deriving (Eq,Show,Data,Typeable,Generic)
4472+
4473+-- | Creates a value of 'TargetingCriteria' with the minimum fields required to make a request.
4474+--
4475+-- Use one of the following lenses to modify other fields as desired:
4476+--
4477+-- * 'tcKey'
4478+--
4479+-- * 'tcExclusions'
4480+--
4481+-- * 'tcInclusions'
4482+targetingCriteria
4483+ :: TargetingCriteria
4484+targetingCriteria =
4485+ TargetingCriteria'
4486+ { _tcKey = Nothing
4487+ , _tcExclusions = Nothing
4488+ , _tcInclusions = Nothing
4489+ }
4490+
4491+-- | The key representing the shared targeting criterion. Targeting criteria
4492+-- defined by Google ad servers will begin with GOOG_. Third parties may
4493+-- define their own keys. A list of permissible keys along with the
4494+-- acceptable values will be provided as part of the external
4495+-- documentation.
4496+tcKey :: Lens' TargetingCriteria (Maybe Text)
4497+tcKey = lens _tcKey (\ s a -> s{_tcKey = a})
4498+
4499+-- | The list of values to exclude from targeting. Each value is AND\'d
4500+-- together.
4501+tcExclusions :: Lens' TargetingCriteria [TargetingValue]
4502+tcExclusions
4503+ = lens _tcExclusions (\ s a -> s{_tcExclusions = a})
4504+ . _Default
4505+ . _Coerce
4506+
4507+-- | The list of value to include as part of the targeting. Each value is
4508+-- OR\'d together.
4509+tcInclusions :: Lens' TargetingCriteria [TargetingValue]
4510+tcInclusions
4511+ = lens _tcInclusions (\ s a -> s{_tcInclusions = a})
4512+ . _Default
4513+ . _Coerce
4514+
4515+instance FromJSON TargetingCriteria where
4516+ parseJSON
4517+ = withObject "TargetingCriteria"
4518+ (\ o ->
4519+ TargetingCriteria' <$>
4520+ (o .:? "key") <*> (o .:? "exclusions" .!= mempty) <*>
4521+ (o .:? "inclusions" .!= mempty))
4522+
4523+instance ToJSON TargetingCriteria where
4524+ toJSON TargetingCriteria'{..}
4525+ = object
4526+ (catMaybes
4527+ [("key" .=) <$> _tcKey,
4528+ ("exclusions" .=) <$> _tcExclusions,
4529+ ("inclusions" .=) <$> _tcInclusions])
4530+
4531+-- | The number of impressions with the specified dimension values where the
4532+-- corresponding bid request or bid response was not successful, as
4533+-- described by the specified callout status.
4534+--
4535+-- /See:/ 'calloutStatusRow' smart constructor.
4536+data CalloutStatusRow = CalloutStatusRow'
4537+ { _cRowDimensions :: !(Maybe RowDimensions)
4538+ , _cCalloutStatusId :: !(Maybe (Textual Int32))
4539+ , _cImpressionCount :: !(Maybe MetricValue)
4540+ } deriving (Eq,Show,Data,Typeable,Generic)
4541+
4542+-- | Creates a value of 'CalloutStatusRow' with the minimum fields required to make a request.
4543+--
4544+-- Use one of the following lenses to modify other fields as desired:
4545+--
4546+-- * 'cRowDimensions'
4547+--
4548+-- * 'cCalloutStatusId'
4549+--
4550+-- * 'cImpressionCount'
4551+calloutStatusRow
4552+ :: CalloutStatusRow
4553+calloutStatusRow =
4554+ CalloutStatusRow'
4555+ { _cRowDimensions = Nothing
4556+ , _cCalloutStatusId = Nothing
4557+ , _cImpressionCount = Nothing
4558+ }
4559+
4560+-- | The values of all dimensions associated with metric values in this row.
4561+cRowDimensions :: Lens' CalloutStatusRow (Maybe RowDimensions)
4562+cRowDimensions
4563+ = lens _cRowDimensions
4564+ (\ s a -> s{_cRowDimensions = a})
4565+
4566+-- | The ID of the callout status. See
4567+-- [callout-status-codes](https:\/\/developers.google.com\/authorized-buyers\/rtb\/downloads\/callout-status-codes).
4568+cCalloutStatusId :: Lens' CalloutStatusRow (Maybe Int32)
4569+cCalloutStatusId
4570+ = lens _cCalloutStatusId
4571+ (\ s a -> s{_cCalloutStatusId = a})
4572+ . mapping _Coerce
4573+
4574+-- | The number of impressions for which there was a bid request or bid
4575+-- response with the specified callout status.
4576+cImpressionCount :: Lens' CalloutStatusRow (Maybe MetricValue)
4577+cImpressionCount
4578+ = lens _cImpressionCount
4579+ (\ s a -> s{_cImpressionCount = a})
4580+
4581+instance FromJSON CalloutStatusRow where
4582+ parseJSON
4583+ = withObject "CalloutStatusRow"
4584+ (\ o ->
4585+ CalloutStatusRow' <$>
4586+ (o .:? "rowDimensions") <*> (o .:? "calloutStatusId")
4587+ <*> (o .:? "impressionCount"))
4588+
4589+instance ToJSON CalloutStatusRow where
4590+ toJSON CalloutStatusRow'{..}
4591+ = object
4592+ (catMaybes
4593+ [("rowDimensions" .=) <$> _cRowDimensions,
4594+ ("calloutStatusId" .=) <$> _cCalloutStatusId,
4595+ ("impressionCount" .=) <$> _cImpressionCount])
4596+
4597+-- | Represents a list of targeted and excluded URLs (e.g., google.com). For
4598+-- Private Auction and AdX Preferred Deals, URLs are either included or
4599+-- excluded. For Programmatic Guaranteed and Preferred Deals, this doesn\'t
4600+-- apply.
4601+--
4602+-- /See:/ 'urlTargeting' smart constructor.
4603+data URLTargeting = URLTargeting'
4604+ { _utTargetedURLs :: !(Maybe [Text])
4605+ , _utExcludedURLs :: !(Maybe [Text])
4606+ } deriving (Eq,Show,Data,Typeable,Generic)
4607+
4608+-- | Creates a value of 'URLTargeting' with the minimum fields required to make a request.
4609+--
4610+-- Use one of the following lenses to modify other fields as desired:
4611+--
4612+-- * 'utTargetedURLs'
4613+--
4614+-- * 'utExcludedURLs'
4615+urlTargeting
4616+ :: URLTargeting
4617+urlTargeting =
4618+ URLTargeting'
4619+ { _utTargetedURLs = Nothing
4620+ , _utExcludedURLs = Nothing
4621+ }
4622+
4623+-- | A list of URLs to be included.
4624+utTargetedURLs :: Lens' URLTargeting [Text]
4625+utTargetedURLs
4626+ = lens _utTargetedURLs
4627+ (\ s a -> s{_utTargetedURLs = a})
4628+ . _Default
4629+ . _Coerce
4630+
4631+-- | A list of URLs to be excluded.
4632+utExcludedURLs :: Lens' URLTargeting [Text]
4633+utExcludedURLs
4634+ = lens _utExcludedURLs
4635+ (\ s a -> s{_utExcludedURLs = a})
4636+ . _Default
4637+ . _Coerce
4638+
4639+instance FromJSON URLTargeting where
4640+ parseJSON
4641+ = withObject "URLTargeting"
4642+ (\ o ->
4643+ URLTargeting' <$>
4644+ (o .:? "targetedUrls" .!= mempty) <*>
4645+ (o .:? "excludedUrls" .!= mempty))
4646+
4647+instance ToJSON URLTargeting where
4648+ toJSON URLTargeting'{..}
4649+ = object
4650+ (catMaybes
4651+ [("targetedUrls" .=) <$> _utTargetedURLs,
4652+ ("excludedUrls" .=) <$> _utExcludedURLs])
4653+
4654+-- | The number of impressions with the specified dimension values that were
4655+-- considered to have no applicable bids, as described by the specified
4656+-- status.
4657+--
4658+-- /See:/ 'bidResponseWithoutBidsStatusRow' smart constructor.
4659+data BidResponseWithoutBidsStatusRow = BidResponseWithoutBidsStatusRow'
4660+ { _brwbsrStatus :: !(Maybe BidResponseWithoutBidsStatusRowStatus)
4661+ , _brwbsrRowDimensions :: !(Maybe RowDimensions)
4662+ , _brwbsrImpressionCount :: !(Maybe MetricValue)
4663+ } deriving (Eq,Show,Data,Typeable,Generic)
4664+
4665+-- | Creates a value of 'BidResponseWithoutBidsStatusRow' with the minimum fields required to make a request.
4666+--
4667+-- Use one of the following lenses to modify other fields as desired:
4668+--
4669+-- * 'brwbsrStatus'
4670+--
4671+-- * 'brwbsrRowDimensions'
4672+--
4673+-- * 'brwbsrImpressionCount'
4674+bidResponseWithoutBidsStatusRow
4675+ :: BidResponseWithoutBidsStatusRow
4676+bidResponseWithoutBidsStatusRow =
4677+ BidResponseWithoutBidsStatusRow'
4678+ { _brwbsrStatus = Nothing
4679+ , _brwbsrRowDimensions = Nothing
4680+ , _brwbsrImpressionCount = Nothing
4681+ }
4682+
4683+-- | The status specifying why the bid responses were considered to have no
4684+-- applicable bids.
4685+brwbsrStatus :: Lens' BidResponseWithoutBidsStatusRow (Maybe BidResponseWithoutBidsStatusRowStatus)
4686+brwbsrStatus
4687+ = lens _brwbsrStatus (\ s a -> s{_brwbsrStatus = a})
4688+
4689+-- | The values of all dimensions associated with metric values in this row.
4690+brwbsrRowDimensions :: Lens' BidResponseWithoutBidsStatusRow (Maybe RowDimensions)
4691+brwbsrRowDimensions
4692+ = lens _brwbsrRowDimensions
4693+ (\ s a -> s{_brwbsrRowDimensions = a})
4694+
4695+-- | The number of impressions for which there was a bid response with the
4696+-- specified status.
4697+brwbsrImpressionCount :: Lens' BidResponseWithoutBidsStatusRow (Maybe MetricValue)
4698+brwbsrImpressionCount
4699+ = lens _brwbsrImpressionCount
4700+ (\ s a -> s{_brwbsrImpressionCount = a})
4701+
4702+instance FromJSON BidResponseWithoutBidsStatusRow
4703+ where
4704+ parseJSON
4705+ = withObject "BidResponseWithoutBidsStatusRow"
4706+ (\ o ->
4707+ BidResponseWithoutBidsStatusRow' <$>
4708+ (o .:? "status") <*> (o .:? "rowDimensions") <*>
4709+ (o .:? "impressionCount"))
4710+
4711+instance ToJSON BidResponseWithoutBidsStatusRow where
4712+ toJSON BidResponseWithoutBidsStatusRow'{..}
4713+ = object
4714+ (catMaybes
4715+ [("status" .=) <$> _brwbsrStatus,
4716+ ("rowDimensions" .=) <$> _brwbsrRowDimensions,
4717+ ("impressionCount" .=) <$> _brwbsrImpressionCount])
4718+
4719+-- | A set of filters that is applied to a request for data. Within a filter
4720+-- set, an AND operation is performed across the filters represented by
4721+-- each field. An OR operation is performed across the filters represented
4722+-- by the multiple values of a repeated field, e.g., \"format=VIDEO AND
4723+-- deal_id=12 AND (seller_network_id=34 OR seller_network_id=56)\".
4724+--
4725+-- /See:/ 'filterSet' smart constructor.
4726+data FilterSet = FilterSet'
4727+ { _fsPlatforms :: !(Maybe [Text])
4728+ , _fsRealtimeTimeRange :: !(Maybe RealtimeTimeRange)
4729+ , _fsEnvironment :: !(Maybe FilterSetEnvironment)
4730+ , _fsFormats :: !(Maybe [Text])
4731+ , _fsCreativeId :: !(Maybe Text)
4732+ , _fsBreakdownDimensions :: !(Maybe [Text])
4733+ , _fsSellerNetworkIds :: !(Maybe [Textual Int32])
4734+ , _fsDealId :: !(Maybe (Textual Int64))
4735+ , _fsAbsoluteDateRange :: !(Maybe AbsoluteDateRange)
4736+ , _fsName :: !(Maybe Text)
4737+ , _fsRelativeDateRange :: !(Maybe RelativeDateRange)
4738+ , _fsTimeSeriesGranularity :: !(Maybe FilterSetTimeSeriesGranularity)
4739+ , _fsPublisherIdentifiers :: !(Maybe [Text])
4740+ } deriving (Eq,Show,Data,Typeable,Generic)
4741+
4742+-- | Creates a value of 'FilterSet' with the minimum fields required to make a request.
4743+--
4744+-- Use one of the following lenses to modify other fields as desired:
4745+--
4746+-- * 'fsPlatforms'
4747+--
4748+-- * 'fsRealtimeTimeRange'
4749+--
4750+-- * 'fsEnvironment'
4751+--
4752+-- * 'fsFormats'
4753+--
4754+-- * 'fsCreativeId'
4755+--
4756+-- * 'fsBreakdownDimensions'
4757+--
4758+-- * 'fsSellerNetworkIds'
4759+--
4760+-- * 'fsDealId'
4761+--
4762+-- * 'fsAbsoluteDateRange'
4763+--
4764+-- * 'fsName'
4765+--
4766+-- * 'fsRelativeDateRange'
4767+--
4768+-- * 'fsTimeSeriesGranularity'
4769+--
4770+-- * 'fsPublisherIdentifiers'
4771+filterSet
4772+ :: FilterSet
4773+filterSet =
4774+ FilterSet'
4775+ { _fsPlatforms = Nothing
4776+ , _fsRealtimeTimeRange = Nothing
4777+ , _fsEnvironment = Nothing
4778+ , _fsFormats = Nothing
4779+ , _fsCreativeId = Nothing
4780+ , _fsBreakdownDimensions = Nothing
4781+ , _fsSellerNetworkIds = Nothing
4782+ , _fsDealId = Nothing
4783+ , _fsAbsoluteDateRange = Nothing
4784+ , _fsName = Nothing
4785+ , _fsRelativeDateRange = Nothing
4786+ , _fsTimeSeriesGranularity = Nothing
4787+ , _fsPublisherIdentifiers = Nothing
4788+ }
4789+
4790+-- | The list of platforms on which to filter; may be empty. The filters
4791+-- represented by multiple platforms are ORed together (i.e., if non-empty,
4792+-- results must match any one of the platforms).
4793+fsPlatforms :: Lens' FilterSet [Text]
4794+fsPlatforms
4795+ = lens _fsPlatforms (\ s a -> s{_fsPlatforms = a}) .
4796+ _Default
4797+ . _Coerce
4798+
4799+-- | An open-ended realtime time range, defined by the aggregation start
4800+-- timestamp.
4801+fsRealtimeTimeRange :: Lens' FilterSet (Maybe RealtimeTimeRange)
4802+fsRealtimeTimeRange
4803+ = lens _fsRealtimeTimeRange
4804+ (\ s a -> s{_fsRealtimeTimeRange = a})
4805+
4806+-- | The environment on which to filter; optional.
4807+fsEnvironment :: Lens' FilterSet (Maybe FilterSetEnvironment)
4808+fsEnvironment
4809+ = lens _fsEnvironment
4810+ (\ s a -> s{_fsEnvironment = a})
4811+
4812+-- | The list of formats on which to filter; may be empty. The filters
4813+-- represented by multiple formats are ORed together (i.e., if non-empty,
4814+-- results must match any one of the formats).
4815+fsFormats :: Lens' FilterSet [Text]
4816+fsFormats
4817+ = lens _fsFormats (\ s a -> s{_fsFormats = a}) .
4818+ _Default
4819+ . _Coerce
4820+
4821+-- | The ID of the creative on which to filter; optional. This field may be
4822+-- set only for a filter set that accesses account-level troubleshooting
4823+-- data, i.e., one whose name matches the
4824+-- \`bidders\/*\/accounts\/*\/filterSets\/*\` pattern.
4825+fsCreativeId :: Lens' FilterSet (Maybe Text)
4826+fsCreativeId
4827+ = lens _fsCreativeId (\ s a -> s{_fsCreativeId = a})
4828+
4829+-- | The set of dimensions along which to break down the response; may be
4830+-- empty. If multiple dimensions are requested, the breakdown is along the
4831+-- Cartesian product of the requested dimensions.
4832+fsBreakdownDimensions :: Lens' FilterSet [Text]
4833+fsBreakdownDimensions
4834+ = lens _fsBreakdownDimensions
4835+ (\ s a -> s{_fsBreakdownDimensions = a})
4836+ . _Default
4837+ . _Coerce
4838+
4839+-- | For Authorized Buyers only. The list of IDs of the seller (publisher)
4840+-- networks on which to filter; may be empty. The filters represented by
4841+-- multiple seller network IDs are ORed together (i.e., if non-empty,
4842+-- results must match any one of the publisher networks). See
4843+-- [seller-network-ids](https:\/\/developers.google.com\/authorized-buyers\/rtb\/downloads\/seller-network-ids)
4844+-- file for the set of existing seller network IDs.
4845+fsSellerNetworkIds :: Lens' FilterSet [Int32]
4846+fsSellerNetworkIds
4847+ = lens _fsSellerNetworkIds
4848+ (\ s a -> s{_fsSellerNetworkIds = a})
4849+ . _Default
4850+ . _Coerce
4851+
4852+-- | The ID of the deal on which to filter; optional. This field may be set
4853+-- only for a filter set that accesses account-level troubleshooting data,
4854+-- i.e., one whose name matches the
4855+-- \`bidders\/*\/accounts\/*\/filterSets\/*\` pattern.
4856+fsDealId :: Lens' FilterSet (Maybe Int64)
4857+fsDealId
4858+ = lens _fsDealId (\ s a -> s{_fsDealId = a}) .
4859+ mapping _Coerce
4860+
4861+-- | An absolute date range, defined by a start date and an end date.
4862+-- Interpreted relative to Pacific time zone.
4863+fsAbsoluteDateRange :: Lens' FilterSet (Maybe AbsoluteDateRange)
4864+fsAbsoluteDateRange
4865+ = lens _fsAbsoluteDateRange
4866+ (\ s a -> s{_fsAbsoluteDateRange = a})
4867+
4868+-- | A user-defined name of the filter set. Filter set names must be unique
4869+-- globally and match one of the patterns: - \`bidders\/*\/filterSets\/*\`
4870+-- (for accessing bidder-level troubleshooting data) -
4871+-- \`bidders\/*\/accounts\/*\/filterSets\/*\` (for accessing account-level
4872+-- troubleshooting data) This field is required in create operations.
4873+fsName :: Lens' FilterSet (Maybe Text)
4874+fsName = lens _fsName (\ s a -> s{_fsName = a})
4875+
4876+-- | A relative date range, defined by an offset from today and a duration.
4877+-- Interpreted relative to Pacific time zone.
4878+fsRelativeDateRange :: Lens' FilterSet (Maybe RelativeDateRange)
4879+fsRelativeDateRange
4880+ = lens _fsRelativeDateRange
4881+ (\ s a -> s{_fsRelativeDateRange = a})
4882+
4883+-- | The granularity of time intervals if a time series breakdown is desired;
4884+-- optional.
4885+fsTimeSeriesGranularity :: Lens' FilterSet (Maybe FilterSetTimeSeriesGranularity)
4886+fsTimeSeriesGranularity
4887+ = lens _fsTimeSeriesGranularity
4888+ (\ s a -> s{_fsTimeSeriesGranularity = a})
4889+
4890+-- | For Open Bidding partners only. The list of publisher identifiers on
4891+-- which to filter; may be empty. The filters represented by multiple
4892+-- publisher identifiers are ORed together.
4893+fsPublisherIdentifiers :: Lens' FilterSet [Text]
4894+fsPublisherIdentifiers
4895+ = lens _fsPublisherIdentifiers
4896+ (\ s a -> s{_fsPublisherIdentifiers = a})
4897+ . _Default
4898+ . _Coerce
4899+
4900+instance FromJSON FilterSet where
4901+ parseJSON
4902+ = withObject "FilterSet"
4903+ (\ o ->
4904+ FilterSet' <$>
4905+ (o .:? "platforms" .!= mempty) <*>
4906+ (o .:? "realtimeTimeRange")
4907+ <*> (o .:? "environment")
4908+ <*> (o .:? "formats" .!= mempty)
4909+ <*> (o .:? "creativeId")
4910+ <*> (o .:? "breakdownDimensions" .!= mempty)
4911+ <*> (o .:? "sellerNetworkIds" .!= mempty)
4912+ <*> (o .:? "dealId")
4913+ <*> (o .:? "absoluteDateRange")
4914+ <*> (o .:? "name")
4915+ <*> (o .:? "relativeDateRange")
4916+ <*> (o .:? "timeSeriesGranularity")
4917+ <*> (o .:? "publisherIdentifiers" .!= mempty))
4918+
4919+instance ToJSON FilterSet where
4920+ toJSON FilterSet'{..}
4921+ = object
4922+ (catMaybes
4923+ [("platforms" .=) <$> _fsPlatforms,
4924+ ("realtimeTimeRange" .=) <$> _fsRealtimeTimeRange,
4925+ ("environment" .=) <$> _fsEnvironment,
4926+ ("formats" .=) <$> _fsFormats,
4927+ ("creativeId" .=) <$> _fsCreativeId,
4928+ ("breakdownDimensions" .=) <$>
4929+ _fsBreakdownDimensions,
4930+ ("sellerNetworkIds" .=) <$> _fsSellerNetworkIds,
4931+ ("dealId" .=) <$> _fsDealId,
4932+ ("absoluteDateRange" .=) <$> _fsAbsoluteDateRange,
4933+ ("name" .=) <$> _fsName,
4934+ ("relativeDateRange" .=) <$> _fsRelativeDateRange,
4935+ ("timeSeriesGranularity" .=) <$>
4936+ _fsTimeSeriesGranularity,
4937+ ("publisherIdentifiers" .=) <$>
4938+ _fsPublisherIdentifiers])
4939+
4940+-- | An interval of time, with an absolute start and end.
4941+--
4942+-- /See:/ 'timeInterval' smart constructor.
4943+data TimeInterval = TimeInterval'
4944+ { _tiStartTime :: !(Maybe DateTime')
4945+ , _tiEndTime :: !(Maybe DateTime')
4946+ } deriving (Eq,Show,Data,Typeable,Generic)
4947+
4948+-- | Creates a value of 'TimeInterval' with the minimum fields required to make a request.
4949+--
4950+-- Use one of the following lenses to modify other fields as desired:
4951+--
4952+-- * 'tiStartTime'
4953+--
4954+-- * 'tiEndTime'
4955+timeInterval
4956+ :: TimeInterval
4957+timeInterval =
4958+ TimeInterval'
4959+ { _tiStartTime = Nothing
4960+ , _tiEndTime = Nothing
4961+ }
4962+
4963+-- | The timestamp marking the start of the range (inclusive) for which data
4964+-- is included.
4965+tiStartTime :: Lens' TimeInterval (Maybe UTCTime)
4966+tiStartTime
4967+ = lens _tiStartTime (\ s a -> s{_tiStartTime = a}) .
4968+ mapping _DateTime
4969+
4970+-- | The timestamp marking the end of the range (exclusive) for which data is
4971+-- included.
4972+tiEndTime :: Lens' TimeInterval (Maybe UTCTime)
4973+tiEndTime
4974+ = lens _tiEndTime (\ s a -> s{_tiEndTime = a}) .
4975+ mapping _DateTime
4976+
4977+instance FromJSON TimeInterval where
4978+ parseJSON
4979+ = withObject "TimeInterval"
4980+ (\ o ->
4981+ TimeInterval' <$>
4982+ (o .:? "startTime") <*> (o .:? "endTime"))
4983+
4984+instance ToJSON TimeInterval where
4985+ toJSON TimeInterval'{..}
4986+ = object
4987+ (catMaybes
4988+ [("startTime" .=) <$> _tiStartTime,
4989+ ("endTime" .=) <$> _tiEndTime])
4990+
4991+-- | A request for removing the association between a deal and a creative.
4992+--
4993+-- /See:/ 'removeDealAssociationRequest' smart constructor.
4994+newtype RemoveDealAssociationRequest = RemoveDealAssociationRequest'
4995+ { _rdarAssociation :: Maybe CreativeDealAssociation
4996+ } deriving (Eq,Show,Data,Typeable,Generic)
4997+
4998+-- | Creates a value of 'RemoveDealAssociationRequest' with the minimum fields required to make a request.
4999+--
5000+-- Use one of the following lenses to modify other fields as desired:
5001+--
5002+-- * 'rdarAssociation'
5003+removeDealAssociationRequest
5004+ :: RemoveDealAssociationRequest
5005+removeDealAssociationRequest =
5006+ RemoveDealAssociationRequest'
5007+ { _rdarAssociation = Nothing
5008+ }
5009+
5010+-- | The association between a creative and a deal that should be removed.
5011+rdarAssociation :: Lens' RemoveDealAssociationRequest (Maybe CreativeDealAssociation)
5012+rdarAssociation
5013+ = lens _rdarAssociation
5014+ (\ s a -> s{_rdarAssociation = a})
5015+
5016+instance FromJSON RemoveDealAssociationRequest where
5017+ parseJSON
5018+ = withObject "RemoveDealAssociationRequest"
5019+ (\ o ->
5020+ RemoveDealAssociationRequest' <$>
5021+ (o .:? "association"))
5022+
5023+instance ToJSON RemoveDealAssociationRequest where
5024+ toJSON RemoveDealAssociationRequest'{..}
5025+ = object
5026+ (catMaybes [("association" .=) <$> _rdarAssociation])
5027+
5028+-- | A polymorphic targeting value used as part of Shared Targeting.
5029+--
5030+-- /See:/ 'targetingValue' smart constructor.
5031+data TargetingValue = TargetingValue'
5032+ { _tvCreativeSizeValue :: !(Maybe CreativeSize)
5033+ , _tvStringValue :: !(Maybe Text)
5034+ , _tvLongValue :: !(Maybe (Textual Int64))
5035+ , _tvDayPartTargetingValue :: !(Maybe DayPartTargeting)
5036+ } deriving (Eq,Show,Data,Typeable,Generic)
5037+
5038+-- | Creates a value of 'TargetingValue' with the minimum fields required to make a request.
5039+--
5040+-- Use one of the following lenses to modify other fields as desired:
5041+--
5042+-- * 'tvCreativeSizeValue'
5043+--
5044+-- * 'tvStringValue'
5045+--
5046+-- * 'tvLongValue'
5047+--
5048+-- * 'tvDayPartTargetingValue'
5049+targetingValue
5050+ :: TargetingValue
5051+targetingValue =
5052+ TargetingValue'
5053+ { _tvCreativeSizeValue = Nothing
5054+ , _tvStringValue = Nothing
5055+ , _tvLongValue = Nothing
5056+ , _tvDayPartTargetingValue = Nothing
5057+ }
5058+
5059+-- | The creative size value to include\/exclude. Filled in when key =
5060+-- GOOG_CREATIVE_SIZE
5061+tvCreativeSizeValue :: Lens' TargetingValue (Maybe CreativeSize)
5062+tvCreativeSizeValue
5063+ = lens _tvCreativeSizeValue
5064+ (\ s a -> s{_tvCreativeSizeValue = a})
5065+
5066+-- | The string value to include\/exclude.
5067+tvStringValue :: Lens' TargetingValue (Maybe Text)
5068+tvStringValue
5069+ = lens _tvStringValue
5070+ (\ s a -> s{_tvStringValue = a})
5071+
5072+-- | The long value to include\/exclude.
5073+tvLongValue :: Lens' TargetingValue (Maybe Int64)
5074+tvLongValue
5075+ = lens _tvLongValue (\ s a -> s{_tvLongValue = a}) .
5076+ mapping _Coerce
5077+
5078+-- | The daypart targeting to include \/ exclude. Filled in when the key is
5079+-- GOOG_DAYPART_TARGETING. The definition of this targeting is derived from
5080+-- the structure used by Ad Manager.
5081+tvDayPartTargetingValue :: Lens' TargetingValue (Maybe DayPartTargeting)
5082+tvDayPartTargetingValue
5083+ = lens _tvDayPartTargetingValue
5084+ (\ s a -> s{_tvDayPartTargetingValue = a})
5085+
5086+instance FromJSON TargetingValue where
5087+ parseJSON
5088+ = withObject "TargetingValue"
5089+ (\ o ->
5090+ TargetingValue' <$>
5091+ (o .:? "creativeSizeValue") <*> (o .:? "stringValue")
5092+ <*> (o .:? "longValue")
5093+ <*> (o .:? "dayPartTargetingValue"))
5094+
5095+instance ToJSON TargetingValue where
5096+ toJSON TargetingValue'{..}
5097+ = object
5098+ (catMaybes
5099+ [("creativeSizeValue" .=) <$> _tvCreativeSizeValue,
5100+ ("stringValue" .=) <$> _tvStringValue,
5101+ ("longValue" .=) <$> _tvLongValue,
5102+ ("dayPartTargetingValue" .=) <$>
5103+ _tvDayPartTargetingValue])
5104+
5105+-- | Response message for listing all reasons for which a buyer was not
5106+-- billed for a winning bid.
5107+--
5108+-- /See:/ 'listNonBillableWinningBidsResponse' smart constructor.
5109+data ListNonBillableWinningBidsResponse = ListNonBillableWinningBidsResponse'
5110+ { _lnbwbrNextPageToken :: !(Maybe Text)
5111+ , _lnbwbrNonBillableWinningBidStatusRows :: !(Maybe [NonBillableWinningBidStatusRow])
5112+ } deriving (Eq,Show,Data,Typeable,Generic)
5113+
5114+-- | Creates a value of 'ListNonBillableWinningBidsResponse' with the minimum fields required to make a request.
5115+--
5116+-- Use one of the following lenses to modify other fields as desired:
5117+--
5118+-- * 'lnbwbrNextPageToken'
5119+--
5120+-- * 'lnbwbrNonBillableWinningBidStatusRows'
5121+listNonBillableWinningBidsResponse
5122+ :: ListNonBillableWinningBidsResponse
5123+listNonBillableWinningBidsResponse =
5124+ ListNonBillableWinningBidsResponse'
5125+ { _lnbwbrNextPageToken = Nothing
5126+ , _lnbwbrNonBillableWinningBidStatusRows = Nothing
5127+ }
5128+
5129+-- | A token to retrieve the next page of results. Pass this value in the
5130+-- ListNonBillableWinningBidsRequest.pageToken field in the subsequent call
5131+-- to the nonBillableWinningBids.list method to retrieve the next page of
5132+-- results.
5133+lnbwbrNextPageToken :: Lens' ListNonBillableWinningBidsResponse (Maybe Text)
5134+lnbwbrNextPageToken
5135+ = lens _lnbwbrNextPageToken
5136+ (\ s a -> s{_lnbwbrNextPageToken = a})
5137+
5138+-- | List of rows, with counts of bids not billed aggregated by reason.
5139+lnbwbrNonBillableWinningBidStatusRows :: Lens' ListNonBillableWinningBidsResponse [NonBillableWinningBidStatusRow]
5140+lnbwbrNonBillableWinningBidStatusRows
5141+ = lens _lnbwbrNonBillableWinningBidStatusRows
5142+ (\ s a ->
5143+ s{_lnbwbrNonBillableWinningBidStatusRows = a})
5144+ . _Default
5145+ . _Coerce
5146+
5147+instance FromJSON ListNonBillableWinningBidsResponse
5148+ where
5149+ parseJSON
5150+ = withObject "ListNonBillableWinningBidsResponse"
5151+ (\ o ->
5152+ ListNonBillableWinningBidsResponse' <$>
5153+ (o .:? "nextPageToken") <*>
5154+ (o .:? "nonBillableWinningBidStatusRows" .!= mempty))
5155+
5156+instance ToJSON ListNonBillableWinningBidsResponse
5157+ where
5158+ toJSON ListNonBillableWinningBidsResponse'{..}
5159+ = object
5160+ (catMaybes
5161+ [("nextPageToken" .=) <$> _lnbwbrNextPageToken,
5162+ ("nonBillableWinningBidStatusRows" .=) <$>
5163+ _lnbwbrNonBillableWinningBidStatusRows])
5164+
5165+-- | Response message for listing all reasons that bids lost in the auction.
5166+--
5167+-- /See:/ 'listLosingBidsResponse' smart constructor.
5168+data ListLosingBidsResponse = ListLosingBidsResponse'
5169+ { _llbrNextPageToken :: !(Maybe Text)
5170+ , _llbrCreativeStatusRows :: !(Maybe [CreativeStatusRow])
5171+ } deriving (Eq,Show,Data,Typeable,Generic)
5172+
5173+-- | Creates a value of 'ListLosingBidsResponse' with the minimum fields required to make a request.
5174+--
5175+-- Use one of the following lenses to modify other fields as desired:
5176+--
5177+-- * 'llbrNextPageToken'
5178+--
5179+-- * 'llbrCreativeStatusRows'
5180+listLosingBidsResponse
5181+ :: ListLosingBidsResponse
5182+listLosingBidsResponse =
5183+ ListLosingBidsResponse'
5184+ { _llbrNextPageToken = Nothing
5185+ , _llbrCreativeStatusRows = Nothing
5186+ }
5187+
5188+-- | A token to retrieve the next page of results. Pass this value in the
5189+-- ListLosingBidsRequest.pageToken field in the subsequent call to the
5190+-- losingBids.list method to retrieve the next page of results.
5191+llbrNextPageToken :: Lens' ListLosingBidsResponse (Maybe Text)
5192+llbrNextPageToken
5193+ = lens _llbrNextPageToken
5194+ (\ s a -> s{_llbrNextPageToken = a})
5195+
5196+-- | List of rows, with counts of losing bids aggregated by loss reason (i.e.
5197+-- creative status).
5198+llbrCreativeStatusRows :: Lens' ListLosingBidsResponse [CreativeStatusRow]
5199+llbrCreativeStatusRows
5200+ = lens _llbrCreativeStatusRows
5201+ (\ s a -> s{_llbrCreativeStatusRows = a})
5202+ . _Default
5203+ . _Coerce
5204+
5205+instance FromJSON ListLosingBidsResponse where
5206+ parseJSON
5207+ = withObject "ListLosingBidsResponse"
5208+ (\ o ->
5209+ ListLosingBidsResponse' <$>
5210+ (o .:? "nextPageToken") <*>
5211+ (o .:? "creativeStatusRows" .!= mempty))
5212+
5213+instance ToJSON ListLosingBidsResponse where
5214+ toJSON ListLosingBidsResponse'{..}
5215+ = object
5216+ (catMaybes
5217+ [("nextPageToken" .=) <$> _llbrNextPageToken,
5218+ ("creativeStatusRows" .=) <$>
5219+ _llbrCreativeStatusRows])
5220+
5221+-- | Represents a price and a pricing type for a product \/ deal.
5222+--
5223+-- /See:/ 'price' smart constructor.
5224+data Price = Price'
5225+ { _pAmount :: !(Maybe Money)
5226+ , _pPricingType :: !(Maybe PricePricingType)
5227+ } deriving (Eq,Show,Data,Typeable,Generic)
5228+
5229+-- | Creates a value of 'Price' with the minimum fields required to make a request.
5230+--
5231+-- Use one of the following lenses to modify other fields as desired:
5232+--
5233+-- * 'pAmount'
5234+--
5235+-- * 'pPricingType'
5236+price
5237+ :: Price
5238+price =
5239+ Price'
5240+ { _pAmount = Nothing
5241+ , _pPricingType = Nothing
5242+ }
5243+
5244+-- | The actual price with currency specified.
5245+pAmount :: Lens' Price (Maybe Money)
5246+pAmount = lens _pAmount (\ s a -> s{_pAmount = a})
5247+
5248+-- | The pricing type for the deal\/product. (default: CPM)
5249+pPricingType :: Lens' Price (Maybe PricePricingType)
5250+pPricingType
5251+ = lens _pPricingType (\ s a -> s{_pPricingType = a})
5252+
5253+instance FromJSON Price where
5254+ parseJSON
5255+ = withObject "Price"
5256+ (\ o ->
5257+ Price' <$>
5258+ (o .:? "amount") <*> (o .:? "pricingType"))
5259+
5260+instance ToJSON Price where
5261+ toJSON Price'{..}
5262+ = object
5263+ (catMaybes
5264+ [("amount" .=) <$> _pAmount,
5265+ ("pricingType" .=) <$> _pPricingType])
5266+
5267+-- | Response message for listing the metrics that are measured in number of
5268+-- impressions.
5269+--
5270+-- /See:/ 'listImpressionMetricsResponse' smart constructor.
5271+data ListImpressionMetricsResponse = ListImpressionMetricsResponse'
5272+ { _limrNextPageToken :: !(Maybe Text)
5273+ , _limrImpressionMetricsRows :: !(Maybe [ImpressionMetricsRow])
5274+ } deriving (Eq,Show,Data,Typeable,Generic)
5275+
5276+-- | Creates a value of 'ListImpressionMetricsResponse' with the minimum fields required to make a request.
5277+--
5278+-- Use one of the following lenses to modify other fields as desired:
5279+--
5280+-- * 'limrNextPageToken'
5281+--
5282+-- * 'limrImpressionMetricsRows'
5283+listImpressionMetricsResponse
5284+ :: ListImpressionMetricsResponse
5285+listImpressionMetricsResponse =
5286+ ListImpressionMetricsResponse'
5287+ { _limrNextPageToken = Nothing
5288+ , _limrImpressionMetricsRows = Nothing
5289+ }
5290+
5291+-- | A token to retrieve the next page of results. Pass this value in the
5292+-- ListImpressionMetricsRequest.pageToken field in the subsequent call to
5293+-- the impressionMetrics.list method to retrieve the next page of results.
5294+limrNextPageToken :: Lens' ListImpressionMetricsResponse (Maybe Text)
5295+limrNextPageToken
5296+ = lens _limrNextPageToken
5297+ (\ s a -> s{_limrNextPageToken = a})
5298+
5299+-- | List of rows, each containing a set of impression metrics.
5300+limrImpressionMetricsRows :: Lens' ListImpressionMetricsResponse [ImpressionMetricsRow]
5301+limrImpressionMetricsRows
5302+ = lens _limrImpressionMetricsRows
5303+ (\ s a -> s{_limrImpressionMetricsRows = a})
5304+ . _Default
5305+ . _Coerce
5306+
5307+instance FromJSON ListImpressionMetricsResponse where
5308+ parseJSON
5309+ = withObject "ListImpressionMetricsResponse"
5310+ (\ o ->
5311+ ListImpressionMetricsResponse' <$>
5312+ (o .:? "nextPageToken") <*>
5313+ (o .:? "impressionMetricsRows" .!= mempty))
5314+
5315+instance ToJSON ListImpressionMetricsResponse where
5316+ toJSON ListImpressionMetricsResponse'{..}
5317+ = object
5318+ (catMaybes
5319+ [("nextPageToken" .=) <$> _limrNextPageToken,
5320+ ("impressionMetricsRows" .=) <$>
5321+ _limrImpressionMetricsRows])
5322+
5323+-- | \'OutputOnly The type of platform the restriction applies to.
5324+--
5325+-- /See:/ 'platformContext' smart constructor.
5326+newtype PlatformContext = PlatformContext'
5327+ { _pcPlatforms :: Maybe [Text]
5328+ } deriving (Eq,Show,Data,Typeable,Generic)
5329+
5330+-- | Creates a value of 'PlatformContext' with the minimum fields required to make a request.
5331+--
5332+-- Use one of the following lenses to modify other fields as desired:
5333+--
5334+-- * 'pcPlatforms'
5335+platformContext
5336+ :: PlatformContext
5337+platformContext =
5338+ PlatformContext'
5339+ { _pcPlatforms = Nothing
5340+ }
5341+
5342+-- | The platforms this restriction applies to.
5343+pcPlatforms :: Lens' PlatformContext [Text]
5344+pcPlatforms
5345+ = lens _pcPlatforms (\ s a -> s{_pcPlatforms = a}) .
5346+ _Default
5347+ . _Coerce
5348+
5349+instance FromJSON PlatformContext where
5350+ parseJSON
5351+ = withObject "PlatformContext"
5352+ (\ o ->
5353+ PlatformContext' <$> (o .:? "platforms" .!= mempty))
5354+
5355+instance ToJSON PlatformContext where
5356+ toJSON PlatformContext'{..}
5357+ = object
5358+ (catMaybes [("platforms" .=) <$> _pcPlatforms])
5359+
5360+-- | Video content for a creative.
5361+--
5362+-- /See:/ 'videoContent' smart constructor.
5363+data VideoContent = VideoContent'
5364+ { _vcVideoVastXML :: !(Maybe Text)
5365+ , _vcVideoURL :: !(Maybe Text)
5366+ } deriving (Eq,Show,Data,Typeable,Generic)
5367+
5368+-- | Creates a value of 'VideoContent' with the minimum fields required to make a request.
5369+--
5370+-- Use one of the following lenses to modify other fields as desired:
5371+--
5372+-- * 'vcVideoVastXML'
5373+--
5374+-- * 'vcVideoURL'
5375+videoContent
5376+ :: VideoContent
5377+videoContent =
5378+ VideoContent'
5379+ { _vcVideoVastXML = Nothing
5380+ , _vcVideoURL = Nothing
5381+ }
5382+
5383+-- | The contents of a VAST document for a video ad. This document should
5384+-- conform to the VAST 2.0 or 3.0 standard.
5385+vcVideoVastXML :: Lens' VideoContent (Maybe Text)
5386+vcVideoVastXML
5387+ = lens _vcVideoVastXML
5388+ (\ s a -> s{_vcVideoVastXML = a})
5389+
5390+-- | The URL to fetch a video ad.
5391+vcVideoURL :: Lens' VideoContent (Maybe Text)
5392+vcVideoURL
5393+ = lens _vcVideoURL (\ s a -> s{_vcVideoURL = a})
5394+
5395+instance FromJSON VideoContent where
5396+ parseJSON
5397+ = withObject "VideoContent"
5398+ (\ o ->
5399+ VideoContent' <$>
5400+ (o .:? "videoVastXml") <*> (o .:? "videoUrl"))
5401+
5402+instance ToJSON VideoContent where
5403+ toJSON VideoContent'{..}
5404+ = object
5405+ (catMaybes
5406+ [("videoVastXml" .=) <$> _vcVideoVastXML,
5407+ ("videoUrl" .=) <$> _vcVideoURL])
5408+
5409+-- | Represents a time of day. The date and time zone are either not
5410+-- significant or are specified elsewhere. An API may choose to allow leap
5411+-- seconds. Related types are google.type.Date and
5412+-- \`google.protobuf.Timestamp\`.
5413+--
5414+-- /See:/ 'timeOfDay' smart constructor.
5415+data TimeOfDay' = TimeOfDay''
5416+ { _todNanos :: !(Maybe (Textual Int32))
5417+ , _todHours :: !(Maybe (Textual Int32))
5418+ , _todMinutes :: !(Maybe (Textual Int32))
5419+ , _todSeconds :: !(Maybe (Textual Int32))
5420+ } deriving (Eq,Show,Data,Typeable,Generic)
5421+
5422+-- | Creates a value of 'TimeOfDay' with the minimum fields required to make a request.
5423+--
5424+-- Use one of the following lenses to modify other fields as desired:
5425+--
5426+-- * 'todNanos'
5427+--
5428+-- * 'todHours'
5429+--
5430+-- * 'todMinutes'
5431+--
5432+-- * 'todSeconds'
5433+timeOfDay
5434+ :: TimeOfDay'
5435+timeOfDay =
5436+ TimeOfDay''
5437+ { _todNanos = Nothing
5438+ , _todHours = Nothing
5439+ , _todMinutes = Nothing
5440+ , _todSeconds = Nothing
5441+ }
5442+
5443+-- | Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
5444+todNanos :: Lens' TimeOfDay' (Maybe Int32)
5445+todNanos
5446+ = lens _todNanos (\ s a -> s{_todNanos = a}) .
5447+ mapping _Coerce
5448+
5449+-- | Hours of day in 24 hour format. Should be from 0 to 23. An API may
5450+-- choose to allow the value \"24:00:00\" for scenarios like business
5451+-- closing time.
5452+todHours :: Lens' TimeOfDay' (Maybe Int32)
5453+todHours
5454+ = lens _todHours (\ s a -> s{_todHours = a}) .
5455+ mapping _Coerce
5456+
5457+-- | Minutes of hour of day. Must be from 0 to 59.
5458+todMinutes :: Lens' TimeOfDay' (Maybe Int32)
5459+todMinutes
5460+ = lens _todMinutes (\ s a -> s{_todMinutes = a}) .
5461+ mapping _Coerce
5462+
5463+-- | Seconds of minutes of the time. Must normally be from 0 to 59. An API
5464+-- may allow the value 60 if it allows leap-seconds.
5465+todSeconds :: Lens' TimeOfDay' (Maybe Int32)
5466+todSeconds
5467+ = lens _todSeconds (\ s a -> s{_todSeconds = a}) .
5468+ mapping _Coerce
5469+
5470+instance FromJSON TimeOfDay' where
5471+ parseJSON
5472+ = withObject "TimeOfDay"
5473+ (\ o ->
5474+ TimeOfDay'' <$>
5475+ (o .:? "nanos") <*> (o .:? "hours") <*>
5476+ (o .:? "minutes")
5477+ <*> (o .:? "seconds"))
5478+
5479+instance ToJSON TimeOfDay' where
5480+ toJSON TimeOfDay''{..}
5481+ = object
5482+ (catMaybes
5483+ [("nanos" .=) <$> _todNanos,
5484+ ("hours" .=) <$> _todHours,
5485+ ("minutes" .=) <$> _todMinutes,
5486+ ("seconds" .=) <$> _todSeconds])
5487+
5488+-- | Terms for Programmatic Guaranteed Deals.
5489+--
5490+-- /See:/ 'guaranteedFixedPriceTerms' smart constructor.
5491+data GuaranteedFixedPriceTerms = GuaranteedFixedPriceTerms'
5492+ { _gfptGuaranteedLooks :: !(Maybe (Textual Int64))
5493+ , _gfptGuaranteedImpressions :: !(Maybe (Textual Int64))
5494+ , _gfptFixedPrices :: !(Maybe [PricePerBuyer])
5495+ , _gfptMinimumDailyLooks :: !(Maybe (Textual Int64))
5496+ } deriving (Eq,Show,Data,Typeable,Generic)
5497+
5498+-- | Creates a value of 'GuaranteedFixedPriceTerms' with the minimum fields required to make a request.
5499+--
5500+-- Use one of the following lenses to modify other fields as desired:
5501+--
5502+-- * 'gfptGuaranteedLooks'
5503+--
5504+-- * 'gfptGuaranteedImpressions'
5505+--
5506+-- * 'gfptFixedPrices'
5507+--
5508+-- * 'gfptMinimumDailyLooks'
5509+guaranteedFixedPriceTerms
5510+ :: GuaranteedFixedPriceTerms
5511+guaranteedFixedPriceTerms =
5512+ GuaranteedFixedPriceTerms'
5513+ { _gfptGuaranteedLooks = Nothing
5514+ , _gfptGuaranteedImpressions = Nothing
5515+ , _gfptFixedPrices = Nothing
5516+ , _gfptMinimumDailyLooks = Nothing
5517+ }
5518+
5519+-- | Count of guaranteed looks. Required for deal, optional for product.
5520+gfptGuaranteedLooks :: Lens' GuaranteedFixedPriceTerms (Maybe Int64)
5521+gfptGuaranteedLooks
5522+ = lens _gfptGuaranteedLooks
5523+ (\ s a -> s{_gfptGuaranteedLooks = a})
5524+ . mapping _Coerce
5525+
5526+-- | Guaranteed impressions as a percentage. This is the percentage of
5527+-- guaranteed looks that the buyer is guaranteeing to buy.
5528+gfptGuaranteedImpressions :: Lens' GuaranteedFixedPriceTerms (Maybe Int64)
5529+gfptGuaranteedImpressions
5530+ = lens _gfptGuaranteedImpressions
5531+ (\ s a -> s{_gfptGuaranteedImpressions = a})
5532+ . mapping _Coerce
5533+
5534+-- | Fixed price for the specified buyer.
5535+gfptFixedPrices :: Lens' GuaranteedFixedPriceTerms [PricePerBuyer]
5536+gfptFixedPrices
5537+ = lens _gfptFixedPrices
5538+ (\ s a -> s{_gfptFixedPrices = a})
5539+ . _Default
5540+ . _Coerce
5541+
5542+-- | Daily minimum looks for CPD deal types.
5543+gfptMinimumDailyLooks :: Lens' GuaranteedFixedPriceTerms (Maybe Int64)
5544+gfptMinimumDailyLooks
5545+ = lens _gfptMinimumDailyLooks
5546+ (\ s a -> s{_gfptMinimumDailyLooks = a})
5547+ . mapping _Coerce
5548+
5549+instance FromJSON GuaranteedFixedPriceTerms where
5550+ parseJSON
5551+ = withObject "GuaranteedFixedPriceTerms"
5552+ (\ o ->
5553+ GuaranteedFixedPriceTerms' <$>
5554+ (o .:? "guaranteedLooks") <*>
5555+ (o .:? "guaranteedImpressions")
5556+ <*> (o .:? "fixedPrices" .!= mempty)
5557+ <*> (o .:? "minimumDailyLooks"))
5558+
5559+instance ToJSON GuaranteedFixedPriceTerms where
5560+ toJSON GuaranteedFixedPriceTerms'{..}
5561+ = object
5562+ (catMaybes
5563+ [("guaranteedLooks" .=) <$> _gfptGuaranteedLooks,
5564+ ("guaranteedImpressions" .=) <$>
5565+ _gfptGuaranteedImpressions,
5566+ ("fixedPrices" .=) <$> _gfptFixedPrices,
5567+ ("minimumDailyLooks" .=) <$> _gfptMinimumDailyLooks])
5568+
5569+-- | Native content for a creative.
5570+--
5571+-- /See:/ 'nATiveContent' smart constructor.
5572+data NATiveContent = NATiveContent'
5573+ { _natcStoreURL :: !(Maybe Text)
5574+ , _natcImage :: !(Maybe Image)
5575+ , _natcAdvertiserName :: !(Maybe Text)
5576+ , _natcAppIcon :: !(Maybe Image)
5577+ , _natcPriceDisplayText :: !(Maybe Text)
5578+ , _natcClickTrackingURL :: !(Maybe Text)
5579+ , _natcClickLinkURL :: !(Maybe Text)
5580+ , _natcBody :: !(Maybe Text)
5581+ , _natcHeadline :: !(Maybe Text)
5582+ , _natcCallToAction :: !(Maybe Text)
5583+ , _natcVideoURL :: !(Maybe Text)
5584+ , _natcStarRating :: !(Maybe (Textual Double))
5585+ , _natcLogo :: !(Maybe Image)
5586+ } deriving (Eq,Show,Data,Typeable,Generic)
5587+
5588+-- | Creates a value of 'NATiveContent' with the minimum fields required to make a request.
5589+--
5590+-- Use one of the following lenses to modify other fields as desired:
5591+--
5592+-- * 'natcStoreURL'
5593+--
5594+-- * 'natcImage'
5595+--
5596+-- * 'natcAdvertiserName'
5597+--
5598+-- * 'natcAppIcon'
5599+--
5600+-- * 'natcPriceDisplayText'
5601+--
5602+-- * 'natcClickTrackingURL'
5603+--
5604+-- * 'natcClickLinkURL'
5605+--
5606+-- * 'natcBody'
5607+--
5608+-- * 'natcHeadline'
5609+--
5610+-- * 'natcCallToAction'
5611+--
5612+-- * 'natcVideoURL'
5613+--
5614+-- * 'natcStarRating'
5615+--
5616+-- * 'natcLogo'
5617+nATiveContent
5618+ :: NATiveContent
5619+nATiveContent =
5620+ NATiveContent'
5621+ { _natcStoreURL = Nothing
5622+ , _natcImage = Nothing
5623+ , _natcAdvertiserName = Nothing
5624+ , _natcAppIcon = Nothing
5625+ , _natcPriceDisplayText = Nothing
5626+ , _natcClickTrackingURL = Nothing
5627+ , _natcClickLinkURL = Nothing
5628+ , _natcBody = Nothing
5629+ , _natcHeadline = Nothing
5630+ , _natcCallToAction = Nothing
5631+ , _natcVideoURL = Nothing
5632+ , _natcStarRating = Nothing
5633+ , _natcLogo = Nothing
5634+ }
5635+
5636+-- | The URL to the app store to purchase\/download the promoted app.
5637+natcStoreURL :: Lens' NATiveContent (Maybe Text)
5638+natcStoreURL
5639+ = lens _natcStoreURL (\ s a -> s{_natcStoreURL = a})
5640+
5641+-- | A large image.
5642+natcImage :: Lens' NATiveContent (Maybe Image)
5643+natcImage
5644+ = lens _natcImage (\ s a -> s{_natcImage = a})
5645+
5646+-- | The name of the advertiser or sponsor, to be displayed in the ad
5647+-- creative.
5648+natcAdvertiserName :: Lens' NATiveContent (Maybe Text)
5649+natcAdvertiserName
5650+ = lens _natcAdvertiserName
5651+ (\ s a -> s{_natcAdvertiserName = a})
5652+
5653+-- | The app icon, for app download ads.
5654+natcAppIcon :: Lens' NATiveContent (Maybe Image)
5655+natcAppIcon
5656+ = lens _natcAppIcon (\ s a -> s{_natcAppIcon = a})
5657+
5658+-- | The price of the promoted app including currency info.
5659+natcPriceDisplayText :: Lens' NATiveContent (Maybe Text)
5660+natcPriceDisplayText
5661+ = lens _natcPriceDisplayText
5662+ (\ s a -> s{_natcPriceDisplayText = a})
5663+
5664+-- | The URL to use for click tracking.
5665+natcClickTrackingURL :: Lens' NATiveContent (Maybe Text)
5666+natcClickTrackingURL
5667+ = lens _natcClickTrackingURL
5668+ (\ s a -> s{_natcClickTrackingURL = a})
5669+
5670+-- | The URL that the browser\/SDK will load when the user clicks the ad.
5671+natcClickLinkURL :: Lens' NATiveContent (Maybe Text)
5672+natcClickLinkURL
5673+ = lens _natcClickLinkURL
5674+ (\ s a -> s{_natcClickLinkURL = a})
5675+
5676+-- | A long description of the ad.
5677+natcBody :: Lens' NATiveContent (Maybe Text)
5678+natcBody = lens _natcBody (\ s a -> s{_natcBody = a})
5679+
5680+-- | A short title for the ad.
5681+natcHeadline :: Lens' NATiveContent (Maybe Text)
5682+natcHeadline
5683+ = lens _natcHeadline (\ s a -> s{_natcHeadline = a})
5684+
5685+-- | A label for the button that the user is supposed to click.
5686+natcCallToAction :: Lens' NATiveContent (Maybe Text)
5687+natcCallToAction
5688+ = lens _natcCallToAction
5689+ (\ s a -> s{_natcCallToAction = a})
5690+
5691+-- | The URL to fetch a native video ad.
5692+natcVideoURL :: Lens' NATiveContent (Maybe Text)
5693+natcVideoURL
5694+ = lens _natcVideoURL (\ s a -> s{_natcVideoURL = a})
5695+
5696+-- | The app rating in the app store. Must be in the range [0-5].
5697+natcStarRating :: Lens' NATiveContent (Maybe Double)
5698+natcStarRating
5699+ = lens _natcStarRating
5700+ (\ s a -> s{_natcStarRating = a})
5701+ . mapping _Coerce
5702+
5703+-- | A smaller image, for the advertiser\'s logo.
5704+natcLogo :: Lens' NATiveContent (Maybe Image)
5705+natcLogo = lens _natcLogo (\ s a -> s{_natcLogo = a})
5706+
5707+instance FromJSON NATiveContent where
5708+ parseJSON
5709+ = withObject "NATiveContent"
5710+ (\ o ->
5711+ NATiveContent' <$>
5712+ (o .:? "storeUrl") <*> (o .:? "image") <*>
5713+ (o .:? "advertiserName")
5714+ <*> (o .:? "appIcon")
5715+ <*> (o .:? "priceDisplayText")
5716+ <*> (o .:? "clickTrackingUrl")
5717+ <*> (o .:? "clickLinkUrl")
5718+ <*> (o .:? "body")
5719+ <*> (o .:? "headline")
5720+ <*> (o .:? "callToAction")
5721+ <*> (o .:? "videoUrl")
5722+ <*> (o .:? "starRating")
5723+ <*> (o .:? "logo"))
5724+
5725+instance ToJSON NATiveContent where
5726+ toJSON NATiveContent'{..}
5727+ = object
5728+ (catMaybes
5729+ [("storeUrl" .=) <$> _natcStoreURL,
5730+ ("image" .=) <$> _natcImage,
5731+ ("advertiserName" .=) <$> _natcAdvertiserName,
5732+ ("appIcon" .=) <$> _natcAppIcon,
5733+ ("priceDisplayText" .=) <$> _natcPriceDisplayText,
5734+ ("clickTrackingUrl" .=) <$> _natcClickTrackingURL,
5735+ ("clickLinkUrl" .=) <$> _natcClickLinkURL,
5736+ ("body" .=) <$> _natcBody,
5737+ ("headline" .=) <$> _natcHeadline,
5738+ ("callToAction" .=) <$> _natcCallToAction,
5739+ ("videoUrl" .=) <$> _natcVideoURL,
5740+ ("starRating" .=) <$> _natcStarRating,
5741+ ("logo" .=) <$> _natcLogo])
5742+
5743+-- | Represents targeting information about video.
5744+--
5745+-- /See:/ 'videoTargeting' smart constructor.
5746+data VideoTargeting = VideoTargeting'
5747+ { _vtTargetedPositionTypes :: !(Maybe [Text])
5748+ , _vtExcludedPositionTypes :: !(Maybe [Text])
5749+ } deriving (Eq,Show,Data,Typeable,Generic)
5750+
5751+-- | Creates a value of 'VideoTargeting' with the minimum fields required to make a request.
5752+--
5753+-- Use one of the following lenses to modify other fields as desired:
5754+--
5755+-- * 'vtTargetedPositionTypes'
5756+--
5757+-- * 'vtExcludedPositionTypes'
5758+videoTargeting
5759+ :: VideoTargeting
5760+videoTargeting =
5761+ VideoTargeting'
5762+ { _vtTargetedPositionTypes = Nothing
5763+ , _vtExcludedPositionTypes = Nothing
5764+ }
5765+
5766+-- | A list of video positions to be included. When the included list is
5767+-- present, the excluded list must be empty. When the excluded list is
5768+-- present, the included list must be empty.
5769+vtTargetedPositionTypes :: Lens' VideoTargeting [Text]
5770+vtTargetedPositionTypes
5771+ = lens _vtTargetedPositionTypes
5772+ (\ s a -> s{_vtTargetedPositionTypes = a})
5773+ . _Default
5774+ . _Coerce
5775+
5776+-- | A list of video positions to be excluded. Position types can either be
5777+-- included or excluded (XOR).
5778+vtExcludedPositionTypes :: Lens' VideoTargeting [Text]
5779+vtExcludedPositionTypes
5780+ = lens _vtExcludedPositionTypes
5781+ (\ s a -> s{_vtExcludedPositionTypes = a})
5782+ . _Default
5783+ . _Coerce
5784+
5785+instance FromJSON VideoTargeting where
5786+ parseJSON
5787+ = withObject "VideoTargeting"
5788+ (\ o ->
5789+ VideoTargeting' <$>
5790+ (o .:? "targetedPositionTypes" .!= mempty) <*>
5791+ (o .:? "excludedPositionTypes" .!= mempty))
5792+
5793+instance ToJSON VideoTargeting where
5794+ toJSON VideoTargeting'{..}
5795+ = object
5796+ (catMaybes
5797+ [("targetedPositionTypes" .=) <$>
5798+ _vtTargetedPositionTypes,
5799+ ("excludedPositionTypes" .=) <$>
5800+ _vtExcludedPositionTypes])
5801+
5802+-- | A client user is created under a client buyer and has restricted access
5803+-- to the Marketplace and certain other sections of the Authorized Buyers
5804+-- UI based on the role granted to the associated client buyer. The only
5805+-- way a new client user can be created is via accepting an email
5806+-- invitation (see the accounts.clients.invitations.create method). All
5807+-- fields are required unless otherwise specified.
5808+--
5809+-- /See:/ 'clientUser' smart constructor.
5810+data ClientUser = ClientUser'
5811+ { _cuEmail :: !(Maybe Text)
5812+ , _cuStatus :: !(Maybe ClientUserStatus)
5813+ , _cuUserId :: !(Maybe (Textual Int64))
5814+ , _cuClientAccountId :: !(Maybe (Textual Int64))
5815+ } deriving (Eq,Show,Data,Typeable,Generic)
5816+
5817+-- | Creates a value of 'ClientUser' with the minimum fields required to make a request.
5818+--
5819+-- Use one of the following lenses to modify other fields as desired:
5820+--
5821+-- * 'cuEmail'
5822+--
5823+-- * 'cuStatus'
5824+--
5825+-- * 'cuUserId'
5826+--
5827+-- * 'cuClientAccountId'
5828+clientUser
5829+ :: ClientUser
5830+clientUser =
5831+ ClientUser'
5832+ { _cuEmail = Nothing
5833+ , _cuStatus = Nothing
5834+ , _cuUserId = Nothing
5835+ , _cuClientAccountId = Nothing
5836+ }
5837+
5838+-- | User\'s email address. The value of this field is ignored in an update
5839+-- operation.
5840+cuEmail :: Lens' ClientUser (Maybe Text)
5841+cuEmail = lens _cuEmail (\ s a -> s{_cuEmail = a})
5842+
5843+-- | The status of the client user.
5844+cuStatus :: Lens' ClientUser (Maybe ClientUserStatus)
5845+cuStatus = lens _cuStatus (\ s a -> s{_cuStatus = a})
5846+
5847+-- | The unique numerical ID of the client user that has accepted an
5848+-- invitation. The value of this field is ignored in an update operation.
5849+cuUserId :: Lens' ClientUser (Maybe Int64)
5850+cuUserId
5851+ = lens _cuUserId (\ s a -> s{_cuUserId = a}) .
5852+ mapping _Coerce
5853+
5854+-- | Numerical account ID of the client buyer with which the user is
5855+-- associated; the buyer must be a client of the current sponsor buyer. The
5856+-- value of this field is ignored in an update operation.
5857+cuClientAccountId :: Lens' ClientUser (Maybe Int64)
5858+cuClientAccountId
5859+ = lens _cuClientAccountId
5860+ (\ s a -> s{_cuClientAccountId = a})
5861+ . mapping _Coerce
5862+
5863+instance FromJSON ClientUser where
5864+ parseJSON
5865+ = withObject "ClientUser"
5866+ (\ o ->
5867+ ClientUser' <$>
5868+ (o .:? "email") <*> (o .:? "status") <*>
5869+ (o .:? "userId")
5870+ <*> (o .:? "clientAccountId"))
5871+
5872+instance ToJSON ClientUser where
5873+ toJSON ClientUser'{..}
5874+ = object
5875+ (catMaybes
5876+ [("email" .=) <$> _cuEmail,
5877+ ("status" .=) <$> _cuStatus,
5878+ ("userId" .=) <$> _cuUserId,
5879+ ("clientAccountId" .=) <$> _cuClientAccountId])
5880+
5881+-- | Note: this resource requires whitelisting for access. Please contact
5882+-- your account manager for access to Marketplace resources. A product is a
5883+-- segment of inventory that a seller wishes to sell. It is associated with
5884+-- certain terms and targeting information which helps the buyer know more
5885+-- about the inventory.
5886+--
5887+-- /See:/ 'product' smart constructor.
5888+data Product = Product'
5889+ { _proAvailableStartTime :: !(Maybe DateTime')
5890+ , _proWebPropertyCode :: !(Maybe Text)
5891+ , _proTerms :: !(Maybe DealTerms)
5892+ , _proProductRevision :: !(Maybe (Textual Int64))
5893+ , _proHasCreatorSignedOff :: !(Maybe Bool)
5894+ , _proSeller :: !(Maybe Seller)
5895+ , _proSyndicationProduct :: !(Maybe ProductSyndicationProduct)
5896+ , _proUpdateTime :: !(Maybe DateTime')
5897+ , _proCreatorContacts :: !(Maybe [ContactInformation])
5898+ , _proTargetingCriterion :: !(Maybe [TargetingCriteria])
5899+ , _proDisplayName :: !(Maybe Text)
5900+ , _proPublisherProFileId :: !(Maybe Text)
5901+ , _proAvailableEndTime :: !(Maybe DateTime')
5902+ , _proProductId :: !(Maybe Text)
5903+ , _proCreateTime :: !(Maybe DateTime')
5904+ } deriving (Eq,Show,Data,Typeable,Generic)
5905+
5906+-- | Creates a value of 'Product' with the minimum fields required to make a request.
5907+--
5908+-- Use one of the following lenses to modify other fields as desired:
5909+--
5910+-- * 'proAvailableStartTime'
5911+--
5912+-- * 'proWebPropertyCode'
5913+--
5914+-- * 'proTerms'
5915+--
5916+-- * 'proProductRevision'
5917+--
5918+-- * 'proHasCreatorSignedOff'
5919+--
5920+-- * 'proSeller'
5921+--
5922+-- * 'proSyndicationProduct'
5923+--
5924+-- * 'proUpdateTime'
5925+--
5926+-- * 'proCreatorContacts'
5927+--
5928+-- * 'proTargetingCriterion'
5929+--
5930+-- * 'proDisplayName'
5931+--
5932+-- * 'proPublisherProFileId'
5933+--
5934+-- * 'proAvailableEndTime'
5935+--
5936+-- * 'proProductId'
5937+--
5938+-- * 'proCreateTime'
5939+product
5940+ :: Product
5941+product =
5942+ Product'
5943+ { _proAvailableStartTime = Nothing
5944+ , _proWebPropertyCode = Nothing
5945+ , _proTerms = Nothing
5946+ , _proProductRevision = Nothing
5947+ , _proHasCreatorSignedOff = Nothing
5948+ , _proSeller = Nothing
5949+ , _proSyndicationProduct = Nothing
5950+ , _proUpdateTime = Nothing
5951+ , _proCreatorContacts = Nothing
5952+ , _proTargetingCriterion = Nothing
5953+ , _proDisplayName = Nothing
5954+ , _proPublisherProFileId = Nothing
5955+ , _proAvailableEndTime = Nothing
5956+ , _proProductId = Nothing
5957+ , _proCreateTime = Nothing
5958+ }
5959+
5960+-- | Inventory availability dates. The start time will be truncated to
5961+-- seconds during serving. Thus, a field specified as 3:23:34.456
5962+-- (HH:mm:ss.SSS) will be truncated to 3:23:34 when serving.
5963+proAvailableStartTime :: Lens' Product (Maybe UTCTime)
5964+proAvailableStartTime
5965+ = lens _proAvailableStartTime
5966+ (\ s a -> s{_proAvailableStartTime = a})
5967+ . mapping _DateTime
5968+
5969+-- | The web-property code for the seller. This needs to be copied as is when
5970+-- adding a new deal to a proposal.
5971+proWebPropertyCode :: Lens' Product (Maybe Text)
5972+proWebPropertyCode
5973+ = lens _proWebPropertyCode
5974+ (\ s a -> s{_proWebPropertyCode = a})
5975+
5976+-- | The negotiable terms of the deal.
5977+proTerms :: Lens' Product (Maybe DealTerms)
5978+proTerms = lens _proTerms (\ s a -> s{_proTerms = a})
5979+
5980+-- | The revision number of the product (auto-assigned by Marketplace).
5981+proProductRevision :: Lens' Product (Maybe Int64)
5982+proProductRevision
5983+ = lens _proProductRevision
5984+ (\ s a -> s{_proProductRevision = a})
5985+ . mapping _Coerce
5986+
5987+-- | If the creator has already signed off on the product, then the buyer can
5988+-- finalize the deal by accepting the product as is. When copying to a
5989+-- proposal, if any of the terms are changed, then auto_finalize is
5990+-- automatically set to false.
5991+proHasCreatorSignedOff :: Lens' Product (Maybe Bool)
5992+proHasCreatorSignedOff
5993+ = lens _proHasCreatorSignedOff
5994+ (\ s a -> s{_proHasCreatorSignedOff = a})
5995+
5996+-- | Information about the seller that created this product.
5997+proSeller :: Lens' Product (Maybe Seller)
5998+proSeller
5999+ = lens _proSeller (\ s a -> s{_proSeller = a})
6000+
6001+-- | The syndication product associated with the deal.
6002+proSyndicationProduct :: Lens' Product (Maybe ProductSyndicationProduct)
6003+proSyndicationProduct
6004+ = lens _proSyndicationProduct
6005+ (\ s a -> s{_proSyndicationProduct = a})
6006+
6007+-- | Time of last update.
6008+proUpdateTime :: Lens' Product (Maybe UTCTime)
6009+proUpdateTime
6010+ = lens _proUpdateTime
6011+ (\ s a -> s{_proUpdateTime = a})
6012+ . mapping _DateTime
6013+
6014+-- | Optional contact information for the creator of this product.
6015+proCreatorContacts :: Lens' Product [ContactInformation]
6016+proCreatorContacts
6017+ = lens _proCreatorContacts
6018+ (\ s a -> s{_proCreatorContacts = a})
6019+ . _Default
6020+ . _Coerce
6021+
6022+-- | Targeting that is shared between the buyer and the seller. Each
6023+-- targeting criterion has a specified key and for each key there is a list
6024+-- of inclusion value or exclusion values.
6025+proTargetingCriterion :: Lens' Product [TargetingCriteria]
6026+proTargetingCriterion
6027+ = lens _proTargetingCriterion
6028+ (\ s a -> s{_proTargetingCriterion = a})
6029+ . _Default
6030+ . _Coerce
6031+
6032+-- | The display name for this product as set by the seller.
6033+proDisplayName :: Lens' Product (Maybe Text)
6034+proDisplayName
6035+ = lens _proDisplayName
6036+ (\ s a -> s{_proDisplayName = a})
6037+
6038+-- | An ID which can be used by the Publisher Profile API to get more
6039+-- information about the seller that created this product.
6040+proPublisherProFileId :: Lens' Product (Maybe Text)
6041+proPublisherProFileId
6042+ = lens _proPublisherProFileId
6043+ (\ s a -> s{_proPublisherProFileId = a})
6044+
6045+-- | The proposed end time for the deal. The field will be truncated to the
6046+-- order of seconds during serving.
6047+proAvailableEndTime :: Lens' Product (Maybe UTCTime)
6048+proAvailableEndTime
6049+ = lens _proAvailableEndTime
6050+ (\ s a -> s{_proAvailableEndTime = a})
6051+ . mapping _DateTime
6052+
6053+-- | The unique ID for the product.
6054+proProductId :: Lens' Product (Maybe Text)
6055+proProductId
6056+ = lens _proProductId (\ s a -> s{_proProductId = a})
6057+
6058+-- | Creation time.
6059+proCreateTime :: Lens' Product (Maybe UTCTime)
6060+proCreateTime
6061+ = lens _proCreateTime
6062+ (\ s a -> s{_proCreateTime = a})
6063+ . mapping _DateTime
6064+
6065+instance FromJSON Product where
6066+ parseJSON
6067+ = withObject "Product"
6068+ (\ o ->
6069+ Product' <$>
6070+ (o .:? "availableStartTime") <*>
6071+ (o .:? "webPropertyCode")
6072+ <*> (o .:? "terms")
6073+ <*> (o .:? "productRevision")
6074+ <*> (o .:? "hasCreatorSignedOff")
6075+ <*> (o .:? "seller")
6076+ <*> (o .:? "syndicationProduct")
6077+ <*> (o .:? "updateTime")
6078+ <*> (o .:? "creatorContacts" .!= mempty)
6079+ <*> (o .:? "targetingCriterion" .!= mempty)
6080+ <*> (o .:? "displayName")
6081+ <*> (o .:? "publisherProfileId")
6082+ <*> (o .:? "availableEndTime")
6083+ <*> (o .:? "productId")
6084+ <*> (o .:? "createTime"))
6085+
6086+instance ToJSON Product where
6087+ toJSON Product'{..}
6088+ = object
6089+ (catMaybes
6090+ [("availableStartTime" .=) <$>
6091+ _proAvailableStartTime,
6092+ ("webPropertyCode" .=) <$> _proWebPropertyCode,
6093+ ("terms" .=) <$> _proTerms,
6094+ ("productRevision" .=) <$> _proProductRevision,
6095+ ("hasCreatorSignedOff" .=) <$>
6096+ _proHasCreatorSignedOff,
6097+ ("seller" .=) <$> _proSeller,
6098+ ("syndicationProduct" .=) <$> _proSyndicationProduct,
6099+ ("updateTime" .=) <$> _proUpdateTime,
6100+ ("creatorContacts" .=) <$> _proCreatorContacts,
6101+ ("targetingCriterion" .=) <$> _proTargetingCriterion,
6102+ ("displayName" .=) <$> _proDisplayName,
6103+ ("publisherProfileId" .=) <$> _proPublisherProFileId,
6104+ ("availableEndTime" .=) <$> _proAvailableEndTime,
6105+ ("productId" .=) <$> _proProductId,
6106+ ("createTime" .=) <$> _proCreateTime])
6107+
6108+--
6109+-- /See:/ 'listClientUserInvitationsResponse' smart constructor.
6110+data ListClientUserInvitationsResponse = ListClientUserInvitationsResponse'
6111+ { _lcuirNextPageToken :: !(Maybe Text)
6112+ , _lcuirInvitations :: !(Maybe [ClientUserInvitation])
6113+ } deriving (Eq,Show,Data,Typeable,Generic)
6114+
6115+-- | Creates a value of 'ListClientUserInvitationsResponse' with the minimum fields required to make a request.
6116+--
6117+-- Use one of the following lenses to modify other fields as desired:
6118+--
6119+-- * 'lcuirNextPageToken'
6120+--
6121+-- * 'lcuirInvitations'
6122+listClientUserInvitationsResponse
6123+ :: ListClientUserInvitationsResponse
6124+listClientUserInvitationsResponse =
6125+ ListClientUserInvitationsResponse'
6126+ { _lcuirNextPageToken = Nothing
6127+ , _lcuirInvitations = Nothing
6128+ }
6129+
6130+-- | A token to retrieve the next page of results. Pass this value in the
6131+-- ListClientUserInvitationsRequest.pageToken field in the subsequent call
6132+-- to the clients.invitations.list method to retrieve the next page of
6133+-- results.
6134+lcuirNextPageToken :: Lens' ListClientUserInvitationsResponse (Maybe Text)
6135+lcuirNextPageToken
6136+ = lens _lcuirNextPageToken
6137+ (\ s a -> s{_lcuirNextPageToken = a})
6138+
6139+-- | The returned list of client users.
6140+lcuirInvitations :: Lens' ListClientUserInvitationsResponse [ClientUserInvitation]
6141+lcuirInvitations
6142+ = lens _lcuirInvitations
6143+ (\ s a -> s{_lcuirInvitations = a})
6144+ . _Default
6145+ . _Coerce
6146+
6147+instance FromJSON ListClientUserInvitationsResponse
6148+ where
6149+ parseJSON
6150+ = withObject "ListClientUserInvitationsResponse"
6151+ (\ o ->
6152+ ListClientUserInvitationsResponse' <$>
6153+ (o .:? "nextPageToken") <*>
6154+ (o .:? "invitations" .!= mempty))
6155+
6156+instance ToJSON ListClientUserInvitationsResponse
6157+ where
6158+ toJSON ListClientUserInvitationsResponse'{..}
6159+ = object
6160+ (catMaybes
6161+ [("nextPageToken" .=) <$> _lcuirNextPageToken,
6162+ ("invitations" .=) <$> _lcuirInvitations])
6163+
6164+-- | Daypart targeting message that specifies if the ad can be shown only
6165+-- during certain parts of a day\/week.
6166+--
6167+-- /See:/ 'dayPart' smart constructor.
6168+data DayPart = DayPart'
6169+ { _dpStartTime :: !(Maybe TimeOfDay')
6170+ , _dpEndTime :: !(Maybe TimeOfDay')
6171+ , _dpDayOfWeek :: !(Maybe DayPartDayOfWeek)
6172+ } deriving (Eq,Show,Data,Typeable,Generic)
6173+
6174+-- | Creates a value of 'DayPart' with the minimum fields required to make a request.
6175+--
6176+-- Use one of the following lenses to modify other fields as desired:
6177+--
6178+-- * 'dpStartTime'
6179+--
6180+-- * 'dpEndTime'
6181+--
6182+-- * 'dpDayOfWeek'
6183+dayPart
6184+ :: DayPart
6185+dayPart =
6186+ DayPart'
6187+ { _dpStartTime = Nothing
6188+ , _dpEndTime = Nothing
6189+ , _dpDayOfWeek = Nothing
6190+ }
6191+
6192+-- | The starting time of day for the ad to show (minute level granularity).
6193+-- The start time is inclusive. This field is not available for filtering
6194+-- in PQL queries.
6195+dpStartTime :: Lens' DayPart (Maybe TimeOfDay')
6196+dpStartTime
6197+ = lens _dpStartTime (\ s a -> s{_dpStartTime = a})
6198+
6199+-- | The ending time of the day for the ad to show (minute level
6200+-- granularity). The end time is exclusive. This field is not available for
6201+-- filtering in PQL queries.
6202+dpEndTime :: Lens' DayPart (Maybe TimeOfDay')
6203+dpEndTime
6204+ = lens _dpEndTime (\ s a -> s{_dpEndTime = a})
6205+
6206+-- | The day of the week to target. If unspecified, applicable to all days.
6207+dpDayOfWeek :: Lens' DayPart (Maybe DayPartDayOfWeek)
6208+dpDayOfWeek
6209+ = lens _dpDayOfWeek (\ s a -> s{_dpDayOfWeek = a})
6210+
6211+instance FromJSON DayPart where
6212+ parseJSON
6213+ = withObject "DayPart"
6214+ (\ o ->
6215+ DayPart' <$>
6216+ (o .:? "startTime") <*> (o .:? "endTime") <*>
6217+ (o .:? "dayOfWeek"))
6218+
6219+instance ToJSON DayPart where
6220+ toJSON DayPart'{..}
6221+ = object
6222+ (catMaybes
6223+ [("startTime" .=) <$> _dpStartTime,
6224+ ("endTime" .=) <$> _dpEndTime,
6225+ ("dayOfWeek" .=) <$> _dpDayOfWeek])
6226+
6227+-- | Mobile application targeting settings.
6228+--
6229+-- /See:/ 'mobileApplicationTargeting' smart constructor.
6230+newtype MobileApplicationTargeting = MobileApplicationTargeting'
6231+ { _matFirstPartyTargeting :: Maybe FirstPartyMobileApplicationTargeting
6232+ } deriving (Eq,Show,Data,Typeable,Generic)
6233+
6234+-- | Creates a value of 'MobileApplicationTargeting' with the minimum fields required to make a request.
6235+--
6236+-- Use one of the following lenses to modify other fields as desired:
6237+--
6238+-- * 'matFirstPartyTargeting'
6239+mobileApplicationTargeting
6240+ :: MobileApplicationTargeting
6241+mobileApplicationTargeting =
6242+ MobileApplicationTargeting'
6243+ { _matFirstPartyTargeting = Nothing
6244+ }
6245+
6246+-- | Publisher owned apps to be targeted or excluded by the publisher to
6247+-- display the ads in.
6248+matFirstPartyTargeting :: Lens' MobileApplicationTargeting (Maybe FirstPartyMobileApplicationTargeting)
6249+matFirstPartyTargeting
6250+ = lens _matFirstPartyTargeting
6251+ (\ s a -> s{_matFirstPartyTargeting = a})
6252+
6253+instance FromJSON MobileApplicationTargeting where
6254+ parseJSON
6255+ = withObject "MobileApplicationTargeting"
6256+ (\ o ->
6257+ MobileApplicationTargeting' <$>
6258+ (o .:? "firstPartyTargeting"))
6259+
6260+instance ToJSON MobileApplicationTargeting where
6261+ toJSON MobileApplicationTargeting'{..}
6262+ = object
6263+ (catMaybes
6264+ [("firstPartyTargeting" .=) <$>
6265+ _matFirstPartyTargeting])
6266+
6267+--
6268+-- /See:/ 'listClientsResponse' smart constructor.
6269+data ListClientsResponse = ListClientsResponse'
6270+ { _lNextPageToken :: !(Maybe Text)
6271+ , _lClients :: !(Maybe [Client])
6272+ } deriving (Eq,Show,Data,Typeable,Generic)
6273+
6274+-- | Creates a value of 'ListClientsResponse' with the minimum fields required to make a request.
6275+--
6276+-- Use one of the following lenses to modify other fields as desired:
6277+--
6278+-- * 'lNextPageToken'
6279+--
6280+-- * 'lClients'
6281+listClientsResponse
6282+ :: ListClientsResponse
6283+listClientsResponse =
6284+ ListClientsResponse'
6285+ { _lNextPageToken = Nothing
6286+ , _lClients = Nothing
6287+ }
6288+
6289+-- | A token to retrieve the next page of results. Pass this value in the
6290+-- ListClientsRequest.pageToken field in the subsequent call to the
6291+-- accounts.clients.list method to retrieve the next page of results.
6292+lNextPageToken :: Lens' ListClientsResponse (Maybe Text)
6293+lNextPageToken
6294+ = lens _lNextPageToken
6295+ (\ s a -> s{_lNextPageToken = a})
6296+
6297+-- | The returned list of clients.
6298+lClients :: Lens' ListClientsResponse [Client]
6299+lClients
6300+ = lens _lClients (\ s a -> s{_lClients = a}) .
6301+ _Default
6302+ . _Coerce
6303+
6304+instance FromJSON ListClientsResponse where
6305+ parseJSON
6306+ = withObject "ListClientsResponse"
6307+ (\ o ->
6308+ ListClientsResponse' <$>
6309+ (o .:? "nextPageToken") <*>
6310+ (o .:? "clients" .!= mempty))
6311+
6312+instance ToJSON ListClientsResponse where
6313+ toJSON ListClientsResponse'{..}
6314+ = object
6315+ (catMaybes
6316+ [("nextPageToken" .=) <$> _lNextPageToken,
6317+ ("clients" .=) <$> _lClients])
6318+
6319+-- | Response message for listing all creatives associated with a given
6320+-- filtered bid reason.
6321+--
6322+-- /See:/ 'listCreativeStatusBreakdownByCreativeResponse' smart constructor.
6323+data ListCreativeStatusBreakdownByCreativeResponse = ListCreativeStatusBreakdownByCreativeResponse'
6324+ { _lcsbbcrNextPageToken :: !(Maybe Text)
6325+ , _lcsbbcrFilteredBidCreativeRows :: !(Maybe [FilteredBidCreativeRow])
6326+ } deriving (Eq,Show,Data,Typeable,Generic)
6327+
6328+-- | Creates a value of 'ListCreativeStatusBreakdownByCreativeResponse' with the minimum fields required to make a request.
6329+--
6330+-- Use one of the following lenses to modify other fields as desired:
6331+--
6332+-- * 'lcsbbcrNextPageToken'
6333+--
6334+-- * 'lcsbbcrFilteredBidCreativeRows'
6335+listCreativeStatusBreakdownByCreativeResponse
6336+ :: ListCreativeStatusBreakdownByCreativeResponse
6337+listCreativeStatusBreakdownByCreativeResponse =
6338+ ListCreativeStatusBreakdownByCreativeResponse'
6339+ { _lcsbbcrNextPageToken = Nothing
6340+ , _lcsbbcrFilteredBidCreativeRows = Nothing
6341+ }
6342+
6343+-- | A token to retrieve the next page of results. Pass this value in the
6344+-- ListCreativeStatusBreakdownByCreativeRequest.pageToken field in the
6345+-- subsequent call to the filteredBids.creatives.list method to retrieve
6346+-- the next page of results.
6347+lcsbbcrNextPageToken :: Lens' ListCreativeStatusBreakdownByCreativeResponse (Maybe Text)
6348+lcsbbcrNextPageToken
6349+ = lens _lcsbbcrNextPageToken
6350+ (\ s a -> s{_lcsbbcrNextPageToken = a})
6351+
6352+-- | List of rows, with counts of bids with a given creative status
6353+-- aggregated by creative.
6354+lcsbbcrFilteredBidCreativeRows :: Lens' ListCreativeStatusBreakdownByCreativeResponse [FilteredBidCreativeRow]
6355+lcsbbcrFilteredBidCreativeRows
6356+ = lens _lcsbbcrFilteredBidCreativeRows
6357+ (\ s a -> s{_lcsbbcrFilteredBidCreativeRows = a})
6358+ . _Default
6359+ . _Coerce
6360+
6361+instance FromJSON
6362+ ListCreativeStatusBreakdownByCreativeResponse where
6363+ parseJSON
6364+ = withObject
6365+ "ListCreativeStatusBreakdownByCreativeResponse"
6366+ (\ o ->
6367+ ListCreativeStatusBreakdownByCreativeResponse' <$>
6368+ (o .:? "nextPageToken") <*>
6369+ (o .:? "filteredBidCreativeRows" .!= mempty))
6370+
6371+instance ToJSON
6372+ ListCreativeStatusBreakdownByCreativeResponse where
6373+ toJSON
6374+ ListCreativeStatusBreakdownByCreativeResponse'{..}
6375+ = object
6376+ (catMaybes
6377+ [("nextPageToken" .=) <$> _lcsbbcrNextPageToken,
6378+ ("filteredBidCreativeRows" .=) <$>
6379+ _lcsbbcrFilteredBidCreativeRows])
6380+
6381+-- | Frequency cap.
6382+--
6383+-- /See:/ 'frequencyCap' smart constructor.
6384+data FrequencyCap = FrequencyCap'
6385+ { _fcMaxImpressions :: !(Maybe (Textual Int32))
6386+ , _fcNumTimeUnits :: !(Maybe (Textual Int32))
6387+ , _fcTimeUnitType :: !(Maybe FrequencyCapTimeUnitType)
6388+ } deriving (Eq,Show,Data,Typeable,Generic)
6389+
6390+-- | Creates a value of 'FrequencyCap' with the minimum fields required to make a request.
6391+--
6392+-- Use one of the following lenses to modify other fields as desired:
6393+--
6394+-- * 'fcMaxImpressions'
6395+--
6396+-- * 'fcNumTimeUnits'
6397+--
6398+-- * 'fcTimeUnitType'
6399+frequencyCap
6400+ :: FrequencyCap
6401+frequencyCap =
6402+ FrequencyCap'
6403+ { _fcMaxImpressions = Nothing
6404+ , _fcNumTimeUnits = Nothing
6405+ , _fcTimeUnitType = Nothing
6406+ }
6407+
6408+-- | The maximum number of impressions that can be served to a user within
6409+-- the specified time period.
6410+fcMaxImpressions :: Lens' FrequencyCap (Maybe Int32)
6411+fcMaxImpressions
6412+ = lens _fcMaxImpressions
6413+ (\ s a -> s{_fcMaxImpressions = a})
6414+ . mapping _Coerce
6415+
6416+-- | The amount of time, in the units specified by time_unit_type. Defines
6417+-- the amount of time over which impressions per user are counted and
6418+-- capped.
6419+fcNumTimeUnits :: Lens' FrequencyCap (Maybe Int32)
6420+fcNumTimeUnits
6421+ = lens _fcNumTimeUnits
6422+ (\ s a -> s{_fcNumTimeUnits = a})
6423+ . mapping _Coerce
6424+
6425+-- | The time unit. Along with num_time_units defines the amount of time over
6426+-- which impressions per user are counted and capped.
6427+fcTimeUnitType :: Lens' FrequencyCap (Maybe FrequencyCapTimeUnitType)
6428+fcTimeUnitType
6429+ = lens _fcTimeUnitType
6430+ (\ s a -> s{_fcTimeUnitType = a})
6431+
6432+instance FromJSON FrequencyCap where
6433+ parseJSON
6434+ = withObject "FrequencyCap"
6435+ (\ o ->
6436+ FrequencyCap' <$>
6437+ (o .:? "maxImpressions") <*> (o .:? "numTimeUnits")
6438+ <*> (o .:? "timeUnitType"))
6439+
6440+instance ToJSON FrequencyCap where
6441+ toJSON FrequencyCap'{..}
6442+ = object
6443+ (catMaybes
6444+ [("maxImpressions" .=) <$> _fcMaxImpressions,
6445+ ("numTimeUnits" .=) <$> _fcNumTimeUnits,
6446+ ("timeUnitType" .=) <$> _fcTimeUnitType])
6447+
6448+-- | Response message for listing all reasons that bid responses were
6449+-- considered to have no applicable bids.
6450+--
6451+-- /See:/ 'listBidResponsesWithoutBidsResponse' smart constructor.
6452+data ListBidResponsesWithoutBidsResponse = ListBidResponsesWithoutBidsResponse'
6453+ { _lbrwbrNextPageToken :: !(Maybe Text)
6454+ , _lbrwbrBidResponseWithoutBidsStatusRows :: !(Maybe [BidResponseWithoutBidsStatusRow])
6455+ } deriving (Eq,Show,Data,Typeable,Generic)
6456+
6457+-- | Creates a value of 'ListBidResponsesWithoutBidsResponse' with the minimum fields required to make a request.
6458+--
6459+-- Use one of the following lenses to modify other fields as desired:
6460+--
6461+-- * 'lbrwbrNextPageToken'
6462+--
6463+-- * 'lbrwbrBidResponseWithoutBidsStatusRows'
6464+listBidResponsesWithoutBidsResponse
6465+ :: ListBidResponsesWithoutBidsResponse
6466+listBidResponsesWithoutBidsResponse =
6467+ ListBidResponsesWithoutBidsResponse'
6468+ { _lbrwbrNextPageToken = Nothing
6469+ , _lbrwbrBidResponseWithoutBidsStatusRows = Nothing
6470+ }
6471+
6472+-- | A token to retrieve the next page of results. Pass this value in the
6473+-- ListBidResponsesWithoutBidsRequest.pageToken field in the subsequent
6474+-- call to the bidResponsesWithoutBids.list method to retrieve the next
6475+-- page of results.
6476+lbrwbrNextPageToken :: Lens' ListBidResponsesWithoutBidsResponse (Maybe Text)
6477+lbrwbrNextPageToken
6478+ = lens _lbrwbrNextPageToken
6479+ (\ s a -> s{_lbrwbrNextPageToken = a})
6480+
6481+-- | List of rows, with counts of bid responses without bids aggregated by
6482+-- status.
6483+lbrwbrBidResponseWithoutBidsStatusRows :: Lens' ListBidResponsesWithoutBidsResponse [BidResponseWithoutBidsStatusRow]
6484+lbrwbrBidResponseWithoutBidsStatusRows
6485+ = lens _lbrwbrBidResponseWithoutBidsStatusRows
6486+ (\ s a ->
6487+ s{_lbrwbrBidResponseWithoutBidsStatusRows = a})
6488+ . _Default
6489+ . _Coerce
6490+
6491+instance FromJSON ListBidResponsesWithoutBidsResponse
6492+ where
6493+ parseJSON
6494+ = withObject "ListBidResponsesWithoutBidsResponse"
6495+ (\ o ->
6496+ ListBidResponsesWithoutBidsResponse' <$>
6497+ (o .:? "nextPageToken") <*>
6498+ (o .:? "bidResponseWithoutBidsStatusRows" .!=
6499+ mempty))
6500+
6501+instance ToJSON ListBidResponsesWithoutBidsResponse
6502+ where
6503+ toJSON ListBidResponsesWithoutBidsResponse'{..}
6504+ = object
6505+ (catMaybes
6506+ [("nextPageToken" .=) <$> _lbrwbrNextPageToken,
6507+ ("bidResponseWithoutBidsStatusRows" .=) <$>
6508+ _lbrwbrBidResponseWithoutBidsStatusRows])
6509+
6510+-- | \'OutputOnly A representation of the status of an ad in a specific
6511+-- context. A context here relates to where something ultimately serves
6512+-- (for example, a user or publisher geo, a platform, an HTTPS vs HTTP
6513+-- request, or the type of auction).
6514+--
6515+-- /See:/ 'servingRestriction' smart constructor.
6516+data ServingRestriction = ServingRestriction'
6517+ { _srStatus :: !(Maybe ServingRestrictionStatus)
6518+ , _srContexts :: !(Maybe [ServingContext])
6519+ , _srDisApprovalReasons :: !(Maybe [DisApproval])
6520+ , _srDisApproval :: !(Maybe DisApproval)
6521+ } deriving (Eq,Show,Data,Typeable,Generic)
6522+
6523+-- | Creates a value of 'ServingRestriction' with the minimum fields required to make a request.
6524+--
6525+-- Use one of the following lenses to modify other fields as desired:
6526+--
6527+-- * 'srStatus'
6528+--
6529+-- * 'srContexts'
6530+--
6531+-- * 'srDisApprovalReasons'
6532+--
6533+-- * 'srDisApproval'
6534+servingRestriction
6535+ :: ServingRestriction
6536+servingRestriction =
6537+ ServingRestriction'
6538+ { _srStatus = Nothing
6539+ , _srContexts = Nothing
6540+ , _srDisApprovalReasons = Nothing
6541+ , _srDisApproval = Nothing
6542+ }
6543+
6544+-- | The status of the creative in this context (for example, it has been
6545+-- explicitly disapproved or is pending review).
6546+srStatus :: Lens' ServingRestriction (Maybe ServingRestrictionStatus)
6547+srStatus = lens _srStatus (\ s a -> s{_srStatus = a})
6548+
6549+-- | The contexts for the restriction.
6550+srContexts :: Lens' ServingRestriction [ServingContext]
6551+srContexts
6552+ = lens _srContexts (\ s a -> s{_srContexts = a}) .
6553+ _Default
6554+ . _Coerce
6555+
6556+-- | Any disapprovals bound to this restriction. Only present if
6557+-- status=DISAPPROVED. Can be used to filter the response of the
6558+-- creatives.list method. Deprecated; please use disapproval field instead.
6559+srDisApprovalReasons :: Lens' ServingRestriction [DisApproval]
6560+srDisApprovalReasons
6561+ = lens _srDisApprovalReasons
6562+ (\ s a -> s{_srDisApprovalReasons = a})
6563+ . _Default
6564+ . _Coerce
6565+
6566+-- | Disapproval bound to this restriction. Only present if
6567+-- status=DISAPPROVED. Can be used to filter the response of the
6568+-- creatives.list method.
6569+srDisApproval :: Lens' ServingRestriction (Maybe DisApproval)
6570+srDisApproval
6571+ = lens _srDisApproval
6572+ (\ s a -> s{_srDisApproval = a})
6573+
6574+instance FromJSON ServingRestriction where
6575+ parseJSON
6576+ = withObject "ServingRestriction"
6577+ (\ o ->
6578+ ServingRestriction' <$>
6579+ (o .:? "status") <*> (o .:? "contexts" .!= mempty)
6580+ <*> (o .:? "disapprovalReasons" .!= mempty)
6581+ <*> (o .:? "disapproval"))
6582+
6583+instance ToJSON ServingRestriction where
6584+ toJSON ServingRestriction'{..}
6585+ = object
6586+ (catMaybes
6587+ [("status" .=) <$> _srStatus,
6588+ ("contexts" .=) <$> _srContexts,
6589+ ("disapprovalReasons" .=) <$> _srDisApprovalReasons,
6590+ ("disapproval" .=) <$> _srDisApproval])
6591+
6592+-- | Represents information for a creative that is associated with a
6593+-- Programmatic Guaranteed\/Preferred Deal in Ad Manager.
6594+--
6595+-- /See:/ 'creativeSpecification' smart constructor.
6596+data CreativeSpecification = CreativeSpecification'
6597+ { _csCreativeCompanionSizes :: !(Maybe [AdSize])
6598+ , _csCreativeSize :: !(Maybe AdSize)
6599+ } deriving (Eq,Show,Data,Typeable,Generic)
6600+
6601+-- | Creates a value of 'CreativeSpecification' with the minimum fields required to make a request.
6602+--
6603+-- Use one of the following lenses to modify other fields as desired:
6604+--
6605+-- * 'csCreativeCompanionSizes'
6606+--
6607+-- * 'csCreativeSize'
6608+creativeSpecification
6609+ :: CreativeSpecification
6610+creativeSpecification =
6611+ CreativeSpecification'
6612+ { _csCreativeCompanionSizes = Nothing
6613+ , _csCreativeSize = Nothing
6614+ }
6615+
6616+-- | Companion sizes may be filled in only when this is a video creative.
6617+csCreativeCompanionSizes :: Lens' CreativeSpecification [AdSize]
6618+csCreativeCompanionSizes
6619+ = lens _csCreativeCompanionSizes
6620+ (\ s a -> s{_csCreativeCompanionSizes = a})
6621+ . _Default
6622+ . _Coerce
6623+
6624+-- | The size of the creative.
6625+csCreativeSize :: Lens' CreativeSpecification (Maybe AdSize)
6626+csCreativeSize
6627+ = lens _csCreativeSize
6628+ (\ s a -> s{_csCreativeSize = a})
6629+
6630+instance FromJSON CreativeSpecification where
6631+ parseJSON
6632+ = withObject "CreativeSpecification"
6633+ (\ o ->
6634+ CreativeSpecification' <$>
6635+ (o .:? "creativeCompanionSizes" .!= mempty) <*>
6636+ (o .:? "creativeSize"))
6637+
6638+instance ToJSON CreativeSpecification where
6639+ toJSON CreativeSpecification'{..}
6640+ = object
6641+ (catMaybes
6642+ [("creativeCompanionSizes" .=) <$>
6643+ _csCreativeCompanionSizes,
6644+ ("creativeSize" .=) <$> _csCreativeSize])
6645+
6646+-- | The set of metrics that are measured in numbers of impressions,
6647+-- representing how many impressions with the specified dimension values
6648+-- were considered eligible at each stage of the bidding funnel.
6649+--
6650+-- /See:/ 'impressionMetricsRow' smart constructor.
6651+data ImpressionMetricsRow = ImpressionMetricsRow'
6652+ { _imrRowDimensions :: !(Maybe RowDimensions)
6653+ , _imrAvailableImpressions :: !(Maybe MetricValue)
6654+ , _imrSuccessfulResponses :: !(Maybe MetricValue)
6655+ , _imrInventoryMatches :: !(Maybe MetricValue)
6656+ , _imrBidRequests :: !(Maybe MetricValue)
6657+ , _imrResponsesWithBids :: !(Maybe MetricValue)
6658+ } deriving (Eq,Show,Data,Typeable,Generic)
6659+
6660+-- | Creates a value of 'ImpressionMetricsRow' with the minimum fields required to make a request.
6661+--
6662+-- Use one of the following lenses to modify other fields as desired:
6663+--
6664+-- * 'imrRowDimensions'
6665+--
6666+-- * 'imrAvailableImpressions'
6667+--
6668+-- * 'imrSuccessfulResponses'
6669+--
6670+-- * 'imrInventoryMatches'
6671+--
6672+-- * 'imrBidRequests'
6673+--
6674+-- * 'imrResponsesWithBids'
6675+impressionMetricsRow
6676+ :: ImpressionMetricsRow
6677+impressionMetricsRow =
6678+ ImpressionMetricsRow'
6679+ { _imrRowDimensions = Nothing
6680+ , _imrAvailableImpressions = Nothing
6681+ , _imrSuccessfulResponses = Nothing
6682+ , _imrInventoryMatches = Nothing
6683+ , _imrBidRequests = Nothing
6684+ , _imrResponsesWithBids = Nothing
6685+ }
6686+
6687+-- | The values of all dimensions associated with metric values in this row.
6688+imrRowDimensions :: Lens' ImpressionMetricsRow (Maybe RowDimensions)
6689+imrRowDimensions
6690+ = lens _imrRowDimensions
6691+ (\ s a -> s{_imrRowDimensions = a})
6692+
6693+-- | The number of impressions available to the buyer on Ad Exchange. In some
6694+-- cases this value may be unavailable.
6695+imrAvailableImpressions :: Lens' ImpressionMetricsRow (Maybe MetricValue)
6696+imrAvailableImpressions
6697+ = lens _imrAvailableImpressions
6698+ (\ s a -> s{_imrAvailableImpressions = a})
6699+
6700+-- | The number of impressions for which the buyer successfully sent a
6701+-- response to Ad Exchange.
6702+imrSuccessfulResponses :: Lens' ImpressionMetricsRow (Maybe MetricValue)
6703+imrSuccessfulResponses
6704+ = lens _imrSuccessfulResponses
6705+ (\ s a -> s{_imrSuccessfulResponses = a})
6706+
6707+-- | The number of impressions that match the buyer\'s inventory
6708+-- pretargeting.
6709+imrInventoryMatches :: Lens' ImpressionMetricsRow (Maybe MetricValue)
6710+imrInventoryMatches
6711+ = lens _imrInventoryMatches
6712+ (\ s a -> s{_imrInventoryMatches = a})
6713+
6714+-- | The number of impressions for which Ad Exchange sent the buyer a bid
6715+-- request.
6716+imrBidRequests :: Lens' ImpressionMetricsRow (Maybe MetricValue)
6717+imrBidRequests
6718+ = lens _imrBidRequests
6719+ (\ s a -> s{_imrBidRequests = a})
6720+
6721+-- | The number of impressions for which Ad Exchange received a response from
6722+-- the buyer that contained at least one applicable bid.
6723+imrResponsesWithBids :: Lens' ImpressionMetricsRow (Maybe MetricValue)
6724+imrResponsesWithBids
6725+ = lens _imrResponsesWithBids
6726+ (\ s a -> s{_imrResponsesWithBids = a})
6727+
6728+instance FromJSON ImpressionMetricsRow where
6729+ parseJSON
6730+ = withObject "ImpressionMetricsRow"
6731+ (\ o ->
6732+ ImpressionMetricsRow' <$>
6733+ (o .:? "rowDimensions") <*>
6734+ (o .:? "availableImpressions")
6735+ <*> (o .:? "successfulResponses")
6736+ <*> (o .:? "inventoryMatches")
6737+ <*> (o .:? "bidRequests")
6738+ <*> (o .:? "responsesWithBids"))
6739+
6740+instance ToJSON ImpressionMetricsRow where
6741+ toJSON ImpressionMetricsRow'{..}
6742+ = object
6743+ (catMaybes
6744+ [("rowDimensions" .=) <$> _imrRowDimensions,
6745+ ("availableImpressions" .=) <$>
6746+ _imrAvailableImpressions,
6747+ ("successfulResponses" .=) <$>
6748+ _imrSuccessfulResponses,
6749+ ("inventoryMatches" .=) <$> _imrInventoryMatches,
6750+ ("bidRequests" .=) <$> _imrBidRequests,
6751+ ("responsesWithBids" .=) <$> _imrResponsesWithBids])
6752+
6753+-- | Specifies the size of the creative.
6754+--
6755+-- /See:/ 'creativeSize' smart constructor.
6756+data CreativeSize = CreativeSize'
6757+ { _csSize :: !(Maybe Size)
6758+ , _csCompanionSizes :: !(Maybe [Size])
6759+ , _csSkippableAdType :: !(Maybe CreativeSizeSkippableAdType)
6760+ , _csCreativeSizeType :: !(Maybe CreativeSizeCreativeSizeType)
6761+ , _csAllowedFormats :: !(Maybe [Text])
6762+ , _csNATiveTemplate :: !(Maybe CreativeSizeNATiveTemplate)
6763+ } deriving (Eq,Show,Data,Typeable,Generic)
6764+
6765+-- | Creates a value of 'CreativeSize' with the minimum fields required to make a request.
6766+--
6767+-- Use one of the following lenses to modify other fields as desired:
6768+--
6769+-- * 'csSize'
6770+--
6771+-- * 'csCompanionSizes'
6772+--
6773+-- * 'csSkippableAdType'
6774+--
6775+-- * 'csCreativeSizeType'
6776+--
6777+-- * 'csAllowedFormats'
6778+--
6779+-- * 'csNATiveTemplate'
6780+creativeSize
6781+ :: CreativeSize
6782+creativeSize =
6783+ CreativeSize'
6784+ { _csSize = Nothing
6785+ , _csCompanionSizes = Nothing
6786+ , _csSkippableAdType = Nothing
6787+ , _csCreativeSizeType = Nothing
6788+ , _csAllowedFormats = Nothing
6789+ , _csNATiveTemplate = Nothing
6790+ }
6791+
6792+-- | For regular or video creative size type, specifies the size of the
6793+-- creative
6794+csSize :: Lens' CreativeSize (Maybe Size)
6795+csSize = lens _csSize (\ s a -> s{_csSize = a})
6796+
6797+-- | For video creatives specifies the sizes of companion ads (if present).
6798+-- Companion sizes may be filled in only when creative_size_type = VIDEO
6799+csCompanionSizes :: Lens' CreativeSize [Size]
6800+csCompanionSizes
6801+ = lens _csCompanionSizes
6802+ (\ s a -> s{_csCompanionSizes = a})
6803+ . _Default
6804+ . _Coerce
6805+
6806+-- | The type of skippable ad for this creative. It will have a value only if
6807+-- creative_size_type = CreativeSizeType.VIDEO.
6808+csSkippableAdType :: Lens' CreativeSize (Maybe CreativeSizeSkippableAdType)
6809+csSkippableAdType
6810+ = lens _csSkippableAdType
6811+ (\ s a -> s{_csSkippableAdType = a})
6812+
6813+-- | The creative size type.
6814+csCreativeSizeType :: Lens' CreativeSize (Maybe CreativeSizeCreativeSizeType)
6815+csCreativeSizeType
6816+ = lens _csCreativeSizeType
6817+ (\ s a -> s{_csCreativeSizeType = a})
6818+
6819+-- | What formats are allowed by the publisher. If this repeated field is
6820+-- empty then all formats are allowed. For example, if this field contains
6821+-- AllowedFormatType.AUDIO then the publisher only allows an audio ad
6822+-- (without any video).
6823+csAllowedFormats :: Lens' CreativeSize [Text]
6824+csAllowedFormats
6825+ = lens _csAllowedFormats
6826+ (\ s a -> s{_csAllowedFormats = a})
6827+ . _Default
6828+ . _Coerce
6829+
6830+-- | The native template for this creative. It will have a value only if
6831+-- creative_size_type = CreativeSizeType.NATIVE. \'OutputOnly
6832+csNATiveTemplate :: Lens' CreativeSize (Maybe CreativeSizeNATiveTemplate)
6833+csNATiveTemplate
6834+ = lens _csNATiveTemplate
6835+ (\ s a -> s{_csNATiveTemplate = a})
6836+
6837+instance FromJSON CreativeSize where
6838+ parseJSON
6839+ = withObject "CreativeSize"
6840+ (\ o ->
6841+ CreativeSize' <$>
6842+ (o .:? "size") <*>
6843+ (o .:? "companionSizes" .!= mempty)
6844+ <*> (o .:? "skippableAdType")
6845+ <*> (o .:? "creativeSizeType")
6846+ <*> (o .:? "allowedFormats" .!= mempty)
6847+ <*> (o .:? "nativeTemplate"))
6848+
6849+instance ToJSON CreativeSize where
6850+ toJSON CreativeSize'{..}
6851+ = object
6852+ (catMaybes
6853+ [("size" .=) <$> _csSize,
6854+ ("companionSizes" .=) <$> _csCompanionSizes,
6855+ ("skippableAdType" .=) <$> _csSkippableAdType,
6856+ ("creativeSizeType" .=) <$> _csCreativeSizeType,
6857+ ("allowedFormats" .=) <$> _csAllowedFormats,
6858+ ("nativeTemplate" .=) <$> _csNATiveTemplate])
6859+
6860+-- | Response message for listing proposals.
6861+--
6862+-- /See:/ 'listProposalsResponse' smart constructor.
6863+data ListProposalsResponse = ListProposalsResponse'
6864+ { _lprProposals :: !(Maybe [Proposal])
6865+ , _lprNextPageToken :: !(Maybe Text)
6866+ } deriving (Eq,Show,Data,Typeable,Generic)
6867+
6868+-- | Creates a value of 'ListProposalsResponse' with the minimum fields required to make a request.
6869+--
6870+-- Use one of the following lenses to modify other fields as desired:
6871+--
6872+-- * 'lprProposals'
6873+--
6874+-- * 'lprNextPageToken'
6875+listProposalsResponse
6876+ :: ListProposalsResponse
6877+listProposalsResponse =
6878+ ListProposalsResponse'
6879+ { _lprProposals = Nothing
6880+ , _lprNextPageToken = Nothing
6881+ }
6882+
6883+-- | The list of proposals.
6884+lprProposals :: Lens' ListProposalsResponse [Proposal]
6885+lprProposals
6886+ = lens _lprProposals (\ s a -> s{_lprProposals = a})
6887+ . _Default
6888+ . _Coerce
6889+
6890+-- | Continuation token for fetching the next page of results.
6891+lprNextPageToken :: Lens' ListProposalsResponse (Maybe Text)
6892+lprNextPageToken
6893+ = lens _lprNextPageToken
6894+ (\ s a -> s{_lprNextPageToken = a})
6895+
6896+instance FromJSON ListProposalsResponse where
6897+ parseJSON
6898+ = withObject "ListProposalsResponse"
6899+ (\ o ->
6900+ ListProposalsResponse' <$>
6901+ (o .:? "proposals" .!= mempty) <*>
6902+ (o .:? "nextPageToken"))
6903+
6904+instance ToJSON ListProposalsResponse where
6905+ toJSON ListProposalsResponse'{..}
6906+ = object
6907+ (catMaybes
6908+ [("proposals" .=) <$> _lprProposals,
6909+ ("nextPageToken" .=) <$> _lprNextPageToken])
6910+
6911+-- | Represents the size of an ad unit that can be targeted on an ad request.
6912+-- It only applies to Private Auction, AdX Preferred Deals and Auction
6913+-- Packages. This targeting does not apply to Programmatic Guaranteed and
6914+-- Preferred Deals in Ad Manager.
6915+--
6916+-- /See:/ 'inventorySizeTargeting' smart constructor.
6917+data InventorySizeTargeting = InventorySizeTargeting'
6918+ { _istTargetedInventorySizes :: !(Maybe [AdSize])
6919+ , _istExcludedInventorySizes :: !(Maybe [AdSize])
6920+ } deriving (Eq,Show,Data,Typeable,Generic)
6921+
6922+-- | Creates a value of 'InventorySizeTargeting' with the minimum fields required to make a request.
6923+--
6924+-- Use one of the following lenses to modify other fields as desired:
6925+--
6926+-- * 'istTargetedInventorySizes'
6927+--
6928+-- * 'istExcludedInventorySizes'
6929+inventorySizeTargeting
6930+ :: InventorySizeTargeting
6931+inventorySizeTargeting =
6932+ InventorySizeTargeting'
6933+ { _istTargetedInventorySizes = Nothing
6934+ , _istExcludedInventorySizes = Nothing
6935+ }
6936+
6937+-- | A list of inventory sizes to be included.
6938+istTargetedInventorySizes :: Lens' InventorySizeTargeting [AdSize]
6939+istTargetedInventorySizes
6940+ = lens _istTargetedInventorySizes
6941+ (\ s a -> s{_istTargetedInventorySizes = a})
6942+ . _Default
6943+ . _Coerce
6944+
6945+-- | A list of inventory sizes to be excluded.
6946+istExcludedInventorySizes :: Lens' InventorySizeTargeting [AdSize]
6947+istExcludedInventorySizes
6948+ = lens _istExcludedInventorySizes
6949+ (\ s a -> s{_istExcludedInventorySizes = a})
6950+ . _Default
6951+ . _Coerce
6952+
6953+instance FromJSON InventorySizeTargeting where
6954+ parseJSON
6955+ = withObject "InventorySizeTargeting"
6956+ (\ o ->
6957+ InventorySizeTargeting' <$>
6958+ (o .:? "targetedInventorySizes" .!= mempty) <*>
6959+ (o .:? "excludedInventorySizes" .!= mempty))
6960+
6961+instance ToJSON InventorySizeTargeting where
6962+ toJSON InventorySizeTargeting'{..}
6963+ = object
6964+ (catMaybes
6965+ [("targetedInventorySizes" .=) <$>
6966+ _istTargetedInventorySizes,
6967+ ("excludedInventorySizes" .=) <$>
6968+ _istExcludedInventorySizes])
6969+
6970+-- | The deal terms specify the details of a Product\/deal. They specify
6971+-- things like price per buyer, the type of pricing model (e.g., fixed
6972+-- price, auction) and expected impressions from the publisher.
6973+--
6974+-- /See:/ 'dealTerms' smart constructor.
6975+data DealTerms = DealTerms'
6976+ { _dtEstimatedGrossSpend :: !(Maybe Price)
6977+ , _dtNonGuaranteedFixedPriceTerms :: !(Maybe NonGuaranteedFixedPriceTerms)
6978+ , _dtNonGuaranteedAuctionTerms :: !(Maybe NonGuaranteedAuctionTerms)
6979+ , _dtBrandingType :: !(Maybe DealTermsBrandingType)
6980+ , _dtEstimatedImpressionsPerDay :: !(Maybe (Textual Int64))
6981+ , _dtSellerTimeZone :: !(Maybe Text)
6982+ , _dtGuaranteedFixedPriceTerms :: !(Maybe GuaranteedFixedPriceTerms)
6983+ , _dtDescription :: !(Maybe Text)
6984+ } deriving (Eq,Show,Data,Typeable,Generic)
6985+
6986+-- | Creates a value of 'DealTerms' with the minimum fields required to make a request.
6987+--
6988+-- Use one of the following lenses to modify other fields as desired:
6989+--
6990+-- * 'dtEstimatedGrossSpend'
6991+--
6992+-- * 'dtNonGuaranteedFixedPriceTerms'
6993+--
6994+-- * 'dtNonGuaranteedAuctionTerms'
6995+--
6996+-- * 'dtBrandingType'
6997+--
6998+-- * 'dtEstimatedImpressionsPerDay'
6999+--
7000+-- * 'dtSellerTimeZone'
7001+--
7002+-- * 'dtGuaranteedFixedPriceTerms'
7003+--
7004+-- * 'dtDescription'
7005+dealTerms
7006+ :: DealTerms
7007+dealTerms =
7008+ DealTerms'
7009+ { _dtEstimatedGrossSpend = Nothing
7010+ , _dtNonGuaranteedFixedPriceTerms = Nothing
7011+ , _dtNonGuaranteedAuctionTerms = Nothing
7012+ , _dtBrandingType = Nothing
7013+ , _dtEstimatedImpressionsPerDay = Nothing
7014+ , _dtSellerTimeZone = Nothing
7015+ , _dtGuaranteedFixedPriceTerms = Nothing
7016+ , _dtDescription = Nothing
7017+ }
7018+
7019+-- | Non-binding estimate of the estimated gross spend for this deal. Can be
7020+-- set by buyer or seller.
7021+dtEstimatedGrossSpend :: Lens' DealTerms (Maybe Price)
7022+dtEstimatedGrossSpend
7023+ = lens _dtEstimatedGrossSpend
7024+ (\ s a -> s{_dtEstimatedGrossSpend = a})
7025+
7026+-- | The terms for non-guaranteed fixed price deals.
7027+dtNonGuaranteedFixedPriceTerms :: Lens' DealTerms (Maybe NonGuaranteedFixedPriceTerms)
7028+dtNonGuaranteedFixedPriceTerms
7029+ = lens _dtNonGuaranteedFixedPriceTerms
7030+ (\ s a -> s{_dtNonGuaranteedFixedPriceTerms = a})
7031+
7032+-- | The terms for non-guaranteed auction deals.
7033+dtNonGuaranteedAuctionTerms :: Lens' DealTerms (Maybe NonGuaranteedAuctionTerms)
7034+dtNonGuaranteedAuctionTerms
7035+ = lens _dtNonGuaranteedAuctionTerms
7036+ (\ s a -> s{_dtNonGuaranteedAuctionTerms = a})
7037+
7038+-- | Visibility of the URL in bid requests. (default: BRANDED)
7039+dtBrandingType :: Lens' DealTerms (Maybe DealTermsBrandingType)
7040+dtBrandingType
7041+ = lens _dtBrandingType
7042+ (\ s a -> s{_dtBrandingType = a})
7043+
7044+-- | Non-binding estimate of the impressions served per day. Can be set by
7045+-- buyer or seller.
7046+dtEstimatedImpressionsPerDay :: Lens' DealTerms (Maybe Int64)
7047+dtEstimatedImpressionsPerDay
7048+ = lens _dtEstimatedImpressionsPerDay
7049+ (\ s a -> s{_dtEstimatedImpressionsPerDay = a})
7050+ . mapping _Coerce
7051+
7052+-- | The time zone name. For deals with Cost Per Day billing, defines the
7053+-- time zone used to mark the boundaries of a day. It should be an IANA TZ
7054+-- name, such as \"America\/Los_Angeles\". For more information, see
7055+-- https:\/\/en.wikipedia.org\/wiki\/List_of_tz_database_time_zones.
7056+dtSellerTimeZone :: Lens' DealTerms (Maybe Text)
7057+dtSellerTimeZone
7058+ = lens _dtSellerTimeZone
7059+ (\ s a -> s{_dtSellerTimeZone = a})
7060+
7061+-- | The terms for guaranteed fixed price deals.
7062+dtGuaranteedFixedPriceTerms :: Lens' DealTerms (Maybe GuaranteedFixedPriceTerms)
7063+dtGuaranteedFixedPriceTerms
7064+ = lens _dtGuaranteedFixedPriceTerms
7065+ (\ s a -> s{_dtGuaranteedFixedPriceTerms = a})
7066+
7067+-- | Publisher provided description for the terms.
7068+dtDescription :: Lens' DealTerms (Maybe Text)
7069+dtDescription
7070+ = lens _dtDescription
7071+ (\ s a -> s{_dtDescription = a})
7072+
7073+instance FromJSON DealTerms where
7074+ parseJSON
7075+ = withObject "DealTerms"
7076+ (\ o ->
7077+ DealTerms' <$>
7078+ (o .:? "estimatedGrossSpend") <*>
7079+ (o .:? "nonGuaranteedFixedPriceTerms")
7080+ <*> (o .:? "nonGuaranteedAuctionTerms")
7081+ <*> (o .:? "brandingType")
7082+ <*> (o .:? "estimatedImpressionsPerDay")
7083+ <*> (o .:? "sellerTimeZone")
7084+ <*> (o .:? "guaranteedFixedPriceTerms")
7085+ <*> (o .:? "description"))
7086+
7087+instance ToJSON DealTerms where
7088+ toJSON DealTerms'{..}
7089+ = object
7090+ (catMaybes
7091+ [("estimatedGrossSpend" .=) <$>
7092+ _dtEstimatedGrossSpend,
7093+ ("nonGuaranteedFixedPriceTerms" .=) <$>
7094+ _dtNonGuaranteedFixedPriceTerms,
7095+ ("nonGuaranteedAuctionTerms" .=) <$>
7096+ _dtNonGuaranteedAuctionTerms,
7097+ ("brandingType" .=) <$> _dtBrandingType,
7098+ ("estimatedImpressionsPerDay" .=) <$>
7099+ _dtEstimatedImpressionsPerDay,
7100+ ("sellerTimeZone" .=) <$> _dtSellerTimeZone,
7101+ ("guaranteedFixedPriceTerms" .=) <$>
7102+ _dtGuaranteedFixedPriceTerms,
7103+ ("description" .=) <$> _dtDescription])
7104+
7105+-- | \'OutputOnly Filtering reasons for this creative during a period of a
7106+-- single day (from midnight to midnight Pacific).
7107+--
7108+-- /See:/ 'filteringStats' smart constructor.
7109+data FilteringStats = FilteringStats'
7110+ { _fsReasons :: !(Maybe [Reason])
7111+ , _fsDate :: !(Maybe Date)
7112+ } deriving (Eq,Show,Data,Typeable,Generic)
7113+
7114+-- | Creates a value of 'FilteringStats' with the minimum fields required to make a request.
7115+--
7116+-- Use one of the following lenses to modify other fields as desired:
7117+--
7118+-- * 'fsReasons'
7119+--
7120+-- * 'fsDate'
7121+filteringStats
7122+ :: FilteringStats
7123+filteringStats =
7124+ FilteringStats'
7125+ { _fsReasons = Nothing
7126+ , _fsDate = Nothing
7127+ }
7128+
7129+-- | The set of filtering reasons for this date.
7130+fsReasons :: Lens' FilteringStats [Reason]
7131+fsReasons
7132+ = lens _fsReasons (\ s a -> s{_fsReasons = a}) .
7133+ _Default
7134+ . _Coerce
7135+
7136+-- | The day during which the data was collected. The data is collected from
7137+-- 00:00:00 to 23:59:59 PT. During switches from PST to PDT and back, the
7138+-- day may contain 23 or 25 hours of data instead of the usual 24.
7139+fsDate :: Lens' FilteringStats (Maybe Date)
7140+fsDate = lens _fsDate (\ s a -> s{_fsDate = a})
7141+
7142+instance FromJSON FilteringStats where
7143+ parseJSON
7144+ = withObject "FilteringStats"
7145+ (\ o ->
7146+ FilteringStats' <$>
7147+ (o .:? "reasons" .!= mempty) <*> (o .:? "date"))
7148+
7149+instance ToJSON FilteringStats where
7150+ toJSON FilteringStats'{..}
7151+ = object
7152+ (catMaybes
7153+ [("reasons" .=) <$> _fsReasons,
7154+ ("date" .=) <$> _fsDate])
7155+
7156+-- | An invitation for a new client user to get access to the Authorized
7157+-- Buyers UI. All fields are required unless otherwise specified.
7158+--
7159+-- /See:/ 'clientUserInvitation' smart constructor.
7160+data ClientUserInvitation = ClientUserInvitation'
7161+ { _cuiEmail :: !(Maybe Text)
7162+ , _cuiInvitationId :: !(Maybe (Textual Int64))
7163+ , _cuiClientAccountId :: !(Maybe (Textual Int64))
7164+ } deriving (Eq,Show,Data,Typeable,Generic)
7165+
7166+-- | Creates a value of 'ClientUserInvitation' with the minimum fields required to make a request.
7167+--
7168+-- Use one of the following lenses to modify other fields as desired:
7169+--
7170+-- * 'cuiEmail'
7171+--
7172+-- * 'cuiInvitationId'
7173+--
7174+-- * 'cuiClientAccountId'
7175+clientUserInvitation
7176+ :: ClientUserInvitation
7177+clientUserInvitation =
7178+ ClientUserInvitation'
7179+ { _cuiEmail = Nothing
7180+ , _cuiInvitationId = Nothing
7181+ , _cuiClientAccountId = Nothing
7182+ }
7183+
7184+-- | The email address to which the invitation is sent. Email addresses
7185+-- should be unique among all client users under each sponsor buyer.
7186+cuiEmail :: Lens' ClientUserInvitation (Maybe Text)
7187+cuiEmail = lens _cuiEmail (\ s a -> s{_cuiEmail = a})
7188+
7189+-- | The unique numerical ID of the invitation that is sent to the user. The
7190+-- value of this field is ignored in create operations.
7191+cuiInvitationId :: Lens' ClientUserInvitation (Maybe Int64)
7192+cuiInvitationId
7193+ = lens _cuiInvitationId
7194+ (\ s a -> s{_cuiInvitationId = a})
7195+ . mapping _Coerce
7196+
7197+-- | Numerical account ID of the client buyer that the invited user is
7198+-- associated with. The value of this field is ignored in create
7199+-- operations.
7200+cuiClientAccountId :: Lens' ClientUserInvitation (Maybe Int64)
7201+cuiClientAccountId
7202+ = lens _cuiClientAccountId
7203+ (\ s a -> s{_cuiClientAccountId = a})
7204+ . mapping _Coerce
7205+
7206+instance FromJSON ClientUserInvitation where
7207+ parseJSON
7208+ = withObject "ClientUserInvitation"
7209+ (\ o ->
7210+ ClientUserInvitation' <$>
7211+ (o .:? "email") <*> (o .:? "invitationId") <*>
7212+ (o .:? "clientAccountId"))
7213+
7214+instance ToJSON ClientUserInvitation where
7215+ toJSON ClientUserInvitation'{..}
7216+ = object
7217+ (catMaybes
7218+ [("email" .=) <$> _cuiEmail,
7219+ ("invitationId" .=) <$> _cuiInvitationId,
7220+ ("clientAccountId" .=) <$> _cuiClientAccountId])
7221+
7222+-- | The number of winning bids with the specified dimension values for which
7223+-- the buyer was not billed, as described by the specified status.
7224+--
7225+-- /See:/ 'nonBillableWinningBidStatusRow' smart constructor.
7226+data NonBillableWinningBidStatusRow = NonBillableWinningBidStatusRow'
7227+ { _nbwbsrStatus :: !(Maybe NonBillableWinningBidStatusRowStatus)
7228+ , _nbwbsrRowDimensions :: !(Maybe RowDimensions)
7229+ , _nbwbsrBidCount :: !(Maybe MetricValue)
7230+ } deriving (Eq,Show,Data,Typeable,Generic)
7231+
7232+-- | Creates a value of 'NonBillableWinningBidStatusRow' with the minimum fields required to make a request.
7233+--
7234+-- Use one of the following lenses to modify other fields as desired:
7235+--
7236+-- * 'nbwbsrStatus'
7237+--
7238+-- * 'nbwbsrRowDimensions'
7239+--
7240+-- * 'nbwbsrBidCount'
7241+nonBillableWinningBidStatusRow
7242+ :: NonBillableWinningBidStatusRow
7243+nonBillableWinningBidStatusRow =
7244+ NonBillableWinningBidStatusRow'
7245+ { _nbwbsrStatus = Nothing
7246+ , _nbwbsrRowDimensions = Nothing
7247+ , _nbwbsrBidCount = Nothing
7248+ }
7249+
7250+-- | The status specifying why the winning bids were not billed.
7251+nbwbsrStatus :: Lens' NonBillableWinningBidStatusRow (Maybe NonBillableWinningBidStatusRowStatus)
7252+nbwbsrStatus
7253+ = lens _nbwbsrStatus (\ s a -> s{_nbwbsrStatus = a})
7254+
7255+-- | The values of all dimensions associated with metric values in this row.
7256+nbwbsrRowDimensions :: Lens' NonBillableWinningBidStatusRow (Maybe RowDimensions)
7257+nbwbsrRowDimensions
7258+ = lens _nbwbsrRowDimensions
7259+ (\ s a -> s{_nbwbsrRowDimensions = a})
7260+
7261+-- | The number of bids with the specified status.
7262+nbwbsrBidCount :: Lens' NonBillableWinningBidStatusRow (Maybe MetricValue)
7263+nbwbsrBidCount
7264+ = lens _nbwbsrBidCount
7265+ (\ s a -> s{_nbwbsrBidCount = a})
7266+
7267+instance FromJSON NonBillableWinningBidStatusRow
7268+ where
7269+ parseJSON
7270+ = withObject "NonBillableWinningBidStatusRow"
7271+ (\ o ->
7272+ NonBillableWinningBidStatusRow' <$>
7273+ (o .:? "status") <*> (o .:? "rowDimensions") <*>
7274+ (o .:? "bidCount"))
7275+
7276+instance ToJSON NonBillableWinningBidStatusRow where
7277+ toJSON NonBillableWinningBidStatusRow'{..}
7278+ = object
7279+ (catMaybes
7280+ [("status" .=) <$> _nbwbsrStatus,
7281+ ("rowDimensions" .=) <$> _nbwbsrRowDimensions,
7282+ ("bidCount" .=) <$> _nbwbsrBidCount])
7283+
7284+-- | Response message for listing products visible to the buyer.
7285+--
7286+-- /See:/ 'listProductsResponse' smart constructor.
7287+data ListProductsResponse = ListProductsResponse'
7288+ { _lisNextPageToken :: !(Maybe Text)
7289+ , _lisProducts :: !(Maybe [Product])
7290+ } deriving (Eq,Show,Data,Typeable,Generic)
7291+
7292+-- | Creates a value of 'ListProductsResponse' with the minimum fields required to make a request.
7293+--
7294+-- Use one of the following lenses to modify other fields as desired:
7295+--
7296+-- * 'lisNextPageToken'
7297+--
7298+-- * 'lisProducts'
7299+listProductsResponse
7300+ :: ListProductsResponse
7301+listProductsResponse =
7302+ ListProductsResponse'
7303+ { _lisNextPageToken = Nothing
7304+ , _lisProducts = Nothing
7305+ }
7306+
7307+-- | List pagination support.
7308+lisNextPageToken :: Lens' ListProductsResponse (Maybe Text)
7309+lisNextPageToken
7310+ = lens _lisNextPageToken
7311+ (\ s a -> s{_lisNextPageToken = a})
7312+
7313+-- | The list of matching products at their head revision number.
7314+lisProducts :: Lens' ListProductsResponse [Product]
7315+lisProducts
7316+ = lens _lisProducts (\ s a -> s{_lisProducts = a}) .
7317+ _Default
7318+ . _Coerce
7319+
7320+instance FromJSON ListProductsResponse where
7321+ parseJSON
7322+ = withObject "ListProductsResponse"
7323+ (\ o ->
7324+ ListProductsResponse' <$>
7325+ (o .:? "nextPageToken") <*>
7326+ (o .:? "products" .!= mempty))
7327+
7328+instance ToJSON ListProductsResponse where
7329+ toJSON ListProductsResponse'{..}
7330+ = object
7331+ (catMaybes
7332+ [("nextPageToken" .=) <$> _lisNextPageToken,
7333+ ("products" .=) <$> _lisProducts])
7334+
7335+-- | Represents a buyer of inventory. Each buyer is identified by a unique
7336+-- Authorized Buyers account ID.
7337+--
7338+-- /See:/ 'buyer' smart constructor.
7339+newtype Buyer = Buyer'
7340+ { _bAccountId :: Maybe Text
7341+ } deriving (Eq,Show,Data,Typeable,Generic)
7342+
7343+-- | Creates a value of 'Buyer' with the minimum fields required to make a request.
7344+--
7345+-- Use one of the following lenses to modify other fields as desired:
7346+--
7347+-- * 'bAccountId'
7348+buyer
7349+ :: Buyer
7350+buyer =
7351+ Buyer'
7352+ { _bAccountId = Nothing
7353+ }
7354+
7355+-- | Authorized Buyers account ID of the buyer.
7356+bAccountId :: Lens' Buyer (Maybe Text)
7357+bAccountId
7358+ = lens _bAccountId (\ s a -> s{_bAccountId = a})
7359+
7360+instance FromJSON Buyer where
7361+ parseJSON
7362+ = withObject "Buyer"
7363+ (\ o -> Buyer' <$> (o .:? "accountId"))
7364+
7365+instance ToJSON Buyer where
7366+ toJSON Buyer'{..}
7367+ = object
7368+ (catMaybes [("accountId" .=) <$> _bAccountId])
7369+
7370+-- | Response message for listing the metrics that are measured in number of
7371+-- bids.
7372+--
7373+-- /See:/ 'listBidMetricsResponse' smart constructor.
7374+data ListBidMetricsResponse = ListBidMetricsResponse'
7375+ { _lbmrNextPageToken :: !(Maybe Text)
7376+ , _lbmrBidMetricsRows :: !(Maybe [BidMetricsRow])
7377+ } deriving (Eq,Show,Data,Typeable,Generic)
7378+
7379+-- | Creates a value of 'ListBidMetricsResponse' with the minimum fields required to make a request.
7380+--
7381+-- Use one of the following lenses to modify other fields as desired:
7382+--
7383+-- * 'lbmrNextPageToken'
7384+--
7385+-- * 'lbmrBidMetricsRows'
7386+listBidMetricsResponse
7387+ :: ListBidMetricsResponse
7388+listBidMetricsResponse =
7389+ ListBidMetricsResponse'
7390+ { _lbmrNextPageToken = Nothing
7391+ , _lbmrBidMetricsRows = Nothing
7392+ }
7393+
7394+-- | A token to retrieve the next page of results. Pass this value in the
7395+-- ListBidMetricsRequest.pageToken field in the subsequent call to the
7396+-- bidMetrics.list method to retrieve the next page of results.
7397+lbmrNextPageToken :: Lens' ListBidMetricsResponse (Maybe Text)
7398+lbmrNextPageToken
7399+ = lens _lbmrNextPageToken
7400+ (\ s a -> s{_lbmrNextPageToken = a})
7401+
7402+-- | List of rows, each containing a set of bid metrics.
7403+lbmrBidMetricsRows :: Lens' ListBidMetricsResponse [BidMetricsRow]
7404+lbmrBidMetricsRows
7405+ = lens _lbmrBidMetricsRows
7406+ (\ s a -> s{_lbmrBidMetricsRows = a})
7407+ . _Default
7408+ . _Coerce
7409+
7410+instance FromJSON ListBidMetricsResponse where
7411+ parseJSON
7412+ = withObject "ListBidMetricsResponse"
7413+ (\ o ->
7414+ ListBidMetricsResponse' <$>
7415+ (o .:? "nextPageToken") <*>
7416+ (o .:? "bidMetricsRows" .!= mempty))
7417+
7418+instance ToJSON ListBidMetricsResponse where
7419+ toJSON ListBidMetricsResponse'{..}
7420+ = object
7421+ (catMaybes
7422+ [("nextPageToken" .=) <$> _lbmrNextPageToken,
7423+ ("bidMetricsRows" .=) <$> _lbmrBidMetricsRows])
7424+
7425+-- | A client resource represents a client buyer—an agency, a brand, or an
7426+-- advertiser customer of the sponsor buyer. Users associated with the
7427+-- client buyer have restricted access to the Marketplace and certain other
7428+-- sections of the Authorized Buyers UI based on the role granted to the
7429+-- client buyer. All fields are required unless otherwise specified.
7430+--
7431+-- /See:/ 'client' smart constructor.
7432+data Client = Client'
7433+ { _cEntityName :: !(Maybe Text)
7434+ , _cStatus :: !(Maybe ClientStatus)
7435+ , _cEntityType :: !(Maybe ClientEntityType)
7436+ , _cRole :: !(Maybe ClientRole)
7437+ , _cVisibleToSeller :: !(Maybe Bool)
7438+ , _cPartnerClientId :: !(Maybe Text)
7439+ , _cClientAccountId :: !(Maybe (Textual Int64))
7440+ , _cClientName :: !(Maybe Text)
7441+ , _cEntityId :: !(Maybe (Textual Int64))
7442+ } deriving (Eq,Show,Data,Typeable,Generic)
7443+
7444+-- | Creates a value of 'Client' with the minimum fields required to make a request.
7445+--
7446+-- Use one of the following lenses to modify other fields as desired:
7447+--
7448+-- * 'cEntityName'
7449+--
7450+-- * 'cStatus'
7451+--
7452+-- * 'cEntityType'
7453+--
7454+-- * 'cRole'
7455+--
7456+-- * 'cVisibleToSeller'
7457+--
7458+-- * 'cPartnerClientId'
7459+--
7460+-- * 'cClientAccountId'
7461+--
7462+-- * 'cClientName'
7463+--
7464+-- * 'cEntityId'
7465+client
7466+ :: Client
7467+client =
7468+ Client'
7469+ { _cEntityName = Nothing
7470+ , _cStatus = Nothing
7471+ , _cEntityType = Nothing
7472+ , _cRole = Nothing
7473+ , _cVisibleToSeller = Nothing
7474+ , _cPartnerClientId = Nothing
7475+ , _cClientAccountId = Nothing
7476+ , _cClientName = Nothing
7477+ , _cEntityId = Nothing
7478+ }
7479+
7480+-- | The name of the entity. This field is automatically fetched based on the
7481+-- type and ID. The value of this field is ignored in create and update
7482+-- operations.
7483+cEntityName :: Lens' Client (Maybe Text)
7484+cEntityName
7485+ = lens _cEntityName (\ s a -> s{_cEntityName = a})
7486+
7487+-- | The status of the client buyer.
7488+cStatus :: Lens' Client (Maybe ClientStatus)
7489+cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
7490+
7491+-- | The type of the client entity: \`ADVERTISER\`, \`BRAND\`, or \`AGENCY\`.
7492+cEntityType :: Lens' Client (Maybe ClientEntityType)
7493+cEntityType
7494+ = lens _cEntityType (\ s a -> s{_cEntityType = a})
7495+
7496+-- | The role which is assigned to the client buyer. Each role implies a set
7497+-- of permissions granted to the client. Must be one of
7498+-- \`CLIENT_DEAL_VIEWER\`, \`CLIENT_DEAL_NEGOTIATOR\` or
7499+-- \`CLIENT_DEAL_APPROVER\`.
7500+cRole :: Lens' Client (Maybe ClientRole)
7501+cRole = lens _cRole (\ s a -> s{_cRole = a})
7502+
7503+-- | Whether the client buyer will be visible to sellers.
7504+cVisibleToSeller :: Lens' Client (Maybe Bool)
7505+cVisibleToSeller
7506+ = lens _cVisibleToSeller
7507+ (\ s a -> s{_cVisibleToSeller = a})
7508+
7509+-- | Optional arbitrary unique identifier of this client buyer from the
7510+-- standpoint of its Ad Exchange sponsor buyer. This field can be used to
7511+-- associate a client buyer with the identifier in the namespace of its
7512+-- sponsor buyer, lookup client buyers by that identifier and verify
7513+-- whether an Ad Exchange counterpart of a given client buyer already
7514+-- exists. If present, must be unique among all the client buyers for its
7515+-- Ad Exchange sponsor buyer.
7516+cPartnerClientId :: Lens' Client (Maybe Text)
7517+cPartnerClientId
7518+ = lens _cPartnerClientId
7519+ (\ s a -> s{_cPartnerClientId = a})
7520+
7521+-- | The globally-unique numerical ID of the client. The value of this field
7522+-- is ignored in create and update operations.
7523+cClientAccountId :: Lens' Client (Maybe Int64)
7524+cClientAccountId
7525+ = lens _cClientAccountId
7526+ (\ s a -> s{_cClientAccountId = a})
7527+ . mapping _Coerce
7528+
7529+-- | Name used to represent this client to publishers. You may have multiple
7530+-- clients that map to the same entity, but for each client the combination
7531+-- of \`clientName\` and entity must be unique. You can specify this field
7532+-- as empty.
7533+cClientName :: Lens' Client (Maybe Text)
7534+cClientName
7535+ = lens _cClientName (\ s a -> s{_cClientName = a})
7536+
7537+-- | Numerical identifier of the client entity. The entity can be an
7538+-- advertiser, a brand, or an agency. This identifier is unique among all
7539+-- the entities with the same type. A list of all known advertisers with
7540+-- their identifiers is available in the
7541+-- [advertisers.txt](https:\/\/storage.googleapis.com\/adx-rtb-dictionaries\/advertisers.txt)
7542+-- file. A list of all known brands with their identifiers is available in
7543+-- the
7544+-- [brands.txt](https:\/\/storage.googleapis.com\/adx-rtb-dictionaries\/brands.txt)
7545+-- file. A list of all known agencies with their identifiers is available
7546+-- in the
7547+-- [agencies.txt](https:\/\/storage.googleapis.com\/adx-rtb-dictionaries\/agencies.txt)
7548+-- file.
7549+cEntityId :: Lens' Client (Maybe Int64)
7550+cEntityId
7551+ = lens _cEntityId (\ s a -> s{_cEntityId = a}) .
7552+ mapping _Coerce
7553+
7554+instance FromJSON Client where
7555+ parseJSON
7556+ = withObject "Client"
7557+ (\ o ->
7558+ Client' <$>
7559+ (o .:? "entityName") <*> (o .:? "status") <*>
7560+ (o .:? "entityType")
7561+ <*> (o .:? "role")
7562+ <*> (o .:? "visibleToSeller")
7563+ <*> (o .:? "partnerClientId")
7564+ <*> (o .:? "clientAccountId")
7565+ <*> (o .:? "clientName")
7566+ <*> (o .:? "entityId"))
7567+
7568+instance ToJSON Client where
7569+ toJSON Client'{..}
7570+ = object
7571+ (catMaybes
7572+ [("entityName" .=) <$> _cEntityName,
7573+ ("status" .=) <$> _cStatus,
7574+ ("entityType" .=) <$> _cEntityType,
7575+ ("role" .=) <$> _cRole,
7576+ ("visibleToSeller" .=) <$> _cVisibleToSeller,
7577+ ("partnerClientId" .=) <$> _cPartnerClientId,
7578+ ("clientAccountId" .=) <$> _cClientAccountId,
7579+ ("clientName" .=) <$> _cClientName,
7580+ ("entityId" .=) <$> _cEntityId])
7581+
7582+-- | \'OutputOnly The reason and details for a disapproval.
7583+--
7584+-- /See:/ 'disApproval' smart constructor.
7585+data DisApproval = DisApproval'
7586+ { _daReason :: !(Maybe DisApprovalReason)
7587+ , _daDetails :: !(Maybe [Text])
7588+ } deriving (Eq,Show,Data,Typeable,Generic)
7589+
7590+-- | Creates a value of 'DisApproval' with the minimum fields required to make a request.
7591+--
7592+-- Use one of the following lenses to modify other fields as desired:
7593+--
7594+-- * 'daReason'
7595+--
7596+-- * 'daDetails'
7597+disApproval
7598+ :: DisApproval
7599+disApproval =
7600+ DisApproval'
7601+ { _daReason = Nothing
7602+ , _daDetails = Nothing
7603+ }
7604+
7605+-- | The categorized reason for disapproval.
7606+daReason :: Lens' DisApproval (Maybe DisApprovalReason)
7607+daReason = lens _daReason (\ s a -> s{_daReason = a})
7608+
7609+-- | Additional details about the reason for disapproval.
7610+daDetails :: Lens' DisApproval [Text]
7611+daDetails
7612+ = lens _daDetails (\ s a -> s{_daDetails = a}) .
7613+ _Default
7614+ . _Coerce
7615+
7616+instance FromJSON DisApproval where
7617+ parseJSON
7618+ = withObject "DisApproval"
7619+ (\ o ->
7620+ DisApproval' <$>
7621+ (o .:? "reason") <*> (o .:? "details" .!= mempty))
7622+
7623+instance ToJSON DisApproval where
7624+ toJSON DisApproval'{..}
7625+ = object
7626+ (catMaybes
7627+ [("reason" .=) <$> _daReason,
7628+ ("details" .=) <$> _daDetails])