@@ -0,0 +1,6898 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE OverloadedStrings #-}
4+{-# LANGUAGE RecordWildCards #-}
5+
6+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
7+
8+-- |
9+-- Module : Network.Google.AdExchangeBuyer.Types.Product
10+-- Copyright : (c) 2015 Brendan Hay
11+-- License : Mozilla Public License, v. 2.0.
12+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
13+-- Stability : auto-generated
14+-- Portability : non-portable (GHC extensions)
15+--
16+module Network.Google.AdExchangeBuyer.Types.Product where
17+
18+import Network.Google.AdExchangeBuyer.Types.Sum
19+import Network.Google.Prelude
20+
21+--
22+-- /See:/ 'brandDto' smart constructor.
23+data BrandDto = BrandDto
24+ { _bdAdvertiserId :: !(Maybe Int64)
25+ , _bdName :: !(Maybe Text)
26+ , _bdId :: !(Maybe Int64)
27+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
28+
29+-- | Creates a value of 'BrandDto' with the minimum fields required to make a request.
30+--
31+-- Use one of the following lenses to modify other fields as desired:
32+--
33+-- * 'bdAdvertiserId'
34+--
35+-- * 'bdName'
36+--
37+-- * 'bdId'
38+brandDto
39+ :: BrandDto
40+brandDto =
41+ BrandDto
42+ { _bdAdvertiserId = Nothing
43+ , _bdName = Nothing
44+ , _bdId = Nothing
45+ }
46+
47+bdAdvertiserId :: Lens' BrandDto (Maybe Int64)
48+bdAdvertiserId
49+ = lens _bdAdvertiserId
50+ (\ s a -> s{_bdAdvertiserId = a})
51+
52+bdName :: Lens' BrandDto (Maybe Text)
53+bdName = lens _bdName (\ s a -> s{_bdName = a})
54+
55+bdId :: Lens' BrandDto (Maybe Int64)
56+bdId = lens _bdId (\ s a -> s{_bdId = a})
57+
58+instance FromJSON BrandDto where
59+ parseJSON
60+ = withObject "BrandDto"
61+ (\ o ->
62+ BrandDto <$>
63+ (o .:? "advertiserId") <*> (o .:? "name") <*>
64+ (o .:? "id"))
65+
66+instance ToJSON BrandDto where
67+ toJSON BrandDto{..}
68+ = object
69+ (catMaybes
70+ [("advertiserId" .=) <$> _bdAdvertiserId,
71+ ("name" .=) <$> _bdName, ("id" .=) <$> _bdId])
72+
73+--
74+-- /See:/ 'editAllOrderDealsResponse' smart constructor.
75+newtype EditAllOrderDealsResponse = EditAllOrderDealsResponse
76+ { _eaodrDeals :: Maybe [Maybe MarketplaceDeal]
77+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
78+
79+-- | Creates a value of 'EditAllOrderDealsResponse' with the minimum fields required to make a request.
80+--
81+-- Use one of the following lenses to modify other fields as desired:
82+--
83+-- * 'eaodrDeals'
84+editAllOrderDealsResponse
85+ :: EditAllOrderDealsResponse
86+editAllOrderDealsResponse =
87+ EditAllOrderDealsResponse
88+ { _eaodrDeals = Nothing
89+ }
90+
91+-- | List of all deals in the order after edit.
92+eaodrDeals :: Lens' EditAllOrderDealsResponse [Maybe MarketplaceDeal]
93+eaodrDeals
94+ = lens _eaodrDeals (\ s a -> s{_eaodrDeals = a}) .
95+ _Default
96+ . _Coerce
97+
98+instance FromJSON EditAllOrderDealsResponse where
99+ parseJSON
100+ = withObject "EditAllOrderDealsResponse"
101+ (\ o ->
102+ EditAllOrderDealsResponse <$>
103+ (o .:? "deals" .!= mempty))
104+
105+instance ToJSON EditAllOrderDealsResponse where
106+ toJSON EditAllOrderDealsResponse{..}
107+ = object (catMaybes [("deals" .=) <$> _eaodrDeals])
108+
109+-- | An order is associated with a bunch of notes which may optionally be
110+-- associated with a deal and\/or revision number.
111+--
112+-- /See:/ 'marketplaceNote' smart constructor.
113+data MarketplaceNote = MarketplaceNote
114+ { _mnNote :: !(Maybe Text)
115+ , _mnKind :: !Text
116+ , _mnTimestampMs :: !(Maybe Int64)
117+ , _mnDealId :: !(Maybe Text)
118+ , _mnNoteId :: !(Maybe Text)
119+ , _mnCreatorRole :: !(Maybe Text)
120+ , _mnOrderId :: !(Maybe Text)
121+ , _mnOrderRevisionNumber :: !(Maybe Int64)
122+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
123+
124+-- | Creates a value of 'MarketplaceNote' with the minimum fields required to make a request.
125+--
126+-- Use one of the following lenses to modify other fields as desired:
127+--
128+-- * 'mnNote'
129+--
130+-- * 'mnKind'
131+--
132+-- * 'mnTimestampMs'
133+--
134+-- * 'mnDealId'
135+--
136+-- * 'mnNoteId'
137+--
138+-- * 'mnCreatorRole'
139+--
140+-- * 'mnOrderId'
141+--
142+-- * 'mnOrderRevisionNumber'
143+marketplaceNote
144+ :: MarketplaceNote
145+marketplaceNote =
146+ MarketplaceNote
147+ { _mnNote = Nothing
148+ , _mnKind = "adexchangebuyer#marketplaceNote"
149+ , _mnTimestampMs = Nothing
150+ , _mnDealId = Nothing
151+ , _mnNoteId = Nothing
152+ , _mnCreatorRole = Nothing
153+ , _mnOrderId = Nothing
154+ , _mnOrderRevisionNumber = Nothing
155+ }
156+
157+-- | The actual note to attach. (readonly, except on create)
158+mnNote :: Lens' MarketplaceNote (Maybe Text)
159+mnNote = lens _mnNote (\ s a -> s{_mnNote = a})
160+
161+-- | Identifies what kind of resource this is. Value: the fixed string
162+-- \"adexchangebuyer#marketplaceNote\".
163+mnKind :: Lens' MarketplaceNote Text
164+mnKind = lens _mnKind (\ s a -> s{_mnKind = a})
165+
166+-- | The timestamp (ms since epoch) that this note was created. (readonly)
167+mnTimestampMs :: Lens' MarketplaceNote (Maybe Int64)
168+mnTimestampMs
169+ = lens _mnTimestampMs
170+ (\ s a -> s{_mnTimestampMs = a})
171+
172+-- | Notes can optionally be associated with a deal. (readonly, except on
173+-- create)
174+mnDealId :: Lens' MarketplaceNote (Maybe Text)
175+mnDealId = lens _mnDealId (\ s a -> s{_mnDealId = a})
176+
177+-- | The unique id for the note. (readonly)
178+mnNoteId :: Lens' MarketplaceNote (Maybe Text)
179+mnNoteId = lens _mnNoteId (\ s a -> s{_mnNoteId = a})
180+
181+-- | The role of the person (buyer\/seller) creating the note. (readonly)
182+mnCreatorRole :: Lens' MarketplaceNote (Maybe Text)
183+mnCreatorRole
184+ = lens _mnCreatorRole
185+ (\ s a -> s{_mnCreatorRole = a})
186+
187+-- | The order_id that a note is attached to. (readonly)
188+mnOrderId :: Lens' MarketplaceNote (Maybe Text)
189+mnOrderId
190+ = lens _mnOrderId (\ s a -> s{_mnOrderId = a})
191+
192+-- | If the note is associated with an order revision number, then store that
193+-- here. (readonly, except on create)
194+mnOrderRevisionNumber :: Lens' MarketplaceNote (Maybe Int64)
195+mnOrderRevisionNumber
196+ = lens _mnOrderRevisionNumber
197+ (\ s a -> s{_mnOrderRevisionNumber = a})
198+
199+instance FromJSON MarketplaceNote where
200+ parseJSON
201+ = withObject "MarketplaceNote"
202+ (\ o ->
203+ MarketplaceNote <$>
204+ (o .:? "note") <*>
205+ (o .:? "kind" .!= "adexchangebuyer#marketplaceNote")
206+ <*> (o .:? "timestampMs")
207+ <*> (o .:? "dealId")
208+ <*> (o .:? "noteId")
209+ <*> (o .:? "creatorRole")
210+ <*> (o .:? "orderId")
211+ <*> (o .:? "orderRevisionNumber"))
212+
213+instance ToJSON MarketplaceNote where
214+ toJSON MarketplaceNote{..}
215+ = object
216+ (catMaybes
217+ [("note" .=) <$> _mnNote, Just ("kind" .= _mnKind),
218+ ("timestampMs" .=) <$> _mnTimestampMs,
219+ ("dealId" .=) <$> _mnDealId,
220+ ("noteId" .=) <$> _mnNoteId,
221+ ("creatorRole" .=) <$> _mnCreatorRole,
222+ ("orderId" .=) <$> _mnOrderId,
223+ ("orderRevisionNumber" .=) <$>
224+ _mnOrderRevisionNumber])
225+
226+--
227+-- /See:/ 'termsDto' smart constructor.
228+data TermsDto = TermsDto
229+ { _tdFinalizeAutomatically :: !(Maybe Bool)
230+ , _tdBuyerBillingType :: !(Maybe Text)
231+ , _tdTargetingAllAdSlots :: !(Maybe Bool)
232+ , _tdUrls :: !(Maybe [Text])
233+ , _tdEndDate :: !(Maybe (Maybe DateTime))
234+ , _tdCpm :: !(Maybe (Maybe MoneyDto))
235+ , _tdEstimatedSpend :: !(Maybe (Maybe MoneyDto))
236+ , _tdAdvertisers :: !(Maybe [Maybe AdvertiserDto])
237+ , _tdEstimatedImpressionsPerDay :: !(Maybe Int64)
238+ , _tdMonetizerType :: !(Maybe Text)
239+ , _tdAudienceSegmentDescription :: !(Maybe Text)
240+ , _tdCreativeReviewPolicy :: !(Maybe Text)
241+ , _tdMinimumTrueLooks :: !(Maybe Int64)
242+ , _tdStartDate :: !(Maybe (Maybe DateTime))
243+ , _tdCreativeBlockingLevel :: !(Maybe Text)
244+ , _tdSemiTransparent :: !(Maybe Bool)
245+ , _tdAudienceSegment :: !(Maybe (Maybe AudienceSegment))
246+ , _tdDealPremium :: !(Maybe (Maybe MoneyDto))
247+ , _tdIsReservation :: !(Maybe Bool)
248+ , _tdAdSlots :: !(Maybe [Maybe AdSlotDto])
249+ , _tdTermsAttributes :: !(Maybe [Text])
250+ , _tdInventorySegmentTargeting :: !(Maybe (Maybe InventorySegmentTargeting))
251+ , _tdDescriptiveName :: !(Maybe Text)
252+ , _tdMinimumSpendMicros :: !(Maybe Int64)
253+ , _tdTargetByDealId :: !(Maybe Bool)
254+ , _tdBillingTerms :: !(Maybe Text)
255+ , _tdDescription :: !(Maybe Text)
256+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
257+
258+-- | Creates a value of 'TermsDto' with the minimum fields required to make a request.
259+--
260+-- Use one of the following lenses to modify other fields as desired:
261+--
262+-- * 'tdFinalizeAutomatically'
263+--
264+-- * 'tdBuyerBillingType'
265+--
266+-- * 'tdTargetingAllAdSlots'
267+--
268+-- * 'tdUrls'
269+--
270+-- * 'tdEndDate'
271+--
272+-- * 'tdCpm'
273+--
274+-- * 'tdEstimatedSpend'
275+--
276+-- * 'tdAdvertisers'
277+--
278+-- * 'tdEstimatedImpressionsPerDay'
279+--
280+-- * 'tdMonetizerType'
281+--
282+-- * 'tdAudienceSegmentDescription'
283+--
284+-- * 'tdCreativeReviewPolicy'
285+--
286+-- * 'tdMinimumTrueLooks'
287+--
288+-- * 'tdStartDate'
289+--
290+-- * 'tdCreativeBlockingLevel'
291+--
292+-- * 'tdSemiTransparent'
293+--
294+-- * 'tdAudienceSegment'
295+--
296+-- * 'tdDealPremium'
297+--
298+-- * 'tdIsReservation'
299+--
300+-- * 'tdAdSlots'
301+--
302+-- * 'tdTermsAttributes'
303+--
304+-- * 'tdInventorySegmentTargeting'
305+--
306+-- * 'tdDescriptiveName'
307+--
308+-- * 'tdMinimumSpendMicros'
309+--
310+-- * 'tdTargetByDealId'
311+--
312+-- * 'tdBillingTerms'
313+--
314+-- * 'tdDescription'
315+termsDto
316+ :: TermsDto
317+termsDto =
318+ TermsDto
319+ { _tdFinalizeAutomatically = Nothing
320+ , _tdBuyerBillingType = Nothing
321+ , _tdTargetingAllAdSlots = Nothing
322+ , _tdUrls = Nothing
323+ , _tdEndDate = Nothing
324+ , _tdCpm = Nothing
325+ , _tdEstimatedSpend = Nothing
326+ , _tdAdvertisers = Nothing
327+ , _tdEstimatedImpressionsPerDay = Nothing
328+ , _tdMonetizerType = Nothing
329+ , _tdAudienceSegmentDescription = Nothing
330+ , _tdCreativeReviewPolicy = Nothing
331+ , _tdMinimumTrueLooks = Nothing
332+ , _tdStartDate = Nothing
333+ , _tdCreativeBlockingLevel = Nothing
334+ , _tdSemiTransparent = Nothing
335+ , _tdAudienceSegment = Nothing
336+ , _tdDealPremium = Nothing
337+ , _tdIsReservation = Nothing
338+ , _tdAdSlots = Nothing
339+ , _tdTermsAttributes = Nothing
340+ , _tdInventorySegmentTargeting = Nothing
341+ , _tdDescriptiveName = Nothing
342+ , _tdMinimumSpendMicros = Nothing
343+ , _tdTargetByDealId = Nothing
344+ , _tdBillingTerms = Nothing
345+ , _tdDescription = Nothing
346+ }
347+
348+-- | If true, the offer will finalize automatically when accepted.
349+tdFinalizeAutomatically :: Lens' TermsDto (Maybe Bool)
350+tdFinalizeAutomatically
351+ = lens _tdFinalizeAutomatically
352+ (\ s a -> s{_tdFinalizeAutomatically = a})
353+
354+-- | The buyer billing type.
355+tdBuyerBillingType :: Lens' TermsDto (Maybe Text)
356+tdBuyerBillingType
357+ = lens _tdBuyerBillingType
358+ (\ s a -> s{_tdBuyerBillingType = a})
359+
360+-- | If true, the offer targets all ad slots.
361+tdTargetingAllAdSlots :: Lens' TermsDto (Maybe Bool)
362+tdTargetingAllAdSlots
363+ = lens _tdTargetingAllAdSlots
364+ (\ s a -> s{_tdTargetingAllAdSlots = a})
365+
366+-- | The urls applicable to the offer.
367+tdUrls :: Lens' TermsDto [Text]
368+tdUrls
369+ = lens _tdUrls (\ s a -> s{_tdUrls = a}) . _Default .
370+ _Coerce
371+
372+-- | The end date for the offer.
373+tdEndDate :: Lens' TermsDto (Maybe (Maybe DateTime))
374+tdEndDate
375+ = lens _tdEndDate (\ s a -> s{_tdEndDate = a})
376+
377+-- | The cpm terms.
378+tdCpm :: Lens' TermsDto (Maybe (Maybe MoneyDto))
379+tdCpm = lens _tdCpm (\ s a -> s{_tdCpm = a})
380+
381+-- | The estimated spend for the offer.
382+tdEstimatedSpend :: Lens' TermsDto (Maybe (Maybe MoneyDto))
383+tdEstimatedSpend
384+ = lens _tdEstimatedSpend
385+ (\ s a -> s{_tdEstimatedSpend = a})
386+
387+-- | A list of advertisers for this offer.
388+tdAdvertisers :: Lens' TermsDto [Maybe AdvertiserDto]
389+tdAdvertisers
390+ = lens _tdAdvertisers
391+ (\ s a -> s{_tdAdvertisers = a})
392+ . _Default
393+ . _Coerce
394+
395+-- | The estimated daily impressions for the offer.
396+tdEstimatedImpressionsPerDay :: Lens' TermsDto (Maybe Int64)
397+tdEstimatedImpressionsPerDay
398+ = lens _tdEstimatedImpressionsPerDay
399+ (\ s a -> s{_tdEstimatedImpressionsPerDay = a})
400+
401+-- | The monetizer type.
402+tdMonetizerType :: Lens' TermsDto (Maybe Text)
403+tdMonetizerType
404+ = lens _tdMonetizerType
405+ (\ s a -> s{_tdMonetizerType = a})
406+
407+-- | A description of the audience segment for the offer.
408+tdAudienceSegmentDescription :: Lens' TermsDto (Maybe Text)
409+tdAudienceSegmentDescription
410+ = lens _tdAudienceSegmentDescription
411+ (\ s a -> s{_tdAudienceSegmentDescription = a})
412+
413+-- | Whether to use publisher review policy or AdX review policy.
414+tdCreativeReviewPolicy :: Lens' TermsDto (Maybe Text)
415+tdCreativeReviewPolicy
416+ = lens _tdCreativeReviewPolicy
417+ (\ s a -> s{_tdCreativeReviewPolicy = a})
418+
419+-- | The minimum true looks for the offer.
420+tdMinimumTrueLooks :: Lens' TermsDto (Maybe Int64)
421+tdMinimumTrueLooks
422+ = lens _tdMinimumTrueLooks
423+ (\ s a -> s{_tdMinimumTrueLooks = a})
424+
425+-- | The start date for the offer.
426+tdStartDate :: Lens' TermsDto (Maybe (Maybe DateTime))
427+tdStartDate
428+ = lens _tdStartDate (\ s a -> s{_tdStartDate = a})
429+
430+-- | Whether to use or ignore publisher blocking rules.
431+tdCreativeBlockingLevel :: Lens' TermsDto (Maybe Text)
432+tdCreativeBlockingLevel
433+ = lens _tdCreativeBlockingLevel
434+ (\ s a -> s{_tdCreativeBlockingLevel = a})
435+
436+-- | Whether this offer is semi-transparent.
437+tdSemiTransparent :: Lens' TermsDto (Maybe Bool)
438+tdSemiTransparent
439+ = lens _tdSemiTransparent
440+ (\ s a -> s{_tdSemiTransparent = a})
441+
442+-- | The audience segment for the offer.
443+tdAudienceSegment :: Lens' TermsDto (Maybe (Maybe AudienceSegment))
444+tdAudienceSegment
445+ = lens _tdAudienceSegment
446+ (\ s a -> s{_tdAudienceSegment = a})
447+
448+-- | The premium terms.
449+tdDealPremium :: Lens' TermsDto (Maybe (Maybe MoneyDto))
450+tdDealPremium
451+ = lens _tdDealPremium
452+ (\ s a -> s{_tdDealPremium = a})
453+
454+-- | Whether the offer is a reservation.
455+tdIsReservation :: Lens' TermsDto (Maybe Bool)
456+tdIsReservation
457+ = lens _tdIsReservation
458+ (\ s a -> s{_tdIsReservation = a})
459+
460+-- | The particular ad slots targeted by the offer.
461+tdAdSlots :: Lens' TermsDto [Maybe AdSlotDto]
462+tdAdSlots
463+ = lens _tdAdSlots (\ s a -> s{_tdAdSlots = a}) .
464+ _Default
465+ . _Coerce
466+
467+-- | A list of terms attributes.
468+tdTermsAttributes :: Lens' TermsDto [Text]
469+tdTermsAttributes
470+ = lens _tdTermsAttributes
471+ (\ s a -> s{_tdTermsAttributes = a})
472+ . _Default
473+ . _Coerce
474+
475+-- | The inventory segment targeting for the offer.
476+tdInventorySegmentTargeting :: Lens' TermsDto (Maybe (Maybe InventorySegmentTargeting))
477+tdInventorySegmentTargeting
478+ = lens _tdInventorySegmentTargeting
479+ (\ s a -> s{_tdInventorySegmentTargeting = a})
480+
481+-- | A descriptive name for these terms.
482+tdDescriptiveName :: Lens' TermsDto (Maybe Text)
483+tdDescriptiveName
484+ = lens _tdDescriptiveName
485+ (\ s a -> s{_tdDescriptiveName = a})
486+
487+-- | The minimum spend for the offer.
488+tdMinimumSpendMicros :: Lens' TermsDto (Maybe Int64)
489+tdMinimumSpendMicros
490+ = lens _tdMinimumSpendMicros
491+ (\ s a -> s{_tdMinimumSpendMicros = a})
492+
493+-- | Whether to target by deal id.
494+tdTargetByDealId :: Lens' TermsDto (Maybe Bool)
495+tdTargetByDealId
496+ = lens _tdTargetByDealId
497+ (\ s a -> s{_tdTargetByDealId = a})
498+
499+-- | The billing terms.
500+tdBillingTerms :: Lens' TermsDto (Maybe Text)
501+tdBillingTerms
502+ = lens _tdBillingTerms
503+ (\ s a -> s{_tdBillingTerms = a})
504+
505+-- | A description for these terms.
506+tdDescription :: Lens' TermsDto (Maybe Text)
507+tdDescription
508+ = lens _tdDescription
509+ (\ s a -> s{_tdDescription = a})
510+
511+instance FromJSON TermsDto where
512+ parseJSON
513+ = withObject "TermsDto"
514+ (\ o ->
515+ TermsDto <$>
516+ (o .:? "finalizeAutomatically") <*>
517+ (o .:? "buyerBillingType")
518+ <*> (o .:? "targetingAllAdSlots")
519+ <*> (o .:? "urls" .!= mempty)
520+ <*> (o .:? "endDate")
521+ <*> (o .:? "cpm")
522+ <*> (o .:? "estimatedSpend")
523+ <*> (o .:? "advertisers" .!= mempty)
524+ <*> (o .:? "estimatedImpressionsPerDay")
525+ <*> (o .:? "monetizerType")
526+ <*> (o .:? "audienceSegmentDescription")
527+ <*> (o .:? "creativeReviewPolicy")
528+ <*> (o .:? "minimumTrueLooks")
529+ <*> (o .:? "startDate")
530+ <*> (o .:? "creativeBlockingLevel")
531+ <*> (o .:? "semiTransparent")
532+ <*> (o .:? "audienceSegment")
533+ <*> (o .:? "dealPremium")
534+ <*> (o .:? "isReservation")
535+ <*> (o .:? "adSlots" .!= mempty)
536+ <*> (o .:? "termsAttributes" .!= mempty)
537+ <*> (o .:? "inventorySegmentTargeting")
538+ <*> (o .:? "descriptiveName")
539+ <*> (o .:? "minimumSpendMicros")
540+ <*> (o .:? "targetByDealId")
541+ <*> (o .:? "billingTerms")
542+ <*> (o .:? "description"))
543+
544+instance ToJSON TermsDto where
545+ toJSON TermsDto{..}
546+ = object
547+ (catMaybes
548+ [("finalizeAutomatically" .=) <$>
549+ _tdFinalizeAutomatically,
550+ ("buyerBillingType" .=) <$> _tdBuyerBillingType,
551+ ("targetingAllAdSlots" .=) <$>
552+ _tdTargetingAllAdSlots,
553+ ("urls" .=) <$> _tdUrls,
554+ ("endDate" .=) <$> _tdEndDate, ("cpm" .=) <$> _tdCpm,
555+ ("estimatedSpend" .=) <$> _tdEstimatedSpend,
556+ ("advertisers" .=) <$> _tdAdvertisers,
557+ ("estimatedImpressionsPerDay" .=) <$>
558+ _tdEstimatedImpressionsPerDay,
559+ ("monetizerType" .=) <$> _tdMonetizerType,
560+ ("audienceSegmentDescription" .=) <$>
561+ _tdAudienceSegmentDescription,
562+ ("creativeReviewPolicy" .=) <$>
563+ _tdCreativeReviewPolicy,
564+ ("minimumTrueLooks" .=) <$> _tdMinimumTrueLooks,
565+ ("startDate" .=) <$> _tdStartDate,
566+ ("creativeBlockingLevel" .=) <$>
567+ _tdCreativeBlockingLevel,
568+ ("semiTransparent" .=) <$> _tdSemiTransparent,
569+ ("audienceSegment" .=) <$> _tdAudienceSegment,
570+ ("dealPremium" .=) <$> _tdDealPremium,
571+ ("isReservation" .=) <$> _tdIsReservation,
572+ ("adSlots" .=) <$> _tdAdSlots,
573+ ("termsAttributes" .=) <$> _tdTermsAttributes,
574+ ("inventorySegmentTargeting" .=) <$>
575+ _tdInventorySegmentTargeting,
576+ ("descriptiveName" .=) <$> _tdDescriptiveName,
577+ ("minimumSpendMicros" .=) <$> _tdMinimumSpendMicros,
578+ ("targetByDealId" .=) <$> _tdTargetByDealId,
579+ ("billingTerms" .=) <$> _tdBillingTerms,
580+ ("description" .=) <$> _tdDescription])
581+
582+-- | The creatives feed lists the active creatives for the Ad Exchange buyer
583+-- accounts that the user has access to. Each entry in the feed corresponds
584+-- to a single creative.
585+--
586+-- /See:/ 'creativesList' smart constructor.
587+data CreativesList = CreativesList
588+ { _clNextPageToken :: !(Maybe Text)
589+ , _clKind :: !Text
590+ , _clItems :: !(Maybe [Maybe Creative])
591+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
592+
593+-- | Creates a value of 'CreativesList' with the minimum fields required to make a request.
594+--
595+-- Use one of the following lenses to modify other fields as desired:
596+--
597+-- * 'clNextPageToken'
598+--
599+-- * 'clKind'
600+--
601+-- * 'clItems'
602+creativesList
603+ :: CreativesList
604+creativesList =
605+ CreativesList
606+ { _clNextPageToken = Nothing
607+ , _clKind = "adexchangebuyer#creativesList"
608+ , _clItems = Nothing
609+ }
610+
611+-- | Continuation token used to page through creatives. To retrieve the next
612+-- page of results, set the next request\'s \"pageToken\" value to this.
613+clNextPageToken :: Lens' CreativesList (Maybe Text)
614+clNextPageToken
615+ = lens _clNextPageToken
616+ (\ s a -> s{_clNextPageToken = a})
617+
618+-- | Resource type.
619+clKind :: Lens' CreativesList Text
620+clKind = lens _clKind (\ s a -> s{_clKind = a})
621+
622+-- | A list of creatives.
623+clItems :: Lens' CreativesList [Maybe Creative]
624+clItems
625+ = lens _clItems (\ s a -> s{_clItems = a}) . _Default
626+ . _Coerce
627+
628+instance FromJSON CreativesList where
629+ parseJSON
630+ = withObject "CreativesList"
631+ (\ o ->
632+ CreativesList <$>
633+ (o .:? "nextPageToken") <*>
634+ (o .:? "kind" .!= "adexchangebuyer#creativesList")
635+ <*> (o .:? "items" .!= mempty))
636+
637+instance ToJSON CreativesList where
638+ toJSON CreativesList{..}
639+ = object
640+ (catMaybes
641+ [("nextPageToken" .=) <$> _clNextPageToken,
642+ Just ("kind" .= _clKind), ("items" .=) <$> _clItems])
643+
644+--
645+-- /See:/ 'createOrdersResponse' smart constructor.
646+newtype CreateOrdersResponse = CreateOrdersResponse
647+ { _corOrders :: Maybe [Maybe MarketplaceOrder]
648+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
649+
650+-- | Creates a value of 'CreateOrdersResponse' with the minimum fields required to make a request.
651+--
652+-- Use one of the following lenses to modify other fields as desired:
653+--
654+-- * 'corOrders'
655+createOrdersResponse
656+ :: CreateOrdersResponse
657+createOrdersResponse =
658+ CreateOrdersResponse
659+ { _corOrders = Nothing
660+ }
661+
662+-- | The list of orders successfully created.
663+corOrders :: Lens' CreateOrdersResponse [Maybe MarketplaceOrder]
664+corOrders
665+ = lens _corOrders (\ s a -> s{_corOrders = a}) .
666+ _Default
667+ . _Coerce
668+
669+instance FromJSON CreateOrdersResponse where
670+ parseJSON
671+ = withObject "CreateOrdersResponse"
672+ (\ o ->
673+ CreateOrdersResponse <$> (o .:? "orders" .!= mempty))
674+
675+instance ToJSON CreateOrdersResponse where
676+ toJSON CreateOrdersResponse{..}
677+ = object (catMaybes [("orders" .=) <$> _corOrders])
678+
679+--
680+-- /See:/ 'addOrderNotesRequest' smart constructor.
681+newtype AddOrderNotesRequest = AddOrderNotesRequest
682+ { _aonrNotes :: Maybe [Maybe MarketplaceNote]
683+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
684+
685+-- | Creates a value of 'AddOrderNotesRequest' with the minimum fields required to make a request.
686+--
687+-- Use one of the following lenses to modify other fields as desired:
688+--
689+-- * 'aonrNotes'
690+addOrderNotesRequest
691+ :: AddOrderNotesRequest
692+addOrderNotesRequest =
693+ AddOrderNotesRequest
694+ { _aonrNotes = Nothing
695+ }
696+
697+-- | The list of notes to add.
698+aonrNotes :: Lens' AddOrderNotesRequest [Maybe MarketplaceNote]
699+aonrNotes
700+ = lens _aonrNotes (\ s a -> s{_aonrNotes = a}) .
701+ _Default
702+ . _Coerce
703+
704+instance FromJSON AddOrderNotesRequest where
705+ parseJSON
706+ = withObject "AddOrderNotesRequest"
707+ (\ o ->
708+ AddOrderNotesRequest <$> (o .:? "notes" .!= mempty))
709+
710+instance ToJSON AddOrderNotesRequest where
711+ toJSON AddOrderNotesRequest{..}
712+ = object (catMaybes [("notes" .=) <$> _aonrNotes])
713+
714+--
715+-- /See:/ 'marketplaceDealParty' smart constructor.
716+data MarketplaceDealParty = MarketplaceDealParty
717+ { _mdpSeller :: !(Maybe (Maybe Seller))
718+ , _mdpBuyer :: !(Maybe (Maybe Buyer))
719+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
720+
721+-- | Creates a value of 'MarketplaceDealParty' with the minimum fields required to make a request.
722+--
723+-- Use one of the following lenses to modify other fields as desired:
724+--
725+-- * 'mdpSeller'
726+--
727+-- * 'mdpBuyer'
728+marketplaceDealParty
729+ :: MarketplaceDealParty
730+marketplaceDealParty =
731+ MarketplaceDealParty
732+ { _mdpSeller = Nothing
733+ , _mdpBuyer = Nothing
734+ }
735+
736+-- | The buyer\/seller associated with the deal. One of buyer\/seller is
737+-- specified for a deal party.
738+mdpSeller :: Lens' MarketplaceDealParty (Maybe (Maybe Seller))
739+mdpSeller
740+ = lens _mdpSeller (\ s a -> s{_mdpSeller = a})
741+
742+-- | The buyer\/seller associated with the deal. One of buyer\/seller is
743+-- specified for a deal-party.
744+mdpBuyer :: Lens' MarketplaceDealParty (Maybe (Maybe Buyer))
745+mdpBuyer = lens _mdpBuyer (\ s a -> s{_mdpBuyer = a})
746+
747+instance FromJSON MarketplaceDealParty where
748+ parseJSON
749+ = withObject "MarketplaceDealParty"
750+ (\ o ->
751+ MarketplaceDealParty <$>
752+ (o .:? "seller") <*> (o .:? "buyer"))
753+
754+instance ToJSON MarketplaceDealParty where
755+ toJSON MarketplaceDealParty{..}
756+ = object
757+ (catMaybes
758+ [("seller" .=) <$> _mdpSeller,
759+ ("buyer" .=) <$> _mdpBuyer])
760+
761+--
762+-- /See:/ 'dealPartyDto' smart constructor.
763+data DealPartyDto = DealPartyDto
764+ { _dpdBuyerSellerRole :: !(Maybe Text)
765+ , _dpdCustomerId :: !(Maybe Int32)
766+ , _dpdName :: !(Maybe Text)
767+ , _dpdWebProperty :: !(Maybe (Maybe WebPropertyDto))
768+ , _dpdBuyer :: !(Maybe (Maybe BuyerDto))
769+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
770+
771+-- | Creates a value of 'DealPartyDto' with the minimum fields required to make a request.
772+--
773+-- Use one of the following lenses to modify other fields as desired:
774+--
775+-- * 'dpdBuyerSellerRole'
776+--
777+-- * 'dpdCustomerId'
778+--
779+-- * 'dpdName'
780+--
781+-- * 'dpdWebProperty'
782+--
783+-- * 'dpdBuyer'
784+dealPartyDto
785+ :: DealPartyDto
786+dealPartyDto =
787+ DealPartyDto
788+ { _dpdBuyerSellerRole = Nothing
789+ , _dpdCustomerId = Nothing
790+ , _dpdName = Nothing
791+ , _dpdWebProperty = Nothing
792+ , _dpdBuyer = Nothing
793+ }
794+
795+dpdBuyerSellerRole :: Lens' DealPartyDto (Maybe Text)
796+dpdBuyerSellerRole
797+ = lens _dpdBuyerSellerRole
798+ (\ s a -> s{_dpdBuyerSellerRole = a})
799+
800+dpdCustomerId :: Lens' DealPartyDto (Maybe Int32)
801+dpdCustomerId
802+ = lens _dpdCustomerId
803+ (\ s a -> s{_dpdCustomerId = a})
804+
805+dpdName :: Lens' DealPartyDto (Maybe Text)
806+dpdName = lens _dpdName (\ s a -> s{_dpdName = a})
807+
808+dpdWebProperty :: Lens' DealPartyDto (Maybe (Maybe WebPropertyDto))
809+dpdWebProperty
810+ = lens _dpdWebProperty
811+ (\ s a -> s{_dpdWebProperty = a})
812+
813+dpdBuyer :: Lens' DealPartyDto (Maybe (Maybe BuyerDto))
814+dpdBuyer = lens _dpdBuyer (\ s a -> s{_dpdBuyer = a})
815+
816+instance FromJSON DealPartyDto where
817+ parseJSON
818+ = withObject "DealPartyDto"
819+ (\ o ->
820+ DealPartyDto <$>
821+ (o .:? "buyerSellerRole") <*> (o .:? "customerId")
822+ <*> (o .:? "name")
823+ <*> (o .:? "webProperty")
824+ <*> (o .:? "buyer"))
825+
826+instance ToJSON DealPartyDto where
827+ toJSON DealPartyDto{..}
828+ = object
829+ (catMaybes
830+ [("buyerSellerRole" .=) <$> _dpdBuyerSellerRole,
831+ ("customerId" .=) <$> _dpdCustomerId,
832+ ("name" .=) <$> _dpdName,
833+ ("webProperty" .=) <$> _dpdWebProperty,
834+ ("buyer" .=) <$> _dpdBuyer])
835+
836+--
837+-- /See:/ 'deliveryControlFrequencyCap' smart constructor.
838+data DeliveryControlFrequencyCap = DeliveryControlFrequencyCap
839+ { _dcfcMaxImpressions :: !(Maybe Int32)
840+ , _dcfcNumTimeUnits :: !(Maybe Int32)
841+ , _dcfcTimeUnitType :: !(Maybe Text)
842+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
843+
844+-- | Creates a value of 'DeliveryControlFrequencyCap' with the minimum fields required to make a request.
845+--
846+-- Use one of the following lenses to modify other fields as desired:
847+--
848+-- * 'dcfcMaxImpressions'
849+--
850+-- * 'dcfcNumTimeUnits'
851+--
852+-- * 'dcfcTimeUnitType'
853+deliveryControlFrequencyCap
854+ :: DeliveryControlFrequencyCap
855+deliveryControlFrequencyCap =
856+ DeliveryControlFrequencyCap
857+ { _dcfcMaxImpressions = Nothing
858+ , _dcfcNumTimeUnits = Nothing
859+ , _dcfcTimeUnitType = Nothing
860+ }
861+
862+dcfcMaxImpressions :: Lens' DeliveryControlFrequencyCap (Maybe Int32)
863+dcfcMaxImpressions
864+ = lens _dcfcMaxImpressions
865+ (\ s a -> s{_dcfcMaxImpressions = a})
866+
867+dcfcNumTimeUnits :: Lens' DeliveryControlFrequencyCap (Maybe Int32)
868+dcfcNumTimeUnits
869+ = lens _dcfcNumTimeUnits
870+ (\ s a -> s{_dcfcNumTimeUnits = a})
871+
872+dcfcTimeUnitType :: Lens' DeliveryControlFrequencyCap (Maybe Text)
873+dcfcTimeUnitType
874+ = lens _dcfcTimeUnitType
875+ (\ s a -> s{_dcfcTimeUnitType = a})
876+
877+instance FromJSON DeliveryControlFrequencyCap where
878+ parseJSON
879+ = withObject "DeliveryControlFrequencyCap"
880+ (\ o ->
881+ DeliveryControlFrequencyCap <$>
882+ (o .:? "maxImpressions") <*> (o .:? "numTimeUnits")
883+ <*> (o .:? "timeUnitType"))
884+
885+instance ToJSON DeliveryControlFrequencyCap where
886+ toJSON DeliveryControlFrequencyCap{..}
887+ = object
888+ (catMaybes
889+ [("maxImpressions" .=) <$> _dcfcMaxImpressions,
890+ ("numTimeUnits" .=) <$> _dcfcNumTimeUnits,
891+ ("timeUnitType" .=) <$> _dcfcTimeUnitType])
892+
893+--
894+-- /See:/ 'getNegotiationsResponse' smart constructor.
895+data GetNegotiationsResponse = GetNegotiationsResponse
896+ { _gnrKind :: !Text
897+ , _gnrNegotiations :: !(Maybe [Maybe NegotiationDto])
898+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
899+
900+-- | Creates a value of 'GetNegotiationsResponse' with the minimum fields required to make a request.
901+--
902+-- Use one of the following lenses to modify other fields as desired:
903+--
904+-- * 'gnrKind'
905+--
906+-- * 'gnrNegotiations'
907+getNegotiationsResponse
908+ :: GetNegotiationsResponse
909+getNegotiationsResponse =
910+ GetNegotiationsResponse
911+ { _gnrKind = "adexchangebuyer#negotiationsList"
912+ , _gnrNegotiations = Nothing
913+ }
914+
915+gnrKind :: Lens' GetNegotiationsResponse Text
916+gnrKind = lens _gnrKind (\ s a -> s{_gnrKind = a})
917+
918+gnrNegotiations :: Lens' GetNegotiationsResponse [Maybe NegotiationDto]
919+gnrNegotiations
920+ = lens _gnrNegotiations
921+ (\ s a -> s{_gnrNegotiations = a})
922+ . _Default
923+ . _Coerce
924+
925+instance FromJSON GetNegotiationsResponse where
926+ parseJSON
927+ = withObject "GetNegotiationsResponse"
928+ (\ o ->
929+ GetNegotiationsResponse <$>
930+ (o .:? "kind" .!= "adexchangebuyer#negotiationsList")
931+ <*> (o .:? "negotiations" .!= mempty))
932+
933+instance ToJSON GetNegotiationsResponse where
934+ toJSON GetNegotiationsResponse{..}
935+ = object
936+ (catMaybes
937+ [Just ("kind" .= _gnrKind),
938+ ("negotiations" .=) <$> _gnrNegotiations])
939+
940+-- | The configuration data for Ad Exchange RTB - Budget API.
941+--
942+-- /See:/ 'budget' smart constructor.
943+data Budget = Budget
944+ { _bCurrencyCode :: !(Maybe Text)
945+ , _bKind :: !Text
946+ , _bBudgetAmount :: !(Maybe Int64)
947+ , _bAccountId :: !(Maybe Int64)
948+ , _bId :: !(Maybe Text)
949+ , _bBillingId :: !(Maybe Int64)
950+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
951+
952+-- | Creates a value of 'Budget' with the minimum fields required to make a request.
953+--
954+-- Use one of the following lenses to modify other fields as desired:
955+--
956+-- * 'bCurrencyCode'
957+--
958+-- * 'bKind'
959+--
960+-- * 'bBudgetAmount'
961+--
962+-- * 'bAccountId'
963+--
964+-- * 'bId'
965+--
966+-- * 'bBillingId'
967+budget
968+ :: Budget
969+budget =
970+ Budget
971+ { _bCurrencyCode = Nothing
972+ , _bKind = "adexchangebuyer#budget"
973+ , _bBudgetAmount = Nothing
974+ , _bAccountId = Nothing
975+ , _bId = Nothing
976+ , _bBillingId = Nothing
977+ }
978+
979+-- | The currency code for the buyer. This cannot be altered here.
980+bCurrencyCode :: Lens' Budget (Maybe Text)
981+bCurrencyCode
982+ = lens _bCurrencyCode
983+ (\ s a -> s{_bCurrencyCode = a})
984+
985+-- | The kind of the resource, i.e. \"adexchangebuyer#budget\".
986+bKind :: Lens' Budget Text
987+bKind = lens _bKind (\ s a -> s{_bKind = a})
988+
989+-- | The budget amount to apply for the billingId provided. This is required
990+-- for update requests.
991+bBudgetAmount :: Lens' Budget (Maybe Int64)
992+bBudgetAmount
993+ = lens _bBudgetAmount
994+ (\ s a -> s{_bBudgetAmount = a})
995+
996+-- | The id of the account. This is required for get and update requests.
997+bAccountId :: Lens' Budget (Maybe Int64)
998+bAccountId
999+ = lens _bAccountId (\ s a -> s{_bAccountId = a})
1000+
1001+-- | The unique id that describes this item.
1002+bId :: Lens' Budget (Maybe Text)
1003+bId = lens _bId (\ s a -> s{_bId = a})
1004+
1005+-- | The billing id to determine which adgroup to provide budget information
1006+-- for. This is required for get and update requests.
1007+bBillingId :: Lens' Budget (Maybe Int64)
1008+bBillingId
1009+ = lens _bBillingId (\ s a -> s{_bBillingId = a})
1010+
1011+instance FromJSON Budget where
1012+ parseJSON
1013+ = withObject "Budget"
1014+ (\ o ->
1015+ Budget <$>
1016+ (o .:? "currencyCode") <*>
1017+ (o .:? "kind" .!= "adexchangebuyer#budget")
1018+ <*> (o .:? "budgetAmount")
1019+ <*> (o .:? "accountId")
1020+ <*> (o .:? "id")
1021+ <*> (o .:? "billingId"))
1022+
1023+instance ToJSON Budget where
1024+ toJSON Budget{..}
1025+ = object
1026+ (catMaybes
1027+ [("currencyCode" .=) <$> _bCurrencyCode,
1028+ Just ("kind" .= _bKind),
1029+ ("budgetAmount" .=) <$> _bBudgetAmount,
1030+ ("accountId" .=) <$> _bAccountId, ("id" .=) <$> _bId,
1031+ ("billingId" .=) <$> _bBillingId])
1032+
1033+--
1034+-- /See:/ 'getFinalizedNegotiationByExternalDealIdRequest' smart constructor.
1035+newtype GetFinalizedNegotiationByExternalDealIdRequest = GetFinalizedNegotiationByExternalDealIdRequest
1036+ { _gfnbedirIncludePrivateAuctions :: Maybe Bool
1037+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1038+
1039+-- | Creates a value of 'GetFinalizedNegotiationByExternalDealIdRequest' with the minimum fields required to make a request.
1040+--
1041+-- Use one of the following lenses to modify other fields as desired:
1042+--
1043+-- * 'gfnbedirIncludePrivateAuctions'
1044+getFinalizedNegotiationByExternalDealIdRequest
1045+ :: GetFinalizedNegotiationByExternalDealIdRequest
1046+getFinalizedNegotiationByExternalDealIdRequest =
1047+ GetFinalizedNegotiationByExternalDealIdRequest
1048+ { _gfnbedirIncludePrivateAuctions = Nothing
1049+ }
1050+
1051+gfnbedirIncludePrivateAuctions :: Lens' GetFinalizedNegotiationByExternalDealIdRequest (Maybe Bool)
1052+gfnbedirIncludePrivateAuctions
1053+ = lens _gfnbedirIncludePrivateAuctions
1054+ (\ s a -> s{_gfnbedirIncludePrivateAuctions = a})
1055+
1056+instance FromJSON
1057+ GetFinalizedNegotiationByExternalDealIdRequest where
1058+ parseJSON
1059+ = withObject
1060+ "GetFinalizedNegotiationByExternalDealIdRequest"
1061+ (\ o ->
1062+ GetFinalizedNegotiationByExternalDealIdRequest <$>
1063+ (o .:? "includePrivateAuctions"))
1064+
1065+instance ToJSON
1066+ GetFinalizedNegotiationByExternalDealIdRequest where
1067+ toJSON
1068+ GetFinalizedNegotiationByExternalDealIdRequest{..}
1069+ = object
1070+ (catMaybes
1071+ [("includePrivateAuctions" .=) <$>
1072+ _gfnbedirIncludePrivateAuctions])
1073+
1074+--
1075+-- /See:/ 'privateData' smart constructor.
1076+data PrivateData = PrivateData
1077+ { _pdReferencePayload :: !(Maybe Word8)
1078+ , _pdReferenceId :: !(Maybe Text)
1079+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1080+
1081+-- | Creates a value of 'PrivateData' with the minimum fields required to make a request.
1082+--
1083+-- Use one of the following lenses to modify other fields as desired:
1084+--
1085+-- * 'pdReferencePayload'
1086+--
1087+-- * 'pdReferenceId'
1088+privateData
1089+ :: PrivateData
1090+privateData =
1091+ PrivateData
1092+ { _pdReferencePayload = Nothing
1093+ , _pdReferenceId = Nothing
1094+ }
1095+
1096+pdReferencePayload :: Lens' PrivateData (Maybe Word8)
1097+pdReferencePayload
1098+ = lens _pdReferencePayload
1099+ (\ s a -> s{_pdReferencePayload = a})
1100+
1101+pdReferenceId :: Lens' PrivateData (Maybe Text)
1102+pdReferenceId
1103+ = lens _pdReferenceId
1104+ (\ s a -> s{_pdReferenceId = a})
1105+
1106+instance FromJSON PrivateData where
1107+ parseJSON
1108+ = withObject "PrivateData"
1109+ (\ o ->
1110+ PrivateData <$>
1111+ (o .:? "referencePayload") <*> (o .:? "referenceId"))
1112+
1113+instance ToJSON PrivateData where
1114+ toJSON PrivateData{..}
1115+ = object
1116+ (catMaybes
1117+ [("referencePayload" .=) <$> _pdReferencePayload,
1118+ ("referenceId" .=) <$> _pdReferenceId])
1119+
1120+--
1121+-- /See:/ 'adSize' smart constructor.
1122+data AdSize = AdSize
1123+ { _asHeight :: !(Maybe Int32)
1124+ , _asWidth :: !(Maybe Int32)
1125+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1126+
1127+-- | Creates a value of 'AdSize' with the minimum fields required to make a request.
1128+--
1129+-- Use one of the following lenses to modify other fields as desired:
1130+--
1131+-- * 'asHeight'
1132+--
1133+-- * 'asWidth'
1134+adSize
1135+ :: AdSize
1136+adSize =
1137+ AdSize
1138+ { _asHeight = Nothing
1139+ , _asWidth = Nothing
1140+ }
1141+
1142+asHeight :: Lens' AdSize (Maybe Int32)
1143+asHeight = lens _asHeight (\ s a -> s{_asHeight = a})
1144+
1145+asWidth :: Lens' AdSize (Maybe Int32)
1146+asWidth = lens _asWidth (\ s a -> s{_asWidth = a})
1147+
1148+instance FromJSON AdSize where
1149+ parseJSON
1150+ = withObject "AdSize"
1151+ (\ o ->
1152+ AdSize <$> (o .:? "height") <*> (o .:? "width"))
1153+
1154+instance ToJSON AdSize where
1155+ toJSON AdSize{..}
1156+ = object
1157+ (catMaybes
1158+ [("height" .=) <$> _asHeight,
1159+ ("width" .=) <$> _asWidth])
1160+
1161+--
1162+-- /See:/ 'ruleKeyValuePair' smart constructor.
1163+data RuleKeyValuePair = RuleKeyValuePair
1164+ { _rkvpKeyName :: !(Maybe Text)
1165+ , _rkvpValue :: !(Maybe Text)
1166+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1167+
1168+-- | Creates a value of 'RuleKeyValuePair' with the minimum fields required to make a request.
1169+--
1170+-- Use one of the following lenses to modify other fields as desired:
1171+--
1172+-- * 'rkvpKeyName'
1173+--
1174+-- * 'rkvpValue'
1175+ruleKeyValuePair
1176+ :: RuleKeyValuePair
1177+ruleKeyValuePair =
1178+ RuleKeyValuePair
1179+ { _rkvpKeyName = Nothing
1180+ , _rkvpValue = Nothing
1181+ }
1182+
1183+rkvpKeyName :: Lens' RuleKeyValuePair (Maybe Text)
1184+rkvpKeyName
1185+ = lens _rkvpKeyName (\ s a -> s{_rkvpKeyName = a})
1186+
1187+rkvpValue :: Lens' RuleKeyValuePair (Maybe Text)
1188+rkvpValue
1189+ = lens _rkvpValue (\ s a -> s{_rkvpValue = a})
1190+
1191+instance FromJSON RuleKeyValuePair where
1192+ parseJSON
1193+ = withObject "RuleKeyValuePair"
1194+ (\ o ->
1195+ RuleKeyValuePair <$>
1196+ (o .:? "keyName") <*> (o .:? "value"))
1197+
1198+instance ToJSON RuleKeyValuePair where
1199+ toJSON RuleKeyValuePair{..}
1200+ = object
1201+ (catMaybes
1202+ [("keyName" .=) <$> _rkvpKeyName,
1203+ ("value" .=) <$> _rkvpValue])
1204+
1205+--
1206+-- /See:/ 'getOrdersResponse' smart constructor.
1207+newtype GetOrdersResponse = GetOrdersResponse
1208+ { _gorOrders :: Maybe [Maybe MarketplaceOrder]
1209+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1210+
1211+-- | Creates a value of 'GetOrdersResponse' with the minimum fields required to make a request.
1212+--
1213+-- Use one of the following lenses to modify other fields as desired:
1214+--
1215+-- * 'gorOrders'
1216+getOrdersResponse
1217+ :: GetOrdersResponse
1218+getOrdersResponse =
1219+ GetOrdersResponse
1220+ { _gorOrders = Nothing
1221+ }
1222+
1223+-- | The list of matching orders.
1224+gorOrders :: Lens' GetOrdersResponse [Maybe MarketplaceOrder]
1225+gorOrders
1226+ = lens _gorOrders (\ s a -> s{_gorOrders = a}) .
1227+ _Default
1228+ . _Coerce
1229+
1230+instance FromJSON GetOrdersResponse where
1231+ parseJSON
1232+ = withObject "GetOrdersResponse"
1233+ (\ o ->
1234+ GetOrdersResponse <$> (o .:? "orders" .!= mempty))
1235+
1236+instance ToJSON GetOrdersResponse where
1237+ toJSON GetOrdersResponse{..}
1238+ = object (catMaybes [("orders" .=) <$> _gorOrders])
1239+
1240+-- | An account feed lists Ad Exchange buyer accounts that the user has
1241+-- access to. Each entry in the feed corresponds to a single buyer account.
1242+--
1243+-- /See:/ 'accountsList' smart constructor.
1244+data AccountsList = AccountsList
1245+ { _alKind :: !Text
1246+ , _alItems :: !(Maybe [Maybe Account])
1247+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1248+
1249+-- | Creates a value of 'AccountsList' with the minimum fields required to make a request.
1250+--
1251+-- Use one of the following lenses to modify other fields as desired:
1252+--
1253+-- * 'alKind'
1254+--
1255+-- * 'alItems'
1256+accountsList
1257+ :: AccountsList
1258+accountsList =
1259+ AccountsList
1260+ { _alKind = "adexchangebuyer#accountsList"
1261+ , _alItems = Nothing
1262+ }
1263+
1264+-- | Resource type.
1265+alKind :: Lens' AccountsList Text
1266+alKind = lens _alKind (\ s a -> s{_alKind = a})
1267+
1268+-- | A list of accounts.
1269+alItems :: Lens' AccountsList [Maybe Account]
1270+alItems
1271+ = lens _alItems (\ s a -> s{_alItems = a}) . _Default
1272+ . _Coerce
1273+
1274+instance FromJSON AccountsList where
1275+ parseJSON
1276+ = withObject "AccountsList"
1277+ (\ o ->
1278+ AccountsList <$>
1279+ (o .:? "kind" .!= "adexchangebuyer#accountsList") <*>
1280+ (o .:? "items" .!= mempty))
1281+
1282+instance ToJSON AccountsList where
1283+ toJSON AccountsList{..}
1284+ = object
1285+ (catMaybes
1286+ [Just ("kind" .= _alKind),
1287+ ("items" .=) <$> _alItems])
1288+
1289+--
1290+-- /See:/ 'getOrderNotesResponse' smart constructor.
1291+newtype GetOrderNotesResponse = GetOrderNotesResponse
1292+ { _gonrNotes :: Maybe [Maybe MarketplaceNote]
1293+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1294+
1295+-- | Creates a value of 'GetOrderNotesResponse' with the minimum fields required to make a request.
1296+--
1297+-- Use one of the following lenses to modify other fields as desired:
1298+--
1299+-- * 'gonrNotes'
1300+getOrderNotesResponse
1301+ :: GetOrderNotesResponse
1302+getOrderNotesResponse =
1303+ GetOrderNotesResponse
1304+ { _gonrNotes = Nothing
1305+ }
1306+
1307+-- | The list of matching notes.
1308+gonrNotes :: Lens' GetOrderNotesResponse [Maybe MarketplaceNote]
1309+gonrNotes
1310+ = lens _gonrNotes (\ s a -> s{_gonrNotes = a}) .
1311+ _Default
1312+ . _Coerce
1313+
1314+instance FromJSON GetOrderNotesResponse where
1315+ parseJSON
1316+ = withObject "GetOrderNotesResponse"
1317+ (\ o ->
1318+ GetOrderNotesResponse <$> (o .:? "notes" .!= mempty))
1319+
1320+instance ToJSON GetOrderNotesResponse where
1321+ toJSON GetOrderNotesResponse{..}
1322+ = object (catMaybes [("notes" .=) <$> _gonrNotes])
1323+
1324+--
1325+-- /See:/ 'createOrdersRequest' smart constructor.
1326+data CreateOrdersRequest = CreateOrdersRequest
1327+ { _cWebPropertyCode :: !(Maybe Text)
1328+ , _cOrders :: !(Maybe [Maybe MarketplaceOrder])
1329+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1330+
1331+-- | Creates a value of 'CreateOrdersRequest' with the minimum fields required to make a request.
1332+--
1333+-- Use one of the following lenses to modify other fields as desired:
1334+--
1335+-- * 'cWebPropertyCode'
1336+--
1337+-- * 'cOrders'
1338+createOrdersRequest
1339+ :: CreateOrdersRequest
1340+createOrdersRequest =
1341+ CreateOrdersRequest
1342+ { _cWebPropertyCode = Nothing
1343+ , _cOrders = Nothing
1344+ }
1345+
1346+cWebPropertyCode :: Lens' CreateOrdersRequest (Maybe Text)
1347+cWebPropertyCode
1348+ = lens _cWebPropertyCode
1349+ (\ s a -> s{_cWebPropertyCode = a})
1350+
1351+-- | The list of orders to create.
1352+cOrders :: Lens' CreateOrdersRequest [Maybe MarketplaceOrder]
1353+cOrders
1354+ = lens _cOrders (\ s a -> s{_cOrders = a}) . _Default
1355+ . _Coerce
1356+
1357+instance FromJSON CreateOrdersRequest where
1358+ parseJSON
1359+ = withObject "CreateOrdersRequest"
1360+ (\ o ->
1361+ CreateOrdersRequest <$>
1362+ (o .:? "webPropertyCode") <*>
1363+ (o .:? "orders" .!= mempty))
1364+
1365+instance ToJSON CreateOrdersRequest where
1366+ toJSON CreateOrdersRequest{..}
1367+ = object
1368+ (catMaybes
1369+ [("webPropertyCode" .=) <$> _cWebPropertyCode,
1370+ ("orders" .=) <$> _cOrders])
1371+
1372+-- | Used to specify pricing rules for buyers\/advertisers. Each
1373+-- PricePerBuyer in an offer can become [0,1] deals. To check if there is a
1374+-- PricePerBuyer for a particular buyer or buyer\/advertiser pair, we look
1375+-- for the most specific matching rule - we first look for a rule matching
1376+-- the buyer and advertiser, next a rule with the buyer but an empty
1377+-- advertiser list, and otherwise look for a matching rule where no buyer
1378+-- is set.
1379+--
1380+-- /See:/ 'pricePerBuyer' smart constructor.
1381+data PricePerBuyer = PricePerBuyer
1382+ { _ppbPrice :: !(Maybe (Maybe Price))
1383+ , _ppbBuyer :: !(Maybe (Maybe Buyer))
1384+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1385+
1386+-- | Creates a value of 'PricePerBuyer' with the minimum fields required to make a request.
1387+--
1388+-- Use one of the following lenses to modify other fields as desired:
1389+--
1390+-- * 'ppbPrice'
1391+--
1392+-- * 'ppbBuyer'
1393+pricePerBuyer
1394+ :: PricePerBuyer
1395+pricePerBuyer =
1396+ PricePerBuyer
1397+ { _ppbPrice = Nothing
1398+ , _ppbBuyer = Nothing
1399+ }
1400+
1401+-- | The specified price
1402+ppbPrice :: Lens' PricePerBuyer (Maybe (Maybe Price))
1403+ppbPrice = lens _ppbPrice (\ s a -> s{_ppbPrice = a})
1404+
1405+-- | The buyer who will pay this price. If unset, all buyers can pay this
1406+-- price (if the advertisers match, and there\'s no more specific rule
1407+-- matching the buyer).
1408+ppbBuyer :: Lens' PricePerBuyer (Maybe (Maybe Buyer))
1409+ppbBuyer = lens _ppbBuyer (\ s a -> s{_ppbBuyer = a})
1410+
1411+instance FromJSON PricePerBuyer where
1412+ parseJSON
1413+ = withObject "PricePerBuyer"
1414+ (\ o ->
1415+ PricePerBuyer <$>
1416+ (o .:? "price") <*> (o .:? "buyer"))
1417+
1418+instance ToJSON PricePerBuyer where
1419+ toJSON PricePerBuyer{..}
1420+ = object
1421+ (catMaybes
1422+ [("price" .=) <$> _ppbPrice,
1423+ ("buyer" .=) <$> _ppbBuyer])
1424+
1425+--
1426+-- /See:/ 'targetingValueDayPartTargetingDayPart' smart constructor.
1427+data TargetingValueDayPartTargetingDayPart = TargetingValueDayPartTargetingDayPart
1428+ { _tvdptdpEndHour :: !(Maybe Int32)
1429+ , _tvdptdpStartHour :: !(Maybe Int32)
1430+ , _tvdptdpStartMinute :: !(Maybe Int32)
1431+ , _tvdptdpDayOfWeek :: !(Maybe Text)
1432+ , _tvdptdpEndMinute :: !(Maybe Int32)
1433+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1434+
1435+-- | Creates a value of 'TargetingValueDayPartTargetingDayPart' with the minimum fields required to make a request.
1436+--
1437+-- Use one of the following lenses to modify other fields as desired:
1438+--
1439+-- * 'tvdptdpEndHour'
1440+--
1441+-- * 'tvdptdpStartHour'
1442+--
1443+-- * 'tvdptdpStartMinute'
1444+--
1445+-- * 'tvdptdpDayOfWeek'
1446+--
1447+-- * 'tvdptdpEndMinute'
1448+targetingValueDayPartTargetingDayPart
1449+ :: TargetingValueDayPartTargetingDayPart
1450+targetingValueDayPartTargetingDayPart =
1451+ TargetingValueDayPartTargetingDayPart
1452+ { _tvdptdpEndHour = Nothing
1453+ , _tvdptdpStartHour = Nothing
1454+ , _tvdptdpStartMinute = Nothing
1455+ , _tvdptdpDayOfWeek = Nothing
1456+ , _tvdptdpEndMinute = Nothing
1457+ }
1458+
1459+tvdptdpEndHour :: Lens' TargetingValueDayPartTargetingDayPart (Maybe Int32)
1460+tvdptdpEndHour
1461+ = lens _tvdptdpEndHour
1462+ (\ s a -> s{_tvdptdpEndHour = a})
1463+
1464+tvdptdpStartHour :: Lens' TargetingValueDayPartTargetingDayPart (Maybe Int32)
1465+tvdptdpStartHour
1466+ = lens _tvdptdpStartHour
1467+ (\ s a -> s{_tvdptdpStartHour = a})
1468+
1469+tvdptdpStartMinute :: Lens' TargetingValueDayPartTargetingDayPart (Maybe Int32)
1470+tvdptdpStartMinute
1471+ = lens _tvdptdpStartMinute
1472+ (\ s a -> s{_tvdptdpStartMinute = a})
1473+
1474+tvdptdpDayOfWeek :: Lens' TargetingValueDayPartTargetingDayPart (Maybe Text)
1475+tvdptdpDayOfWeek
1476+ = lens _tvdptdpDayOfWeek
1477+ (\ s a -> s{_tvdptdpDayOfWeek = a})
1478+
1479+tvdptdpEndMinute :: Lens' TargetingValueDayPartTargetingDayPart (Maybe Int32)
1480+tvdptdpEndMinute
1481+ = lens _tvdptdpEndMinute
1482+ (\ s a -> s{_tvdptdpEndMinute = a})
1483+
1484+instance FromJSON
1485+ TargetingValueDayPartTargetingDayPart where
1486+ parseJSON
1487+ = withObject "TargetingValueDayPartTargetingDayPart"
1488+ (\ o ->
1489+ TargetingValueDayPartTargetingDayPart <$>
1490+ (o .:? "endHour") <*> (o .:? "startHour") <*>
1491+ (o .:? "startMinute")
1492+ <*> (o .:? "dayOfWeek")
1493+ <*> (o .:? "endMinute"))
1494+
1495+instance ToJSON TargetingValueDayPartTargetingDayPart
1496+ where
1497+ toJSON TargetingValueDayPartTargetingDayPart{..}
1498+ = object
1499+ (catMaybes
1500+ [("endHour" .=) <$> _tvdptdpEndHour,
1501+ ("startHour" .=) <$> _tvdptdpStartHour,
1502+ ("startMinute" .=) <$> _tvdptdpStartMinute,
1503+ ("dayOfWeek" .=) <$> _tvdptdpDayOfWeek,
1504+ ("endMinute" .=) <$> _tvdptdpEndMinute])
1505+
1506+--
1507+-- /See:/ 'deliveryControl' smart constructor.
1508+data DeliveryControl = DeliveryControl
1509+ { _dcFrequencyCaps :: !(Maybe [Maybe DeliveryControlFrequencyCap])
1510+ , _dcDeliveryRateType :: !(Maybe Text)
1511+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1512+
1513+-- | Creates a value of 'DeliveryControl' with the minimum fields required to make a request.
1514+--
1515+-- Use one of the following lenses to modify other fields as desired:
1516+--
1517+-- * 'dcFrequencyCaps'
1518+--
1519+-- * 'dcDeliveryRateType'
1520+deliveryControl
1521+ :: DeliveryControl
1522+deliveryControl =
1523+ DeliveryControl
1524+ { _dcFrequencyCaps = Nothing
1525+ , _dcDeliveryRateType = Nothing
1526+ }
1527+
1528+dcFrequencyCaps :: Lens' DeliveryControl [Maybe DeliveryControlFrequencyCap]
1529+dcFrequencyCaps
1530+ = lens _dcFrequencyCaps
1531+ (\ s a -> s{_dcFrequencyCaps = a})
1532+ . _Default
1533+ . _Coerce
1534+
1535+dcDeliveryRateType :: Lens' DeliveryControl (Maybe Text)
1536+dcDeliveryRateType
1537+ = lens _dcDeliveryRateType
1538+ (\ s a -> s{_dcDeliveryRateType = a})
1539+
1540+instance FromJSON DeliveryControl where
1541+ parseJSON
1542+ = withObject "DeliveryControl"
1543+ (\ o ->
1544+ DeliveryControl <$>
1545+ (o .:? "frequencyCaps" .!= mempty) <*>
1546+ (o .:? "deliveryRateType"))
1547+
1548+instance ToJSON DeliveryControl where
1549+ toJSON DeliveryControl{..}
1550+ = object
1551+ (catMaybes
1552+ [("frequencyCaps" .=) <$> _dcFrequencyCaps,
1553+ ("deliveryRateType" .=) <$> _dcDeliveryRateType])
1554+
1555+-- | A creative and its classification data.
1556+--
1557+-- /See:/ 'creative' smart constructor.
1558+data Creative = Creative
1559+ { _cAttribute :: !(Maybe [Int32])
1560+ , _cNativeAd :: !(Maybe CreativeNATiveAd)
1561+ , _cHeight :: !(Maybe Int32)
1562+ , _cBuyerCreativeId :: !(Maybe Text)
1563+ , _cAdvertiserName :: !(Maybe Text)
1564+ , _cAgencyId :: !(Maybe Int64)
1565+ , _cCorrections :: !(Maybe [CreativeCorrectionsItem])
1566+ , _cProductCategories :: !(Maybe [Int32])
1567+ , _cKind :: !Text
1568+ , _cHTMLSnippet :: !(Maybe Text)
1569+ , _cAdvertiserId :: !(Maybe [Int64])
1570+ , _cRestrictedCategories :: !(Maybe [Int32])
1571+ , _cDealsStatus :: !(Maybe Text)
1572+ , _cWidth :: !(Maybe Int32)
1573+ , _cClickThroughUrl :: !(Maybe [Text])
1574+ , _cVendorType :: !(Maybe [Int32])
1575+ , _cAccountId :: !(Maybe Int32)
1576+ , _cImpressionTrackingUrl :: !(Maybe [Text])
1577+ , _cFilteringReasons :: !(Maybe CreativeFilteringReasons)
1578+ , _cVersion :: !(Maybe Int32)
1579+ , _cSensitiveCategories :: !(Maybe [Int32])
1580+ , _cVideoURL :: !(Maybe Text)
1581+ , _cApiUploadTimestamp :: !(Maybe UTCTime)
1582+ , _cServingRestrictions :: !(Maybe [CreativeServingRestrictionsItem])
1583+ , _cOpenAuctionStatus :: !(Maybe Text)
1584+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1585+
1586+-- | Creates a value of 'Creative' with the minimum fields required to make a request.
1587+--
1588+-- Use one of the following lenses to modify other fields as desired:
1589+--
1590+-- * 'cAttribute'
1591+--
1592+-- * 'cNativeAd'
1593+--
1594+-- * 'cHeight'
1595+--
1596+-- * 'cBuyerCreativeId'
1597+--
1598+-- * 'cAdvertiserName'
1599+--
1600+-- * 'cAgencyId'
1601+--
1602+-- * 'cCorrections'
1603+--
1604+-- * 'cProductCategories'
1605+--
1606+-- * 'cKind'
1607+--
1608+-- * 'cHTMLSnippet'
1609+--
1610+-- * 'cAdvertiserId'
1611+--
1612+-- * 'cRestrictedCategories'
1613+--
1614+-- * 'cDealsStatus'
1615+--
1616+-- * 'cWidth'
1617+--
1618+-- * 'cClickThroughUrl'
1619+--
1620+-- * 'cVendorType'
1621+--
1622+-- * 'cAccountId'
1623+--
1624+-- * 'cImpressionTrackingUrl'
1625+--
1626+-- * 'cFilteringReasons'
1627+--
1628+-- * 'cVersion'
1629+--
1630+-- * 'cSensitiveCategories'
1631+--
1632+-- * 'cVideoURL'
1633+--
1634+-- * 'cApiUploadTimestamp'
1635+--
1636+-- * 'cServingRestrictions'
1637+--
1638+-- * 'cOpenAuctionStatus'
1639+creative
1640+ :: Creative
1641+creative =
1642+ Creative
1643+ { _cAttribute = Nothing
1644+ , _cNativeAd = Nothing
1645+ , _cHeight = Nothing
1646+ , _cBuyerCreativeId = Nothing
1647+ , _cAdvertiserName = Nothing
1648+ , _cAgencyId = Nothing
1649+ , _cCorrections = Nothing
1650+ , _cProductCategories = Nothing
1651+ , _cKind = "adexchangebuyer#creative"
1652+ , _cHTMLSnippet = Nothing
1653+ , _cAdvertiserId = Nothing
1654+ , _cRestrictedCategories = Nothing
1655+ , _cDealsStatus = Nothing
1656+ , _cWidth = Nothing
1657+ , _cClickThroughUrl = Nothing
1658+ , _cVendorType = Nothing
1659+ , _cAccountId = Nothing
1660+ , _cImpressionTrackingUrl = Nothing
1661+ , _cFilteringReasons = Nothing
1662+ , _cVersion = Nothing
1663+ , _cSensitiveCategories = Nothing
1664+ , _cVideoURL = Nothing
1665+ , _cApiUploadTimestamp = Nothing
1666+ , _cServingRestrictions = Nothing
1667+ , _cOpenAuctionStatus = Nothing
1668+ }
1669+
1670+-- | All attributes for the ads that may be shown from this snippet.
1671+cAttribute :: Lens' Creative [Int32]
1672+cAttribute
1673+ = lens _cAttribute (\ s a -> s{_cAttribute = a}) .
1674+ _Default
1675+ . _Coerce
1676+
1677+-- | If nativeAd is set, HTMLSnippet and videoURL should not be set.
1678+cNativeAd :: Lens' Creative (Maybe CreativeNATiveAd)
1679+cNativeAd
1680+ = lens _cNativeAd (\ s a -> s{_cNativeAd = a})
1681+
1682+-- | Ad height.
1683+cHeight :: Lens' Creative (Maybe Int32)
1684+cHeight = lens _cHeight (\ s a -> s{_cHeight = a})
1685+
1686+-- | A buyer-specific id identifying the creative in this ad.
1687+cBuyerCreativeId :: Lens' Creative (Maybe Text)
1688+cBuyerCreativeId
1689+ = lens _cBuyerCreativeId
1690+ (\ s a -> s{_cBuyerCreativeId = a})
1691+
1692+-- | The name of the company being advertised in the creative.
1693+cAdvertiserName :: Lens' Creative (Maybe Text)
1694+cAdvertiserName
1695+ = lens _cAdvertiserName
1696+ (\ s a -> s{_cAdvertiserName = a})
1697+
1698+-- | The agency id for this creative.
1699+cAgencyId :: Lens' Creative (Maybe Int64)
1700+cAgencyId
1701+ = lens _cAgencyId (\ s a -> s{_cAgencyId = a})
1702+
1703+-- | Shows any corrections that were applied to this creative. Read-only.
1704+-- This field should not be set in requests.
1705+cCorrections :: Lens' Creative [CreativeCorrectionsItem]
1706+cCorrections
1707+ = lens _cCorrections (\ s a -> s{_cCorrections = a})
1708+ . _Default
1709+ . _Coerce
1710+
1711+-- | Detected product categories, if any. Read-only. This field should not be
1712+-- set in requests.
1713+cProductCategories :: Lens' Creative [Int32]
1714+cProductCategories
1715+ = lens _cProductCategories
1716+ (\ s a -> s{_cProductCategories = a})
1717+ . _Default
1718+ . _Coerce
1719+
1720+-- | Resource type.
1721+cKind :: Lens' Creative Text
1722+cKind = lens _cKind (\ s a -> s{_cKind = a})
1723+
1724+-- | The HTML snippet that displays the ad when inserted in the web page. If
1725+-- set, videoURL should not be set.
1726+cHTMLSnippet :: Lens' Creative (Maybe Text)
1727+cHTMLSnippet
1728+ = lens _cHTMLSnippet (\ s a -> s{_cHTMLSnippet = a})
1729+
1730+-- | Detected advertiser id, if any. Read-only. This field should not be set
1731+-- in requests.
1732+cAdvertiserId :: Lens' Creative [Int64]
1733+cAdvertiserId
1734+ = lens _cAdvertiserId
1735+ (\ s a -> s{_cAdvertiserId = a})
1736+ . _Default
1737+ . _Coerce
1738+
1739+-- | All restricted categories for the ads that may be shown from this
1740+-- snippet.
1741+cRestrictedCategories :: Lens' Creative [Int32]
1742+cRestrictedCategories
1743+ = lens _cRestrictedCategories
1744+ (\ s a -> s{_cRestrictedCategories = a})
1745+ . _Default
1746+ . _Coerce
1747+
1748+-- | Top-level deals status. Read-only. This field should not be set in
1749+-- requests. If disapproved, an entry for auctionType=DIRECT_DEALS (or ALL)
1750+-- in servingRestrictions will also exist. Note that this may be nuanced
1751+-- with other contextual restrictions, in which case it may be preferable
1752+-- to read from servingRestrictions directly.
1753+cDealsStatus :: Lens' Creative (Maybe Text)
1754+cDealsStatus
1755+ = lens _cDealsStatus (\ s a -> s{_cDealsStatus = a})
1756+
1757+-- | Ad width.
1758+cWidth :: Lens' Creative (Maybe Int32)
1759+cWidth = lens _cWidth (\ s a -> s{_cWidth = a})
1760+
1761+-- | The set of destination urls for the snippet.
1762+cClickThroughUrl :: Lens' Creative [Text]
1763+cClickThroughUrl
1764+ = lens _cClickThroughUrl
1765+ (\ s a -> s{_cClickThroughUrl = a})
1766+ . _Default
1767+ . _Coerce
1768+
1769+-- | All vendor types for the ads that may be shown from this snippet.
1770+cVendorType :: Lens' Creative [Int32]
1771+cVendorType
1772+ = lens _cVendorType (\ s a -> s{_cVendorType = a}) .
1773+ _Default
1774+ . _Coerce
1775+
1776+-- | Account id.
1777+cAccountId :: Lens' Creative (Maybe Int32)
1778+cAccountId
1779+ = lens _cAccountId (\ s a -> s{_cAccountId = a})
1780+
1781+-- | The set of urls to be called to record an impression.
1782+cImpressionTrackingUrl :: Lens' Creative [Text]
1783+cImpressionTrackingUrl
1784+ = lens _cImpressionTrackingUrl
1785+ (\ s a -> s{_cImpressionTrackingUrl = a})
1786+ . _Default
1787+ . _Coerce
1788+
1789+-- | The filtering reasons for the creative. Read-only. This field should not
1790+-- be set in requests.
1791+cFilteringReasons :: Lens' Creative (Maybe CreativeFilteringReasons)
1792+cFilteringReasons
1793+ = lens _cFilteringReasons
1794+ (\ s a -> s{_cFilteringReasons = a})
1795+
1796+-- | The version for this creative. Read-only. This field should not be set
1797+-- in requests.
1798+cVersion :: Lens' Creative (Maybe Int32)
1799+cVersion = lens _cVersion (\ s a -> s{_cVersion = a})
1800+
1801+-- | Detected sensitive categories, if any. Read-only. This field should not
1802+-- be set in requests.
1803+cSensitiveCategories :: Lens' Creative [Int32]
1804+cSensitiveCategories
1805+ = lens _cSensitiveCategories
1806+ (\ s a -> s{_cSensitiveCategories = a})
1807+ . _Default
1808+ . _Coerce
1809+
1810+-- | The url to fetch a video ad. If set, HTMLSnippet should not be set.
1811+cVideoURL :: Lens' Creative (Maybe Text)
1812+cVideoURL
1813+ = lens _cVideoURL (\ s a -> s{_cVideoURL = a})
1814+
1815+-- | The last upload timestamp of this creative if it was uploaded via API.
1816+-- Read-only. The value of this field is generated, and will be ignored for
1817+-- uploads. (formatted RFC 3339 timestamp).
1818+cApiUploadTimestamp :: Lens' Creative (Maybe UTCTime)
1819+cApiUploadTimestamp
1820+ = lens _cApiUploadTimestamp
1821+ (\ s a -> s{_cApiUploadTimestamp = a})
1822+
1823+-- | The granular status of this ad in specific contexts. A context here
1824+-- relates to where something ultimately serves (for example, a physical
1825+-- location, a platform, an HTTPS vs HTTP request, or the type of auction).
1826+-- Read-only. This field should not be set in requests.
1827+cServingRestrictions :: Lens' Creative [CreativeServingRestrictionsItem]
1828+cServingRestrictions
1829+ = lens _cServingRestrictions
1830+ (\ s a -> s{_cServingRestrictions = a})
1831+ . _Default
1832+ . _Coerce
1833+
1834+-- | Top-level open auction status. Read-only. This field should not be set
1835+-- in requests. If disapproved, an entry for auctionType=OPEN_AUCTION (or
1836+-- ALL) in servingRestrictions will also exist. Note that this may be
1837+-- nuanced with other contextual restrictions, in which case it may be
1838+-- preferable to read from ServingRestrictions directly.
1839+cOpenAuctionStatus :: Lens' Creative (Maybe Text)
1840+cOpenAuctionStatus
1841+ = lens _cOpenAuctionStatus
1842+ (\ s a -> s{_cOpenAuctionStatus = a})
1843+
1844+instance FromJSON Creative where
1845+ parseJSON
1846+ = withObject "Creative"
1847+ (\ o ->
1848+ Creative <$>
1849+ (o .:? "attribute" .!= mempty) <*> (o .:? "nativeAd")
1850+ <*> (o .:? "height")
1851+ <*> (o .:? "buyerCreativeId")
1852+ <*> (o .:? "advertiserName")
1853+ <*> (o .:? "agencyId")
1854+ <*> (o .:? "corrections" .!= mempty)
1855+ <*> (o .:? "productCategories" .!= mempty)
1856+ <*> (o .:? "kind" .!= "adexchangebuyer#creative")
1857+ <*> (o .:? "HTMLSnippet")
1858+ <*> (o .:? "advertiserId" .!= mempty)
1859+ <*> (o .:? "restrictedCategories" .!= mempty)
1860+ <*> (o .:? "dealsStatus")
1861+ <*> (o .:? "width")
1862+ <*> (o .:? "clickThroughUrl" .!= mempty)
1863+ <*> (o .:? "vendorType" .!= mempty)
1864+ <*> (o .:? "accountId")
1865+ <*> (o .:? "impressionTrackingUrl" .!= mempty)
1866+ <*> (o .:? "filteringReasons")
1867+ <*> (o .:? "version")
1868+ <*> (o .:? "sensitiveCategories" .!= mempty)
1869+ <*> (o .:? "videoURL")
1870+ <*> (o .:? "api_upload_timestamp")
1871+ <*> (o .:? "servingRestrictions" .!= mempty)
1872+ <*> (o .:? "openAuctionStatus"))
1873+
1874+instance ToJSON Creative where
1875+ toJSON Creative{..}
1876+ = object
1877+ (catMaybes
1878+ [("attribute" .=) <$> _cAttribute,
1879+ ("nativeAd" .=) <$> _cNativeAd,
1880+ ("height" .=) <$> _cHeight,
1881+ ("buyerCreativeId" .=) <$> _cBuyerCreativeId,
1882+ ("advertiserName" .=) <$> _cAdvertiserName,
1883+ ("agencyId" .=) <$> _cAgencyId,
1884+ ("corrections" .=) <$> _cCorrections,
1885+ ("productCategories" .=) <$> _cProductCategories,
1886+ Just ("kind" .= _cKind),
1887+ ("HTMLSnippet" .=) <$> _cHTMLSnippet,
1888+ ("advertiserId" .=) <$> _cAdvertiserId,
1889+ ("restrictedCategories" .=) <$>
1890+ _cRestrictedCategories,
1891+ ("dealsStatus" .=) <$> _cDealsStatus,
1892+ ("width" .=) <$> _cWidth,
1893+ ("clickThroughUrl" .=) <$> _cClickThroughUrl,
1894+ ("vendorType" .=) <$> _cVendorType,
1895+ ("accountId" .=) <$> _cAccountId,
1896+ ("impressionTrackingUrl" .=) <$>
1897+ _cImpressionTrackingUrl,
1898+ ("filteringReasons" .=) <$> _cFilteringReasons,
1899+ ("version" .=) <$> _cVersion,
1900+ ("sensitiveCategories" .=) <$> _cSensitiveCategories,
1901+ ("videoURL" .=) <$> _cVideoURL,
1902+ ("api_upload_timestamp" .=) <$> _cApiUploadTimestamp,
1903+ ("servingRestrictions" .=) <$> _cServingRestrictions,
1904+ ("openAuctionStatus" .=) <$> _cOpenAuctionStatus])
1905+
1906+--
1907+-- /See:/ 'addOrderDealsResponse' smart constructor.
1908+data AddOrderDealsResponse = AddOrderDealsResponse
1909+ { _aodrDeals :: !(Maybe [Maybe MarketplaceDeal])
1910+ , _aodrOrderRevisionNumber :: !(Maybe Int64)
1911+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1912+
1913+-- | Creates a value of 'AddOrderDealsResponse' with the minimum fields required to make a request.
1914+--
1915+-- Use one of the following lenses to modify other fields as desired:
1916+--
1917+-- * 'aodrDeals'
1918+--
1919+-- * 'aodrOrderRevisionNumber'
1920+addOrderDealsResponse
1921+ :: AddOrderDealsResponse
1922+addOrderDealsResponse =
1923+ AddOrderDealsResponse
1924+ { _aodrDeals = Nothing
1925+ , _aodrOrderRevisionNumber = Nothing
1926+ }
1927+
1928+-- | List of deals added (in the same order as passed in the request)
1929+aodrDeals :: Lens' AddOrderDealsResponse [Maybe MarketplaceDeal]
1930+aodrDeals
1931+ = lens _aodrDeals (\ s a -> s{_aodrDeals = a}) .
1932+ _Default
1933+ . _Coerce
1934+
1935+-- | The updated revision number for the order.
1936+aodrOrderRevisionNumber :: Lens' AddOrderDealsResponse (Maybe Int64)
1937+aodrOrderRevisionNumber
1938+ = lens _aodrOrderRevisionNumber
1939+ (\ s a -> s{_aodrOrderRevisionNumber = a})
1940+
1941+instance FromJSON AddOrderDealsResponse where
1942+ parseJSON
1943+ = withObject "AddOrderDealsResponse"
1944+ (\ o ->
1945+ AddOrderDealsResponse <$>
1946+ (o .:? "deals" .!= mempty) <*>
1947+ (o .:? "orderRevisionNumber"))
1948+
1949+instance ToJSON AddOrderDealsResponse where
1950+ toJSON AddOrderDealsResponse{..}
1951+ = object
1952+ (catMaybes
1953+ [("deals" .=) <$> _aodrDeals,
1954+ ("orderRevisionNumber" .=) <$>
1955+ _aodrOrderRevisionNumber])
1956+
1957+--
1958+-- /See:/ 'pretargetingConfigList' smart constructor.
1959+data PretargetingConfigList = PretargetingConfigList
1960+ { _pclKind :: !Text
1961+ , _pclItems :: !(Maybe [Maybe PretargetingConfig])
1962+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
1963+
1964+-- | Creates a value of 'PretargetingConfigList' with the minimum fields required to make a request.
1965+--
1966+-- Use one of the following lenses to modify other fields as desired:
1967+--
1968+-- * 'pclKind'
1969+--
1970+-- * 'pclItems'
1971+pretargetingConfigList
1972+ :: PretargetingConfigList
1973+pretargetingConfigList =
1974+ PretargetingConfigList
1975+ { _pclKind = "adexchangebuyer#pretargetingConfigList"
1976+ , _pclItems = Nothing
1977+ }
1978+
1979+-- | Resource type.
1980+pclKind :: Lens' PretargetingConfigList Text
1981+pclKind = lens _pclKind (\ s a -> s{_pclKind = a})
1982+
1983+-- | A list of pretargeting configs
1984+pclItems :: Lens' PretargetingConfigList [Maybe PretargetingConfig]
1985+pclItems
1986+ = lens _pclItems (\ s a -> s{_pclItems = a}) .
1987+ _Default
1988+ . _Coerce
1989+
1990+instance FromJSON PretargetingConfigList where
1991+ parseJSON
1992+ = withObject "PretargetingConfigList"
1993+ (\ o ->
1994+ PretargetingConfigList <$>
1995+ (o .:? "kind" .!=
1996+ "adexchangebuyer#pretargetingConfigList")
1997+ <*> (o .:? "items" .!= mempty))
1998+
1999+instance ToJSON PretargetingConfigList where
2000+ toJSON PretargetingConfigList{..}
2001+ = object
2002+ (catMaybes
2003+ [Just ("kind" .= _pclKind),
2004+ ("items" .=) <$> _pclItems])
2005+
2006+--
2007+-- /See:/ 'buyerDto' smart constructor.
2008+data BuyerDto = BuyerDto
2009+ { _buySponsorAccountId :: !(Maybe Int32)
2010+ , _buyEnabledForInterestTargetingDeals :: !(Maybe Bool)
2011+ , _buyCustomerId :: !(Maybe Int32)
2012+ , _buyEnabledForPreferredDeals :: !(Maybe Bool)
2013+ , _buyAccountId :: !(Maybe Int32)
2014+ , _buyDisplayName :: !(Maybe Text)
2015+ , _buyId :: !(Maybe Int32)
2016+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2017+
2018+-- | Creates a value of 'BuyerDto' with the minimum fields required to make a request.
2019+--
2020+-- Use one of the following lenses to modify other fields as desired:
2021+--
2022+-- * 'buySponsorAccountId'
2023+--
2024+-- * 'buyEnabledForInterestTargetingDeals'
2025+--
2026+-- * 'buyCustomerId'
2027+--
2028+-- * 'buyEnabledForPreferredDeals'
2029+--
2030+-- * 'buyAccountId'
2031+--
2032+-- * 'buyDisplayName'
2033+--
2034+-- * 'buyId'
2035+buyerDto
2036+ :: BuyerDto
2037+buyerDto =
2038+ BuyerDto
2039+ { _buySponsorAccountId = Nothing
2040+ , _buyEnabledForInterestTargetingDeals = Nothing
2041+ , _buyCustomerId = Nothing
2042+ , _buyEnabledForPreferredDeals = Nothing
2043+ , _buyAccountId = Nothing
2044+ , _buyDisplayName = Nothing
2045+ , _buyId = Nothing
2046+ }
2047+
2048+buySponsorAccountId :: Lens' BuyerDto (Maybe Int32)
2049+buySponsorAccountId
2050+ = lens _buySponsorAccountId
2051+ (\ s a -> s{_buySponsorAccountId = a})
2052+
2053+buyEnabledForInterestTargetingDeals :: Lens' BuyerDto (Maybe Bool)
2054+buyEnabledForInterestTargetingDeals
2055+ = lens _buyEnabledForInterestTargetingDeals
2056+ (\ s a ->
2057+ s{_buyEnabledForInterestTargetingDeals = a})
2058+
2059+buyCustomerId :: Lens' BuyerDto (Maybe Int32)
2060+buyCustomerId
2061+ = lens _buyCustomerId
2062+ (\ s a -> s{_buyCustomerId = a})
2063+
2064+buyEnabledForPreferredDeals :: Lens' BuyerDto (Maybe Bool)
2065+buyEnabledForPreferredDeals
2066+ = lens _buyEnabledForPreferredDeals
2067+ (\ s a -> s{_buyEnabledForPreferredDeals = a})
2068+
2069+buyAccountId :: Lens' BuyerDto (Maybe Int32)
2070+buyAccountId
2071+ = lens _buyAccountId (\ s a -> s{_buyAccountId = a})
2072+
2073+buyDisplayName :: Lens' BuyerDto (Maybe Text)
2074+buyDisplayName
2075+ = lens _buyDisplayName
2076+ (\ s a -> s{_buyDisplayName = a})
2077+
2078+buyId :: Lens' BuyerDto (Maybe Int32)
2079+buyId = lens _buyId (\ s a -> s{_buyId = a})
2080+
2081+instance FromJSON BuyerDto where
2082+ parseJSON
2083+ = withObject "BuyerDto"
2084+ (\ o ->
2085+ BuyerDto <$>
2086+ (o .:? "sponsorAccountId") <*>
2087+ (o .:? "enabledForInterestTargetingDeals")
2088+ <*> (o .:? "customerId")
2089+ <*> (o .:? "enabledForPreferredDeals")
2090+ <*> (o .:? "accountId")
2091+ <*> (o .:? "displayName")
2092+ <*> (o .:? "id"))
2093+
2094+instance ToJSON BuyerDto where
2095+ toJSON BuyerDto{..}
2096+ = object
2097+ (catMaybes
2098+ [("sponsorAccountId" .=) <$> _buySponsorAccountId,
2099+ ("enabledForInterestTargetingDeals" .=) <$>
2100+ _buyEnabledForInterestTargetingDeals,
2101+ ("customerId" .=) <$> _buyCustomerId,
2102+ ("enabledForPreferredDeals" .=) <$>
2103+ _buyEnabledForPreferredDeals,
2104+ ("accountId" .=) <$> _buyAccountId,
2105+ ("displayName" .=) <$> _buyDisplayName,
2106+ ("id" .=) <$> _buyId])
2107+
2108+--
2109+-- /See:/ 'dealTermsNonGuaranteedFixedPriceTerms' smart constructor.
2110+newtype DealTermsNonGuaranteedFixedPriceTerms = DealTermsNonGuaranteedFixedPriceTerms
2111+ { _dtngfptFixedPrices :: Maybe [Maybe PricePerBuyer]
2112+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2113+
2114+-- | Creates a value of 'DealTermsNonGuaranteedFixedPriceTerms' with the minimum fields required to make a request.
2115+--
2116+-- Use one of the following lenses to modify other fields as desired:
2117+--
2118+-- * 'dtngfptFixedPrices'
2119+dealTermsNonGuaranteedFixedPriceTerms
2120+ :: DealTermsNonGuaranteedFixedPriceTerms
2121+dealTermsNonGuaranteedFixedPriceTerms =
2122+ DealTermsNonGuaranteedFixedPriceTerms
2123+ { _dtngfptFixedPrices = Nothing
2124+ }
2125+
2126+-- | Fixed price for the specified buyer.
2127+dtngfptFixedPrices :: Lens' DealTermsNonGuaranteedFixedPriceTerms [Maybe PricePerBuyer]
2128+dtngfptFixedPrices
2129+ = lens _dtngfptFixedPrices
2130+ (\ s a -> s{_dtngfptFixedPrices = a})
2131+ . _Default
2132+ . _Coerce
2133+
2134+instance FromJSON
2135+ DealTermsNonGuaranteedFixedPriceTerms where
2136+ parseJSON
2137+ = withObject "DealTermsNonGuaranteedFixedPriceTerms"
2138+ (\ o ->
2139+ DealTermsNonGuaranteedFixedPriceTerms <$>
2140+ (o .:? "fixedPrices" .!= mempty))
2141+
2142+instance ToJSON DealTermsNonGuaranteedFixedPriceTerms
2143+ where
2144+ toJSON DealTermsNonGuaranteedFixedPriceTerms{..}
2145+ = object
2146+ (catMaybes
2147+ [("fixedPrices" .=) <$> _dtngfptFixedPrices])
2148+
2149+--
2150+-- /See:/ 'adSlotDto' smart constructor.
2151+data AdSlotDto = AdSlotDto
2152+ { _asdWebPropertyId :: !(Maybe Int32)
2153+ , _asdSize :: !(Maybe Text)
2154+ , _asdChannelCode :: !(Maybe Text)
2155+ , _asdChannelId :: !(Maybe Int32)
2156+ , _asdName :: !(Maybe Text)
2157+ , _asdDescription :: !(Maybe Text)
2158+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2159+
2160+-- | Creates a value of 'AdSlotDto' with the minimum fields required to make a request.
2161+--
2162+-- Use one of the following lenses to modify other fields as desired:
2163+--
2164+-- * 'asdWebPropertyId'
2165+--
2166+-- * 'asdSize'
2167+--
2168+-- * 'asdChannelCode'
2169+--
2170+-- * 'asdChannelId'
2171+--
2172+-- * 'asdName'
2173+--
2174+-- * 'asdDescription'
2175+adSlotDto
2176+ :: AdSlotDto
2177+adSlotDto =
2178+ AdSlotDto
2179+ { _asdWebPropertyId = Nothing
2180+ , _asdSize = Nothing
2181+ , _asdChannelCode = Nothing
2182+ , _asdChannelId = Nothing
2183+ , _asdName = Nothing
2184+ , _asdDescription = Nothing
2185+ }
2186+
2187+asdWebPropertyId :: Lens' AdSlotDto (Maybe Int32)
2188+asdWebPropertyId
2189+ = lens _asdWebPropertyId
2190+ (\ s a -> s{_asdWebPropertyId = a})
2191+
2192+asdSize :: Lens' AdSlotDto (Maybe Text)
2193+asdSize = lens _asdSize (\ s a -> s{_asdSize = a})
2194+
2195+asdChannelCode :: Lens' AdSlotDto (Maybe Text)
2196+asdChannelCode
2197+ = lens _asdChannelCode
2198+ (\ s a -> s{_asdChannelCode = a})
2199+
2200+asdChannelId :: Lens' AdSlotDto (Maybe Int32)
2201+asdChannelId
2202+ = lens _asdChannelId (\ s a -> s{_asdChannelId = a})
2203+
2204+asdName :: Lens' AdSlotDto (Maybe Text)
2205+asdName = lens _asdName (\ s a -> s{_asdName = a})
2206+
2207+asdDescription :: Lens' AdSlotDto (Maybe Text)
2208+asdDescription
2209+ = lens _asdDescription
2210+ (\ s a -> s{_asdDescription = a})
2211+
2212+instance FromJSON AdSlotDto where
2213+ parseJSON
2214+ = withObject "AdSlotDto"
2215+ (\ o ->
2216+ AdSlotDto <$>
2217+ (o .:? "webPropertyId") <*> (o .:? "size") <*>
2218+ (o .:? "channelCode")
2219+ <*> (o .:? "channelId")
2220+ <*> (o .:? "name")
2221+ <*> (o .:? "description"))
2222+
2223+instance ToJSON AdSlotDto where
2224+ toJSON AdSlotDto{..}
2225+ = object
2226+ (catMaybes
2227+ [("webPropertyId" .=) <$> _asdWebPropertyId,
2228+ ("size" .=) <$> _asdSize,
2229+ ("channelCode" .=) <$> _asdChannelCode,
2230+ ("channelId" .=) <$> _asdChannelId,
2231+ ("name" .=) <$> _asdName,
2232+ ("description" .=) <$> _asdDescription])
2233+
2234+-- | The configuration data for an Ad Exchange performance report list.
2235+--
2236+-- /See:/ 'performanceReport' smart constructor.
2237+data PerformanceReport = PerformanceReport
2238+ { _prFilteredBidRate :: !(Maybe Double)
2239+ , _prKind :: !Text
2240+ , _prLatency95thPercentile :: !(Maybe Double)
2241+ , _prCookieMatcherStatusRate :: !(Maybe [JSON])
2242+ , _prHostedMatchStatusRate :: !(Maybe [JSON])
2243+ , _prUnsuccessfulRequestRate :: !(Maybe Double)
2244+ , _prBidRequestRate :: !(Maybe Double)
2245+ , _prQuotaThrottledLimit :: !(Maybe Double)
2246+ , _prQuotaConfiguredLimit :: !(Maybe Double)
2247+ , _prSuccessfulRequestRate :: !(Maybe Double)
2248+ , _prLatency85thPercentile :: !(Maybe Double)
2249+ , _prCalloutStatusRate :: !(Maybe [JSON])
2250+ , _prLatency50thPercentile :: !(Maybe Double)
2251+ , _prBidRate :: !(Maybe Double)
2252+ , _prCreativeStatusRate :: !(Maybe [JSON])
2253+ , _prNoQuotaInRegion :: !(Maybe Double)
2254+ , _prRegion :: !(Maybe Text)
2255+ , _prInventoryMatchRate :: !(Maybe Double)
2256+ , _prPixelMatchResponses :: !(Maybe Double)
2257+ , _prTimestamp :: !(Maybe Int64)
2258+ , _prPixelMatchRequests :: !(Maybe Double)
2259+ , _prOutOfQuota :: !(Maybe Double)
2260+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2261+
2262+-- | Creates a value of 'PerformanceReport' with the minimum fields required to make a request.
2263+--
2264+-- Use one of the following lenses to modify other fields as desired:
2265+--
2266+-- * 'prFilteredBidRate'
2267+--
2268+-- * 'prKind'
2269+--
2270+-- * 'prLatency95thPercentile'
2271+--
2272+-- * 'prCookieMatcherStatusRate'
2273+--
2274+-- * 'prHostedMatchStatusRate'
2275+--
2276+-- * 'prUnsuccessfulRequestRate'
2277+--
2278+-- * 'prBidRequestRate'
2279+--
2280+-- * 'prQuotaThrottledLimit'
2281+--
2282+-- * 'prQuotaConfiguredLimit'
2283+--
2284+-- * 'prSuccessfulRequestRate'
2285+--
2286+-- * 'prLatency85thPercentile'
2287+--
2288+-- * 'prCalloutStatusRate'
2289+--
2290+-- * 'prLatency50thPercentile'
2291+--
2292+-- * 'prBidRate'
2293+--
2294+-- * 'prCreativeStatusRate'
2295+--
2296+-- * 'prNoQuotaInRegion'
2297+--
2298+-- * 'prRegion'
2299+--
2300+-- * 'prInventoryMatchRate'
2301+--
2302+-- * 'prPixelMatchResponses'
2303+--
2304+-- * 'prTimestamp'
2305+--
2306+-- * 'prPixelMatchRequests'
2307+--
2308+-- * 'prOutOfQuota'
2309+performanceReport
2310+ :: PerformanceReport
2311+performanceReport =
2312+ PerformanceReport
2313+ { _prFilteredBidRate = Nothing
2314+ , _prKind = "adexchangebuyer#performanceReport"
2315+ , _prLatency95thPercentile = Nothing
2316+ , _prCookieMatcherStatusRate = Nothing
2317+ , _prHostedMatchStatusRate = Nothing
2318+ , _prUnsuccessfulRequestRate = Nothing
2319+ , _prBidRequestRate = Nothing
2320+ , _prQuotaThrottledLimit = Nothing
2321+ , _prQuotaConfiguredLimit = Nothing
2322+ , _prSuccessfulRequestRate = Nothing
2323+ , _prLatency85thPercentile = Nothing
2324+ , _prCalloutStatusRate = Nothing
2325+ , _prLatency50thPercentile = Nothing
2326+ , _prBidRate = Nothing
2327+ , _prCreativeStatusRate = Nothing
2328+ , _prNoQuotaInRegion = Nothing
2329+ , _prRegion = Nothing
2330+ , _prInventoryMatchRate = Nothing
2331+ , _prPixelMatchResponses = Nothing
2332+ , _prTimestamp = Nothing
2333+ , _prPixelMatchRequests = Nothing
2334+ , _prOutOfQuota = Nothing
2335+ }
2336+
2337+-- | The number of bid responses that were filtered due to a policy violation
2338+-- or other errors.
2339+prFilteredBidRate :: Lens' PerformanceReport (Maybe Double)
2340+prFilteredBidRate
2341+ = lens _prFilteredBidRate
2342+ (\ s a -> s{_prFilteredBidRate = a})
2343+
2344+-- | Resource type.
2345+prKind :: Lens' PerformanceReport Text
2346+prKind = lens _prKind (\ s a -> s{_prKind = a})
2347+
2348+-- | The 95th percentile round trip latency(ms) as perceived from Google
2349+-- servers for the duration period covered by the report.
2350+prLatency95thPercentile :: Lens' PerformanceReport (Maybe Double)
2351+prLatency95thPercentile
2352+ = lens _prLatency95thPercentile
2353+ (\ s a -> s{_prLatency95thPercentile = a})
2354+
2355+-- | Average QPS for cookie matcher operations.
2356+prCookieMatcherStatusRate :: Lens' PerformanceReport [JSON]
2357+prCookieMatcherStatusRate
2358+ = lens _prCookieMatcherStatusRate
2359+ (\ s a -> s{_prCookieMatcherStatusRate = a})
2360+ . _Default
2361+ . _Coerce
2362+
2363+-- | Average QPS for hosted match operations.
2364+prHostedMatchStatusRate :: Lens' PerformanceReport [JSON]
2365+prHostedMatchStatusRate
2366+ = lens _prHostedMatchStatusRate
2367+ (\ s a -> s{_prHostedMatchStatusRate = a})
2368+ . _Default
2369+ . _Coerce
2370+
2371+-- | The number of bid responses that were unsuccessful due to timeouts,
2372+-- incorrect formatting, etc.
2373+prUnsuccessfulRequestRate :: Lens' PerformanceReport (Maybe Double)
2374+prUnsuccessfulRequestRate
2375+ = lens _prUnsuccessfulRequestRate
2376+ (\ s a -> s{_prUnsuccessfulRequestRate = a})
2377+
2378+-- | The number of bid requests sent to your bidder.
2379+prBidRequestRate :: Lens' PerformanceReport (Maybe Double)
2380+prBidRequestRate
2381+ = lens _prBidRequestRate
2382+ (\ s a -> s{_prBidRequestRate = a})
2383+
2384+-- | The throttled quota limits for this account.
2385+prQuotaThrottledLimit :: Lens' PerformanceReport (Maybe Double)
2386+prQuotaThrottledLimit
2387+ = lens _prQuotaThrottledLimit
2388+ (\ s a -> s{_prQuotaThrottledLimit = a})
2389+
2390+-- | The configured quota limits for this account.
2391+prQuotaConfiguredLimit :: Lens' PerformanceReport (Maybe Double)
2392+prQuotaConfiguredLimit
2393+ = lens _prQuotaConfiguredLimit
2394+ (\ s a -> s{_prQuotaConfiguredLimit = a})
2395+
2396+-- | The number of properly formed bid responses received by our servers
2397+-- within the deadline.
2398+prSuccessfulRequestRate :: Lens' PerformanceReport (Maybe Double)
2399+prSuccessfulRequestRate
2400+ = lens _prSuccessfulRequestRate
2401+ (\ s a -> s{_prSuccessfulRequestRate = a})
2402+
2403+-- | The 85th percentile round trip latency(ms) as perceived from Google
2404+-- servers for the duration period covered by the report.
2405+prLatency85thPercentile :: Lens' PerformanceReport (Maybe Double)
2406+prLatency85thPercentile
2407+ = lens _prLatency85thPercentile
2408+ (\ s a -> s{_prLatency85thPercentile = a})
2409+
2410+-- | Rate of various prefiltering statuses per match. Please refer to the
2411+-- callout-status-codes.txt file for different statuses.
2412+prCalloutStatusRate :: Lens' PerformanceReport [JSON]
2413+prCalloutStatusRate
2414+ = lens _prCalloutStatusRate
2415+ (\ s a -> s{_prCalloutStatusRate = a})
2416+ . _Default
2417+ . _Coerce
2418+
2419+-- | The 50th percentile round trip latency(ms) as perceived from Google
2420+-- servers for the duration period covered by the report.
2421+prLatency50thPercentile :: Lens' PerformanceReport (Maybe Double)
2422+prLatency50thPercentile
2423+ = lens _prLatency50thPercentile
2424+ (\ s a -> s{_prLatency50thPercentile = a})
2425+
2426+-- | The number of bid responses with an ad.
2427+prBidRate :: Lens' PerformanceReport (Maybe Double)
2428+prBidRate
2429+ = lens _prBidRate (\ s a -> s{_prBidRate = a})
2430+
2431+-- | Rate of ads with a given status. Please refer to the
2432+-- creative-status-codes.txt file for different statuses.
2433+prCreativeStatusRate :: Lens' PerformanceReport [JSON]
2434+prCreativeStatusRate
2435+ = lens _prCreativeStatusRate
2436+ (\ s a -> s{_prCreativeStatusRate = a})
2437+ . _Default
2438+ . _Coerce
2439+
2440+-- | Rate of various quota account statuses per quota check.
2441+prNoQuotaInRegion :: Lens' PerformanceReport (Maybe Double)
2442+prNoQuotaInRegion
2443+ = lens _prNoQuotaInRegion
2444+ (\ s a -> s{_prNoQuotaInRegion = a})
2445+
2446+-- | The trading location of this data.
2447+prRegion :: Lens' PerformanceReport (Maybe Text)
2448+prRegion = lens _prRegion (\ s a -> s{_prRegion = a})
2449+
2450+-- | The number of potential queries based on your pretargeting settings.
2451+prInventoryMatchRate :: Lens' PerformanceReport (Maybe Double)
2452+prInventoryMatchRate
2453+ = lens _prInventoryMatchRate
2454+ (\ s a -> s{_prInventoryMatchRate = a})
2455+
2456+-- | Average QPS for pixel match responses from clients.
2457+prPixelMatchResponses :: Lens' PerformanceReport (Maybe Double)
2458+prPixelMatchResponses
2459+ = lens _prPixelMatchResponses
2460+ (\ s a -> s{_prPixelMatchResponses = a})
2461+
2462+-- | The unix timestamp of the starting time of this performance data.
2463+prTimestamp :: Lens' PerformanceReport (Maybe Int64)
2464+prTimestamp
2465+ = lens _prTimestamp (\ s a -> s{_prTimestamp = a})
2466+
2467+-- | Average QPS for pixel match requests from clients.
2468+prPixelMatchRequests :: Lens' PerformanceReport (Maybe Double)
2469+prPixelMatchRequests
2470+ = lens _prPixelMatchRequests
2471+ (\ s a -> s{_prPixelMatchRequests = a})
2472+
2473+-- | Rate of various quota account statuses per quota check.
2474+prOutOfQuota :: Lens' PerformanceReport (Maybe Double)
2475+prOutOfQuota
2476+ = lens _prOutOfQuota (\ s a -> s{_prOutOfQuota = a})
2477+
2478+instance FromJSON PerformanceReport where
2479+ parseJSON
2480+ = withObject "PerformanceReport"
2481+ (\ o ->
2482+ PerformanceReport <$>
2483+ (o .:? "filteredBidRate") <*>
2484+ (o .:? "kind" .!=
2485+ "adexchangebuyer#performanceReport")
2486+ <*> (o .:? "latency95thPercentile")
2487+ <*> (o .:? "cookieMatcherStatusRate" .!= mempty)
2488+ <*> (o .:? "hostedMatchStatusRate" .!= mempty)
2489+ <*> (o .:? "unsuccessfulRequestRate")
2490+ <*> (o .:? "bidRequestRate")
2491+ <*> (o .:? "quotaThrottledLimit")
2492+ <*> (o .:? "quotaConfiguredLimit")
2493+ <*> (o .:? "successfulRequestRate")
2494+ <*> (o .:? "latency85thPercentile")
2495+ <*> (o .:? "calloutStatusRate" .!= mempty)
2496+ <*> (o .:? "latency50thPercentile")
2497+ <*> (o .:? "bidRate")
2498+ <*> (o .:? "creativeStatusRate" .!= mempty)
2499+ <*> (o .:? "noQuotaInRegion")
2500+ <*> (o .:? "region")
2501+ <*> (o .:? "inventoryMatchRate")
2502+ <*> (o .:? "pixelMatchResponses")
2503+ <*> (o .:? "timestamp")
2504+ <*> (o .:? "pixelMatchRequests")
2505+ <*> (o .:? "outOfQuota"))
2506+
2507+instance ToJSON PerformanceReport where
2508+ toJSON PerformanceReport{..}
2509+ = object
2510+ (catMaybes
2511+ [("filteredBidRate" .=) <$> _prFilteredBidRate,
2512+ Just ("kind" .= _prKind),
2513+ ("latency95thPercentile" .=) <$>
2514+ _prLatency95thPercentile,
2515+ ("cookieMatcherStatusRate" .=) <$>
2516+ _prCookieMatcherStatusRate,
2517+ ("hostedMatchStatusRate" .=) <$>
2518+ _prHostedMatchStatusRate,
2519+ ("unsuccessfulRequestRate" .=) <$>
2520+ _prUnsuccessfulRequestRate,
2521+ ("bidRequestRate" .=) <$> _prBidRequestRate,
2522+ ("quotaThrottledLimit" .=) <$>
2523+ _prQuotaThrottledLimit,
2524+ ("quotaConfiguredLimit" .=) <$>
2525+ _prQuotaConfiguredLimit,
2526+ ("successfulRequestRate" .=) <$>
2527+ _prSuccessfulRequestRate,
2528+ ("latency85thPercentile" .=) <$>
2529+ _prLatency85thPercentile,
2530+ ("calloutStatusRate" .=) <$> _prCalloutStatusRate,
2531+ ("latency50thPercentile" .=) <$>
2532+ _prLatency50thPercentile,
2533+ ("bidRate" .=) <$> _prBidRate,
2534+ ("creativeStatusRate" .=) <$> _prCreativeStatusRate,
2535+ ("noQuotaInRegion" .=) <$> _prNoQuotaInRegion,
2536+ ("region" .=) <$> _prRegion,
2537+ ("inventoryMatchRate" .=) <$> _prInventoryMatchRate,
2538+ ("pixelMatchResponses" .=) <$>
2539+ _prPixelMatchResponses,
2540+ ("timestamp" .=) <$> _prTimestamp,
2541+ ("pixelMatchRequests" .=) <$> _prPixelMatchRequests,
2542+ ("outOfQuota" .=) <$> _prOutOfQuota])
2543+
2544+-- | Configuration data for an Ad Exchange buyer account.
2545+--
2546+-- /See:/ 'account' smart constructor.
2547+data Account = Account
2548+ { _aMaximumTotalQps :: !(Maybe Int32)
2549+ , _aKind :: !Text
2550+ , _aCookieMatchingUrl :: !(Maybe Text)
2551+ , _aMaximumActiveCreatives :: !(Maybe Int32)
2552+ , _aCookieMatchingNid :: !(Maybe Text)
2553+ , _aNumberActiveCreatives :: !(Maybe Int32)
2554+ , _aId :: !(Maybe Int32)
2555+ , _aBidderLocation :: !(Maybe [AccountBidderLocationItem])
2556+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2557+
2558+-- | Creates a value of 'Account' with the minimum fields required to make a request.
2559+--
2560+-- Use one of the following lenses to modify other fields as desired:
2561+--
2562+-- * 'aMaximumTotalQps'
2563+--
2564+-- * 'aKind'
2565+--
2566+-- * 'aCookieMatchingUrl'
2567+--
2568+-- * 'aMaximumActiveCreatives'
2569+--
2570+-- * 'aCookieMatchingNid'
2571+--
2572+-- * 'aNumberActiveCreatives'
2573+--
2574+-- * 'aId'
2575+--
2576+-- * 'aBidderLocation'
2577+account
2578+ :: Account
2579+account =
2580+ Account
2581+ { _aMaximumTotalQps = Nothing
2582+ , _aKind = "adexchangebuyer#account"
2583+ , _aCookieMatchingUrl = Nothing
2584+ , _aMaximumActiveCreatives = Nothing
2585+ , _aCookieMatchingNid = Nothing
2586+ , _aNumberActiveCreatives = Nothing
2587+ , _aId = Nothing
2588+ , _aBidderLocation = Nothing
2589+ }
2590+
2591+-- | The sum of all bidderLocation.maximumQps values cannot exceed this.
2592+-- Please contact your technical account manager if you need to change
2593+-- this.
2594+aMaximumTotalQps :: Lens' Account (Maybe Int32)
2595+aMaximumTotalQps
2596+ = lens _aMaximumTotalQps
2597+ (\ s a -> s{_aMaximumTotalQps = a})
2598+
2599+-- | Resource type.
2600+aKind :: Lens' Account Text
2601+aKind = lens _aKind (\ s a -> s{_aKind = a})
2602+
2603+-- | The base URL used in cookie match requests.
2604+aCookieMatchingUrl :: Lens' Account (Maybe Text)
2605+aCookieMatchingUrl
2606+ = lens _aCookieMatchingUrl
2607+ (\ s a -> s{_aCookieMatchingUrl = a})
2608+
2609+-- | The maximum number of active creatives that an account can have, where a
2610+-- creative is active if it was inserted or bid with in the last 30 days.
2611+-- Please contact your technical account manager if you need to change
2612+-- this.
2613+aMaximumActiveCreatives :: Lens' Account (Maybe Int32)
2614+aMaximumActiveCreatives
2615+ = lens _aMaximumActiveCreatives
2616+ (\ s a -> s{_aMaximumActiveCreatives = a})
2617+
2618+-- | The nid parameter value used in cookie match requests. Please contact
2619+-- your technical account manager if you need to change this.
2620+aCookieMatchingNid :: Lens' Account (Maybe Text)
2621+aCookieMatchingNid
2622+ = lens _aCookieMatchingNid
2623+ (\ s a -> s{_aCookieMatchingNid = a})
2624+
2625+-- | The number of creatives that this account inserted or bid with in the
2626+-- last 30 days.
2627+aNumberActiveCreatives :: Lens' Account (Maybe Int32)
2628+aNumberActiveCreatives
2629+ = lens _aNumberActiveCreatives
2630+ (\ s a -> s{_aNumberActiveCreatives = a})
2631+
2632+-- | Account id.
2633+aId :: Lens' Account (Maybe Int32)
2634+aId = lens _aId (\ s a -> s{_aId = a})
2635+
2636+-- | Your bidder locations that have distinct URLs.
2637+aBidderLocation :: Lens' Account [AccountBidderLocationItem]
2638+aBidderLocation
2639+ = lens _aBidderLocation
2640+ (\ s a -> s{_aBidderLocation = a})
2641+ . _Default
2642+ . _Coerce
2643+
2644+instance FromJSON Account where
2645+ parseJSON
2646+ = withObject "Account"
2647+ (\ o ->
2648+ Account <$>
2649+ (o .:? "maximumTotalQps") <*>
2650+ (o .:? "kind" .!= "adexchangebuyer#account")
2651+ <*> (o .:? "cookieMatchingUrl")
2652+ <*> (o .:? "maximumActiveCreatives")
2653+ <*> (o .:? "cookieMatchingNid")
2654+ <*> (o .:? "numberActiveCreatives")
2655+ <*> (o .:? "id")
2656+ <*> (o .:? "bidderLocation" .!= mempty))
2657+
2658+instance ToJSON Account where
2659+ toJSON Account{..}
2660+ = object
2661+ (catMaybes
2662+ [("maximumTotalQps" .=) <$> _aMaximumTotalQps,
2663+ Just ("kind" .= _aKind),
2664+ ("cookieMatchingUrl" .=) <$> _aCookieMatchingUrl,
2665+ ("maximumActiveCreatives" .=) <$>
2666+ _aMaximumActiveCreatives,
2667+ ("cookieMatchingNid" .=) <$> _aCookieMatchingNid,
2668+ ("numberActiveCreatives" .=) <$>
2669+ _aNumberActiveCreatives,
2670+ ("id" .=) <$> _aId,
2671+ ("bidderLocation" .=) <$> _aBidderLocation])
2672+
2673+--
2674+-- /See:/ 'seller' smart constructor.
2675+data Seller = Seller
2676+ { _sAccountId :: !(Maybe Text)
2677+ , _sSubAccountId :: !(Maybe Text)
2678+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2679+
2680+-- | Creates a value of 'Seller' 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+-- * 'sAccountId'
2685+--
2686+-- * 'sSubAccountId'
2687+seller
2688+ :: Seller
2689+seller =
2690+ Seller
2691+ { _sAccountId = Nothing
2692+ , _sSubAccountId = Nothing
2693+ }
2694+
2695+-- | The unique id for the seller. The seller fills in this field. The seller
2696+-- account id is then available to buyer in the offer.
2697+sAccountId :: Lens' Seller (Maybe Text)
2698+sAccountId
2699+ = lens _sAccountId (\ s a -> s{_sAccountId = a})
2700+
2701+-- | Optional sub-account id for the seller.
2702+sSubAccountId :: Lens' Seller (Maybe Text)
2703+sSubAccountId
2704+ = lens _sSubAccountId
2705+ (\ s a -> s{_sSubAccountId = a})
2706+
2707+instance FromJSON Seller where
2708+ parseJSON
2709+ = withObject "Seller"
2710+ (\ o ->
2711+ Seller <$>
2712+ (o .:? "accountId") <*> (o .:? "subAccountId"))
2713+
2714+instance ToJSON Seller where
2715+ toJSON Seller{..}
2716+ = object
2717+ (catMaybes
2718+ [("accountId" .=) <$> _sAccountId,
2719+ ("subAccountId" .=) <$> _sSubAccountId])
2720+
2721+--
2722+-- /See:/ 'deleteOrderDealsRequest' smart constructor.
2723+data DeleteOrderDealsRequest = DeleteOrderDealsRequest
2724+ { _dodrUpdateAction :: !(Maybe Text)
2725+ , _dodrDealIds :: !(Maybe [Text])
2726+ , _dodrOrderRevisionNumber :: !(Maybe Int64)
2727+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2728+
2729+-- | Creates a value of 'DeleteOrderDealsRequest' with the minimum fields required to make a request.
2730+--
2731+-- Use one of the following lenses to modify other fields as desired:
2732+--
2733+-- * 'dodrUpdateAction'
2734+--
2735+-- * 'dodrDealIds'
2736+--
2737+-- * 'dodrOrderRevisionNumber'
2738+deleteOrderDealsRequest
2739+ :: DeleteOrderDealsRequest
2740+deleteOrderDealsRequest =
2741+ DeleteOrderDealsRequest
2742+ { _dodrUpdateAction = Nothing
2743+ , _dodrDealIds = Nothing
2744+ , _dodrOrderRevisionNumber = Nothing
2745+ }
2746+
2747+dodrUpdateAction :: Lens' DeleteOrderDealsRequest (Maybe Text)
2748+dodrUpdateAction
2749+ = lens _dodrUpdateAction
2750+ (\ s a -> s{_dodrUpdateAction = a})
2751+
2752+-- | List of deals to delete for a given order
2753+dodrDealIds :: Lens' DeleteOrderDealsRequest [Text]
2754+dodrDealIds
2755+ = lens _dodrDealIds (\ s a -> s{_dodrDealIds = a}) .
2756+ _Default
2757+ . _Coerce
2758+
2759+-- | The last known order revision number.
2760+dodrOrderRevisionNumber :: Lens' DeleteOrderDealsRequest (Maybe Int64)
2761+dodrOrderRevisionNumber
2762+ = lens _dodrOrderRevisionNumber
2763+ (\ s a -> s{_dodrOrderRevisionNumber = a})
2764+
2765+instance FromJSON DeleteOrderDealsRequest where
2766+ parseJSON
2767+ = withObject "DeleteOrderDealsRequest"
2768+ (\ o ->
2769+ DeleteOrderDealsRequest <$>
2770+ (o .:? "updateAction") <*>
2771+ (o .:? "dealIds" .!= mempty)
2772+ <*> (o .:? "orderRevisionNumber"))
2773+
2774+instance ToJSON DeleteOrderDealsRequest where
2775+ toJSON DeleteOrderDealsRequest{..}
2776+ = object
2777+ (catMaybes
2778+ [("updateAction" .=) <$> _dodrUpdateAction,
2779+ ("dealIds" .=) <$> _dodrDealIds,
2780+ ("orderRevisionNumber" .=) <$>
2781+ _dodrOrderRevisionNumber])
2782+
2783+--
2784+-- /See:/ 'getOrderDealsResponse' smart constructor.
2785+newtype GetOrderDealsResponse = GetOrderDealsResponse
2786+ { _godrDeals :: Maybe [Maybe MarketplaceDeal]
2787+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2788+
2789+-- | Creates a value of 'GetOrderDealsResponse' with the minimum fields required to make a request.
2790+--
2791+-- Use one of the following lenses to modify other fields as desired:
2792+--
2793+-- * 'godrDeals'
2794+getOrderDealsResponse
2795+ :: GetOrderDealsResponse
2796+getOrderDealsResponse =
2797+ GetOrderDealsResponse
2798+ { _godrDeals = Nothing
2799+ }
2800+
2801+-- | List of deals for the order
2802+godrDeals :: Lens' GetOrderDealsResponse [Maybe MarketplaceDeal]
2803+godrDeals
2804+ = lens _godrDeals (\ s a -> s{_godrDeals = a}) .
2805+ _Default
2806+ . _Coerce
2807+
2808+instance FromJSON GetOrderDealsResponse where
2809+ parseJSON
2810+ = withObject "GetOrderDealsResponse"
2811+ (\ o ->
2812+ GetOrderDealsResponse <$> (o .:? "deals" .!= mempty))
2813+
2814+instance ToJSON GetOrderDealsResponse where
2815+ toJSON GetOrderDealsResponse{..}
2816+ = object (catMaybes [("deals" .=) <$> _godrDeals])
2817+
2818+--
2819+-- /See:/ 'contactInformation' smart constructor.
2820+data ContactInformation = ContactInformation
2821+ { _ciEmail :: !(Maybe Text)
2822+ , _ciName :: !(Maybe Text)
2823+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2824+
2825+-- | Creates a value of 'ContactInformation' with the minimum fields required to make a request.
2826+--
2827+-- Use one of the following lenses to modify other fields as desired:
2828+--
2829+-- * 'ciEmail'
2830+--
2831+-- * 'ciName'
2832+contactInformation
2833+ :: ContactInformation
2834+contactInformation =
2835+ ContactInformation
2836+ { _ciEmail = Nothing
2837+ , _ciName = Nothing
2838+ }
2839+
2840+-- | Email address of the contact.
2841+ciEmail :: Lens' ContactInformation (Maybe Text)
2842+ciEmail = lens _ciEmail (\ s a -> s{_ciEmail = a})
2843+
2844+-- | The name of the contact.
2845+ciName :: Lens' ContactInformation (Maybe Text)
2846+ciName = lens _ciName (\ s a -> s{_ciName = a})
2847+
2848+instance FromJSON ContactInformation where
2849+ parseJSON
2850+ = withObject "ContactInformation"
2851+ (\ o ->
2852+ ContactInformation <$>
2853+ (o .:? "email") <*> (o .:? "name"))
2854+
2855+instance ToJSON ContactInformation where
2856+ toJSON ContactInformation{..}
2857+ = object
2858+ (catMaybes
2859+ [("email" .=) <$> _ciEmail, ("name" .=) <$> _ciName])
2860+
2861+--
2862+-- /See:/ 'targetingValueCreativeSize' smart constructor.
2863+data TargetingValueCreativeSize = TargetingValueCreativeSize
2864+ { _tvcsSize :: !(Maybe (Maybe TargetingValueSize))
2865+ , _tvcsCompanionSizes :: !(Maybe [Maybe TargetingValueSize])
2866+ , _tvcsCreativeSizeType :: !(Maybe Text)
2867+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2868+
2869+-- | Creates a value of 'TargetingValueCreativeSize' with the minimum fields required to make a request.
2870+--
2871+-- Use one of the following lenses to modify other fields as desired:
2872+--
2873+-- * 'tvcsSize'
2874+--
2875+-- * 'tvcsCompanionSizes'
2876+--
2877+-- * 'tvcsCreativeSizeType'
2878+targetingValueCreativeSize
2879+ :: TargetingValueCreativeSize
2880+targetingValueCreativeSize =
2881+ TargetingValueCreativeSize
2882+ { _tvcsSize = Nothing
2883+ , _tvcsCompanionSizes = Nothing
2884+ , _tvcsCreativeSizeType = Nothing
2885+ }
2886+
2887+-- | For regular creative size type, specifies the size of the creative.
2888+tvcsSize :: Lens' TargetingValueCreativeSize (Maybe (Maybe TargetingValueSize))
2889+tvcsSize = lens _tvcsSize (\ s a -> s{_tvcsSize = a})
2890+
2891+-- | For video size type, the list of companion sizes.
2892+tvcsCompanionSizes :: Lens' TargetingValueCreativeSize [Maybe TargetingValueSize]
2893+tvcsCompanionSizes
2894+ = lens _tvcsCompanionSizes
2895+ (\ s a -> s{_tvcsCompanionSizes = a})
2896+ . _Default
2897+ . _Coerce
2898+
2899+-- | The Creative size type.
2900+tvcsCreativeSizeType :: Lens' TargetingValueCreativeSize (Maybe Text)
2901+tvcsCreativeSizeType
2902+ = lens _tvcsCreativeSizeType
2903+ (\ s a -> s{_tvcsCreativeSizeType = a})
2904+
2905+instance FromJSON TargetingValueCreativeSize where
2906+ parseJSON
2907+ = withObject "TargetingValueCreativeSize"
2908+ (\ o ->
2909+ TargetingValueCreativeSize <$>
2910+ (o .:? "size") <*>
2911+ (o .:? "companionSizes" .!= mempty)
2912+ <*> (o .:? "creativeSizeType"))
2913+
2914+instance ToJSON TargetingValueCreativeSize where
2915+ toJSON TargetingValueCreativeSize{..}
2916+ = object
2917+ (catMaybes
2918+ [("size" .=) <$> _tvcsSize,
2919+ ("companionSizes" .=) <$> _tvcsCompanionSizes,
2920+ ("creativeSizeType" .=) <$> _tvcsCreativeSizeType])
2921+
2922+--
2923+-- /See:/ 'pretargetingConfig' smart constructor.
2924+data PretargetingConfig = PretargetingConfig
2925+ { _pcPlatforms :: !(Maybe [Text])
2926+ , _pcMobileCarriers :: !(Maybe [Int64])
2927+ , _pcVendorTypes :: !(Maybe [Int64])
2928+ , _pcExcludedGeoCriteriaIds :: !(Maybe [Int64])
2929+ , _pcSupportedCreativeAttributes :: !(Maybe [Int64])
2930+ , _pcUserLists :: !(Maybe [Int64])
2931+ , _pcKind :: !Text
2932+ , _pcExcludedPlacements :: !(Maybe [PretargetingConfigExcludedPlacementsItem])
2933+ , _pcMobileDevices :: !(Maybe [Int64])
2934+ , _pcLanguages :: !(Maybe [Text])
2935+ , _pcVerticals :: !(Maybe [Int64])
2936+ , _pcConfigId :: !(Maybe Int64)
2937+ , _pcPlacements :: !(Maybe [PretargetingConfigPlacementsItem])
2938+ , _pcExcludedUserLists :: !(Maybe [Int64])
2939+ , _pcConfigName :: !(Maybe Text)
2940+ , _pcGeoCriteriaIds :: !(Maybe [Int64])
2941+ , _pcDimensions :: !(Maybe [PretargetingConfigDimensionsItem])
2942+ , _pcExcludedVerticals :: !(Maybe [Int64])
2943+ , _pcCreativeType :: !(Maybe [Text])
2944+ , _pcIsActive :: !(Maybe Bool)
2945+ , _pcExcludedContentLabels :: !(Maybe [Int64])
2946+ , _pcBillingId :: !(Maybe Int64)
2947+ , _pcMobileOperatingSystemVersions :: !(Maybe [Int64])
2948+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
2949+
2950+-- | Creates a value of 'PretargetingConfig' with the minimum fields required to make a request.
2951+--
2952+-- Use one of the following lenses to modify other fields as desired:
2953+--
2954+-- * 'pcPlatforms'
2955+--
2956+-- * 'pcMobileCarriers'
2957+--
2958+-- * 'pcVendorTypes'
2959+--
2960+-- * 'pcExcludedGeoCriteriaIds'
2961+--
2962+-- * 'pcSupportedCreativeAttributes'
2963+--
2964+-- * 'pcUserLists'
2965+--
2966+-- * 'pcKind'
2967+--
2968+-- * 'pcExcludedPlacements'
2969+--
2970+-- * 'pcMobileDevices'
2971+--
2972+-- * 'pcLanguages'
2973+--
2974+-- * 'pcVerticals'
2975+--
2976+-- * 'pcConfigId'
2977+--
2978+-- * 'pcPlacements'
2979+--
2980+-- * 'pcExcludedUserLists'
2981+--
2982+-- * 'pcConfigName'
2983+--
2984+-- * 'pcGeoCriteriaIds'
2985+--
2986+-- * 'pcDimensions'
2987+--
2988+-- * 'pcExcludedVerticals'
2989+--
2990+-- * 'pcCreativeType'
2991+--
2992+-- * 'pcIsActive'
2993+--
2994+-- * 'pcExcludedContentLabels'
2995+--
2996+-- * 'pcBillingId'
2997+--
2998+-- * 'pcMobileOperatingSystemVersions'
2999+pretargetingConfig
3000+ :: PretargetingConfig
3001+pretargetingConfig =
3002+ PretargetingConfig
3003+ { _pcPlatforms = Nothing
3004+ , _pcMobileCarriers = Nothing
3005+ , _pcVendorTypes = Nothing
3006+ , _pcExcludedGeoCriteriaIds = Nothing
3007+ , _pcSupportedCreativeAttributes = Nothing
3008+ , _pcUserLists = Nothing
3009+ , _pcKind = "adexchangebuyer#pretargetingConfig"
3010+ , _pcExcludedPlacements = Nothing
3011+ , _pcMobileDevices = Nothing
3012+ , _pcLanguages = Nothing
3013+ , _pcVerticals = Nothing
3014+ , _pcConfigId = Nothing
3015+ , _pcPlacements = Nothing
3016+ , _pcExcludedUserLists = Nothing
3017+ , _pcConfigName = Nothing
3018+ , _pcGeoCriteriaIds = Nothing
3019+ , _pcDimensions = Nothing
3020+ , _pcExcludedVerticals = Nothing
3021+ , _pcCreativeType = Nothing
3022+ , _pcIsActive = Nothing
3023+ , _pcExcludedContentLabels = Nothing
3024+ , _pcBillingId = Nothing
3025+ , _pcMobileOperatingSystemVersions = Nothing
3026+ }
3027+
3028+-- | Requests matching any of these platforms will match. Possible values are
3029+-- PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and
3030+-- PRETARGETING_PLATFORM_TABLET.
3031+pcPlatforms :: Lens' PretargetingConfig [Text]
3032+pcPlatforms
3033+ = lens _pcPlatforms (\ s a -> s{_pcPlatforms = a}) .
3034+ _Default
3035+ . _Coerce
3036+
3037+-- | Requests containing any of these mobile carrier ids will match. Values
3038+-- are from mobile-carriers.csv in the downloadable files section.
3039+pcMobileCarriers :: Lens' PretargetingConfig [Int64]
3040+pcMobileCarriers
3041+ = lens _pcMobileCarriers
3042+ (\ s a -> s{_pcMobileCarriers = a})
3043+ . _Default
3044+ . _Coerce
3045+
3046+-- | Requests that allow any of these vendor ids will match. Values are from
3047+-- vendors.txt in the downloadable files section.
3048+pcVendorTypes :: Lens' PretargetingConfig [Int64]
3049+pcVendorTypes
3050+ = lens _pcVendorTypes
3051+ (\ s a -> s{_pcVendorTypes = a})
3052+ . _Default
3053+ . _Coerce
3054+
3055+-- | Requests containing any of these geo criteria ids will not match.
3056+pcExcludedGeoCriteriaIds :: Lens' PretargetingConfig [Int64]
3057+pcExcludedGeoCriteriaIds
3058+ = lens _pcExcludedGeoCriteriaIds
3059+ (\ s a -> s{_pcExcludedGeoCriteriaIds = a})
3060+ . _Default
3061+ . _Coerce
3062+
3063+-- | Creative attributes should be declared here if all creatives
3064+-- corresponding to this pretargeting configuration have that creative
3065+-- attribute. Values are from pretargetable-creative-attributes.txt in the
3066+-- downloadable files section.
3067+pcSupportedCreativeAttributes :: Lens' PretargetingConfig [Int64]
3068+pcSupportedCreativeAttributes
3069+ = lens _pcSupportedCreativeAttributes
3070+ (\ s a -> s{_pcSupportedCreativeAttributes = a})
3071+ . _Default
3072+ . _Coerce
3073+
3074+-- | Requests containing any of these user list ids will match.
3075+pcUserLists :: Lens' PretargetingConfig [Int64]
3076+pcUserLists
3077+ = lens _pcUserLists (\ s a -> s{_pcUserLists = a}) .
3078+ _Default
3079+ . _Coerce
3080+
3081+-- | The kind of the resource, i.e. \"adexchangebuyer#pretargetingConfig\".
3082+pcKind :: Lens' PretargetingConfig Text
3083+pcKind = lens _pcKind (\ s a -> s{_pcKind = a})
3084+
3085+-- | Requests containing any of these placements will not match.
3086+pcExcludedPlacements :: Lens' PretargetingConfig [PretargetingConfigExcludedPlacementsItem]
3087+pcExcludedPlacements
3088+ = lens _pcExcludedPlacements
3089+ (\ s a -> s{_pcExcludedPlacements = a})
3090+ . _Default
3091+ . _Coerce
3092+
3093+-- | Requests containing any of these mobile device ids will match. Values
3094+-- are from mobile-devices.csv in the downloadable files section.
3095+pcMobileDevices :: Lens' PretargetingConfig [Int64]
3096+pcMobileDevices
3097+ = lens _pcMobileDevices
3098+ (\ s a -> s{_pcMobileDevices = a})
3099+ . _Default
3100+ . _Coerce
3101+
3102+-- | Request containing any of these language codes will match.
3103+pcLanguages :: Lens' PretargetingConfig [Text]
3104+pcLanguages
3105+ = lens _pcLanguages (\ s a -> s{_pcLanguages = a}) .
3106+ _Default
3107+ . _Coerce
3108+
3109+-- | Requests containing any of these vertical ids will match.
3110+pcVerticals :: Lens' PretargetingConfig [Int64]
3111+pcVerticals
3112+ = lens _pcVerticals (\ s a -> s{_pcVerticals = a}) .
3113+ _Default
3114+ . _Coerce
3115+
3116+-- | The config id; generated automatically. Leave this field blank for
3117+-- insert requests.
3118+pcConfigId :: Lens' PretargetingConfig (Maybe Int64)
3119+pcConfigId
3120+ = lens _pcConfigId (\ s a -> s{_pcConfigId = a})
3121+
3122+-- | Requests containing any of these placements will match.
3123+pcPlacements :: Lens' PretargetingConfig [PretargetingConfigPlacementsItem]
3124+pcPlacements
3125+ = lens _pcPlacements (\ s a -> s{_pcPlacements = a})
3126+ . _Default
3127+ . _Coerce
3128+
3129+-- | Requests containing any of these users list ids will not match.
3130+pcExcludedUserLists :: Lens' PretargetingConfig [Int64]
3131+pcExcludedUserLists
3132+ = lens _pcExcludedUserLists
3133+ (\ s a -> s{_pcExcludedUserLists = a})
3134+ . _Default
3135+ . _Coerce
3136+
3137+-- | The name of the config. Must be unique. Required for all requests.
3138+pcConfigName :: Lens' PretargetingConfig (Maybe Text)
3139+pcConfigName
3140+ = lens _pcConfigName (\ s a -> s{_pcConfigName = a})
3141+
3142+-- | Requests containing any of these geo criteria ids will match.
3143+pcGeoCriteriaIds :: Lens' PretargetingConfig [Int64]
3144+pcGeoCriteriaIds
3145+ = lens _pcGeoCriteriaIds
3146+ (\ s a -> s{_pcGeoCriteriaIds = a})
3147+ . _Default
3148+ . _Coerce
3149+
3150+-- | Requests which allow one of these (width, height) pairs will match. All
3151+-- pairs must be supported ad dimensions.
3152+pcDimensions :: Lens' PretargetingConfig [PretargetingConfigDimensionsItem]
3153+pcDimensions
3154+ = lens _pcDimensions (\ s a -> s{_pcDimensions = a})
3155+ . _Default
3156+ . _Coerce
3157+
3158+-- | Requests containing any of these vertical ids will not match. Values are
3159+-- from the publisher-verticals.txt file in the downloadable files section.
3160+pcExcludedVerticals :: Lens' PretargetingConfig [Int64]
3161+pcExcludedVerticals
3162+ = lens _pcExcludedVerticals
3163+ (\ s a -> s{_pcExcludedVerticals = a})
3164+ . _Default
3165+ . _Coerce
3166+
3167+-- | List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or
3168+-- PRETARGETING_CREATIVE_TYPE_VIDEO.
3169+pcCreativeType :: Lens' PretargetingConfig [Text]
3170+pcCreativeType
3171+ = lens _pcCreativeType
3172+ (\ s a -> s{_pcCreativeType = a})
3173+ . _Default
3174+ . _Coerce
3175+
3176+-- | Whether this config is active. Required for all requests.
3177+pcIsActive :: Lens' PretargetingConfig (Maybe Bool)
3178+pcIsActive
3179+ = lens _pcIsActive (\ s a -> s{_pcIsActive = a})
3180+
3181+-- | Requests with any of these content labels will not match. Values are
3182+-- from content-labels.txt in the downloadable files section.
3183+pcExcludedContentLabels :: Lens' PretargetingConfig [Int64]
3184+pcExcludedContentLabels
3185+ = lens _pcExcludedContentLabels
3186+ (\ s a -> s{_pcExcludedContentLabels = a})
3187+ . _Default
3188+ . _Coerce
3189+
3190+-- | The id for billing purposes, provided for reference. Leave this field
3191+-- blank for insert requests; the id will be generated automatically.
3192+pcBillingId :: Lens' PretargetingConfig (Maybe Int64)
3193+pcBillingId
3194+ = lens _pcBillingId (\ s a -> s{_pcBillingId = a})
3195+
3196+-- | Requests containing any of these mobile operating system version ids
3197+-- will match. Values are from mobile-os.csv in the downloadable files
3198+-- section.
3199+pcMobileOperatingSystemVersions :: Lens' PretargetingConfig [Int64]
3200+pcMobileOperatingSystemVersions
3201+ = lens _pcMobileOperatingSystemVersions
3202+ (\ s a -> s{_pcMobileOperatingSystemVersions = a})
3203+ . _Default
3204+ . _Coerce
3205+
3206+instance FromJSON PretargetingConfig where
3207+ parseJSON
3208+ = withObject "PretargetingConfig"
3209+ (\ o ->
3210+ PretargetingConfig <$>
3211+ (o .:? "platforms" .!= mempty) <*>
3212+ (o .:? "mobileCarriers" .!= mempty)
3213+ <*> (o .:? "vendorTypes" .!= mempty)
3214+ <*> (o .:? "excludedGeoCriteriaIds" .!= mempty)
3215+ <*> (o .:? "supportedCreativeAttributes" .!= mempty)
3216+ <*> (o .:? "userLists" .!= mempty)
3217+ <*>
3218+ (o .:? "kind" .!=
3219+ "adexchangebuyer#pretargetingConfig")
3220+ <*> (o .:? "excludedPlacements" .!= mempty)
3221+ <*> (o .:? "mobileDevices" .!= mempty)
3222+ <*> (o .:? "languages" .!= mempty)
3223+ <*> (o .:? "verticals" .!= mempty)
3224+ <*> (o .:? "configId")
3225+ <*> (o .:? "placements" .!= mempty)
3226+ <*> (o .:? "excludedUserLists" .!= mempty)
3227+ <*> (o .:? "configName")
3228+ <*> (o .:? "geoCriteriaIds" .!= mempty)
3229+ <*> (o .:? "dimensions" .!= mempty)
3230+ <*> (o .:? "excludedVerticals" .!= mempty)
3231+ <*> (o .:? "creativeType" .!= mempty)
3232+ <*> (o .:? "isActive")
3233+ <*> (o .:? "excludedContentLabels" .!= mempty)
3234+ <*> (o .:? "billingId")
3235+ <*>
3236+ (o .:? "mobileOperatingSystemVersions" .!= mempty))
3237+
3238+instance ToJSON PretargetingConfig where
3239+ toJSON PretargetingConfig{..}
3240+ = object
3241+ (catMaybes
3242+ [("platforms" .=) <$> _pcPlatforms,
3243+ ("mobileCarriers" .=) <$> _pcMobileCarriers,
3244+ ("vendorTypes" .=) <$> _pcVendorTypes,
3245+ ("excludedGeoCriteriaIds" .=) <$>
3246+ _pcExcludedGeoCriteriaIds,
3247+ ("supportedCreativeAttributes" .=) <$>
3248+ _pcSupportedCreativeAttributes,
3249+ ("userLists" .=) <$> _pcUserLists,
3250+ Just ("kind" .= _pcKind),
3251+ ("excludedPlacements" .=) <$> _pcExcludedPlacements,
3252+ ("mobileDevices" .=) <$> _pcMobileDevices,
3253+ ("languages" .=) <$> _pcLanguages,
3254+ ("verticals" .=) <$> _pcVerticals,
3255+ ("configId" .=) <$> _pcConfigId,
3256+ ("placements" .=) <$> _pcPlacements,
3257+ ("excludedUserLists" .=) <$> _pcExcludedUserLists,
3258+ ("configName" .=) <$> _pcConfigName,
3259+ ("geoCriteriaIds" .=) <$> _pcGeoCriteriaIds,
3260+ ("dimensions" .=) <$> _pcDimensions,
3261+ ("excludedVerticals" .=) <$> _pcExcludedVerticals,
3262+ ("creativeType" .=) <$> _pcCreativeType,
3263+ ("isActive" .=) <$> _pcIsActive,
3264+ ("excludedContentLabels" .=) <$>
3265+ _pcExcludedContentLabels,
3266+ ("billingId" .=) <$> _pcBillingId,
3267+ ("mobileOperatingSystemVersions" .=) <$>
3268+ _pcMobileOperatingSystemVersions])
3269+
3270+-- | The configuration data for an Ad Exchange performance report list.
3271+-- https:\/\/sites.google.com\/a\/google.com\/adx-integration\/Home\/engineering\/binary-releases\/rtb-api-release
3272+-- https:\/\/cs.corp.google.com\/#piper\/\/\/depot\/google3\/contentads\/adx\/tools\/rtb_api\/adxrtb.py
3273+--
3274+-- /See:/ 'performanceReportList' smart constructor.
3275+data PerformanceReportList = PerformanceReportList
3276+ { _prlKind :: !Text
3277+ , _prlPerformanceReport :: !(Maybe [Maybe PerformanceReport])
3278+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
3279+
3280+-- | Creates a value of 'PerformanceReportList' with the minimum fields required to make a request.
3281+--
3282+-- Use one of the following lenses to modify other fields as desired:
3283+--
3284+-- * 'prlKind'
3285+--
3286+-- * 'prlPerformanceReport'
3287+performanceReportList
3288+ :: PerformanceReportList
3289+performanceReportList =
3290+ PerformanceReportList
3291+ { _prlKind = "adexchangebuyer#performanceReportList"
3292+ , _prlPerformanceReport = Nothing
3293+ }
3294+
3295+-- | Resource type.
3296+prlKind :: Lens' PerformanceReportList Text
3297+prlKind = lens _prlKind (\ s a -> s{_prlKind = a})
3298+
3299+-- | A list of performance reports relevant for the account.
3300+prlPerformanceReport :: Lens' PerformanceReportList [Maybe PerformanceReport]
3301+prlPerformanceReport
3302+ = lens _prlPerformanceReport
3303+ (\ s a -> s{_prlPerformanceReport = a})
3304+ . _Default
3305+ . _Coerce
3306+
3307+instance FromJSON PerformanceReportList where
3308+ parseJSON
3309+ = withObject "PerformanceReportList"
3310+ (\ o ->
3311+ PerformanceReportList <$>
3312+ (o .:? "kind" .!=
3313+ "adexchangebuyer#performanceReportList")
3314+ <*> (o .:? "performanceReport" .!= mempty))
3315+
3316+instance ToJSON PerformanceReportList where
3317+ toJSON PerformanceReportList{..}
3318+ = object
3319+ (catMaybes
3320+ [Just ("kind" .= _prlKind),
3321+ ("performanceReport" .=) <$> _prlPerformanceReport])
3322+
3323+--
3324+-- /See:/ 'negotiationDto' smart constructor.
3325+data NegotiationDto = NegotiationDto
3326+ { _ndNegotiationState :: !(Maybe Text)
3327+ , _ndExternalDealId :: !(Maybe Int64)
3328+ , _ndStatus :: !(Maybe Text)
3329+ , _ndDealType :: !(Maybe Text)
3330+ , _ndNegotiationRounds :: !(Maybe [Maybe NegotiationRoundDto])
3331+ , _ndKind :: !Text
3332+ , _ndBilledBuyer :: !(Maybe (Maybe DealPartyDto))
3333+ , _ndBuyerEmailContacts :: !(Maybe [Text])
3334+ , _ndStats :: !(Maybe (Maybe StatsDto))
3335+ , _ndSeller :: !(Maybe (Maybe DealPartyDto))
3336+ , _ndLabelNames :: !(Maybe [Text])
3337+ , _ndOfferId :: !(Maybe Int64)
3338+ , _ndNegotiationId :: !(Maybe Int64)
3339+ , _ndSellerEmailContacts :: !(Maybe [Text])
3340+ , _ndBuyer :: !(Maybe (Maybe DealPartyDto))
3341+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
3342+
3343+-- | Creates a value of 'NegotiationDto' with the minimum fields required to make a request.
3344+--
3345+-- Use one of the following lenses to modify other fields as desired:
3346+--
3347+-- * 'ndNegotiationState'
3348+--
3349+-- * 'ndExternalDealId'
3350+--
3351+-- * 'ndStatus'
3352+--
3353+-- * 'ndDealType'
3354+--
3355+-- * 'ndNegotiationRounds'
3356+--
3357+-- * 'ndKind'
3358+--
3359+-- * 'ndBilledBuyer'
3360+--
3361+-- * 'ndBuyerEmailContacts'
3362+--
3363+-- * 'ndStats'
3364+--
3365+-- * 'ndSeller'
3366+--
3367+-- * 'ndLabelNames'
3368+--
3369+-- * 'ndOfferId'
3370+--
3371+-- * 'ndNegotiationId'
3372+--
3373+-- * 'ndSellerEmailContacts'
3374+--
3375+-- * 'ndBuyer'
3376+negotiationDto
3377+ :: NegotiationDto
3378+negotiationDto =
3379+ NegotiationDto
3380+ { _ndNegotiationState = Nothing
3381+ , _ndExternalDealId = Nothing
3382+ , _ndStatus = Nothing
3383+ , _ndDealType = Nothing
3384+ , _ndNegotiationRounds = Nothing
3385+ , _ndKind = "adexchangebuyer#negotiation"
3386+ , _ndBilledBuyer = Nothing
3387+ , _ndBuyerEmailContacts = Nothing
3388+ , _ndStats = Nothing
3389+ , _ndSeller = Nothing
3390+ , _ndLabelNames = Nothing
3391+ , _ndOfferId = Nothing
3392+ , _ndNegotiationId = Nothing
3393+ , _ndSellerEmailContacts = Nothing
3394+ , _ndBuyer = Nothing
3395+ }
3396+
3397+-- | The state of this negotiation.
3398+ndNegotiationState :: Lens' NegotiationDto (Maybe Text)
3399+ndNegotiationState
3400+ = lens _ndNegotiationState
3401+ (\ s a -> s{_ndNegotiationState = a})
3402+
3403+-- | For finalized negotiations, the ID of the finalized deal.
3404+ndExternalDealId :: Lens' NegotiationDto (Maybe Int64)
3405+ndExternalDealId
3406+ = lens _ndExternalDealId
3407+ (\ s a -> s{_ndExternalDealId = a})
3408+
3409+-- | The status of this negotiation.
3410+ndStatus :: Lens' NegotiationDto (Maybe Text)
3411+ndStatus = lens _ndStatus (\ s a -> s{_ndStatus = a})
3412+
3413+-- | The type of this deal.
3414+ndDealType :: Lens' NegotiationDto (Maybe Text)
3415+ndDealType
3416+ = lens _ndDealType (\ s a -> s{_ndDealType = a})
3417+
3418+-- | The series of negotiation rounds for this negotiation.
3419+ndNegotiationRounds :: Lens' NegotiationDto [Maybe NegotiationRoundDto]
3420+ndNegotiationRounds
3421+ = lens _ndNegotiationRounds
3422+ (\ s a -> s{_ndNegotiationRounds = a})
3423+ . _Default
3424+ . _Coerce
3425+
3426+ndKind :: Lens' NegotiationDto Text
3427+ndKind = lens _ndKind (\ s a -> s{_ndKind = a})
3428+
3429+-- | The billed buyer; Specified by a buyer buying through an intermediary.
3430+ndBilledBuyer :: Lens' NegotiationDto (Maybe (Maybe DealPartyDto))
3431+ndBilledBuyer
3432+ = lens _ndBilledBuyer
3433+ (\ s a -> s{_ndBilledBuyer = a})
3434+
3435+-- | The buyer party\'s contact email.
3436+ndBuyerEmailContacts :: Lens' NegotiationDto [Text]
3437+ndBuyerEmailContacts
3438+ = lens _ndBuyerEmailContacts
3439+ (\ s a -> s{_ndBuyerEmailContacts = a})
3440+ . _Default
3441+ . _Coerce
3442+
3443+-- | The stats for this negotiation.
3444+ndStats :: Lens' NegotiationDto (Maybe (Maybe StatsDto))
3445+ndStats = lens _ndStats (\ s a -> s{_ndStats = a})
3446+
3447+-- | Details of the seller party in this negotiation.
3448+ndSeller :: Lens' NegotiationDto (Maybe (Maybe DealPartyDto))
3449+ndSeller = lens _ndSeller (\ s a -> s{_ndSeller = a})
3450+
3451+-- | A list of label names applicable to this negotiation.
3452+ndLabelNames :: Lens' NegotiationDto [Text]
3453+ndLabelNames
3454+ = lens _ndLabelNames (\ s a -> s{_ndLabelNames = a})
3455+ . _Default
3456+ . _Coerce
3457+
3458+-- | The ID of this negotiation\'s original offer.
3459+ndOfferId :: Lens' NegotiationDto (Maybe Int64)
3460+ndOfferId
3461+ = lens _ndOfferId (\ s a -> s{_ndOfferId = a})
3462+
3463+-- | The unique ID of this negotiation.
3464+ndNegotiationId :: Lens' NegotiationDto (Maybe Int64)
3465+ndNegotiationId
3466+ = lens _ndNegotiationId
3467+ (\ s a -> s{_ndNegotiationId = a})
3468+
3469+-- | The seller party\'s contact email.
3470+ndSellerEmailContacts :: Lens' NegotiationDto [Text]
3471+ndSellerEmailContacts
3472+ = lens _ndSellerEmailContacts
3473+ (\ s a -> s{_ndSellerEmailContacts = a})
3474+ . _Default
3475+ . _Coerce
3476+
3477+-- | Details of the buyer party in this negotiation.
3478+ndBuyer :: Lens' NegotiationDto (Maybe (Maybe DealPartyDto))
3479+ndBuyer = lens _ndBuyer (\ s a -> s{_ndBuyer = a})
3480+
3481+instance FromJSON NegotiationDto where
3482+ parseJSON
3483+ = withObject "NegotiationDto"
3484+ (\ o ->
3485+ NegotiationDto <$>
3486+ (o .:? "negotiationState") <*>
3487+ (o .:? "externalDealId")
3488+ <*> (o .:? "status")
3489+ <*> (o .:? "dealType")
3490+ <*> (o .:? "negotiationRounds" .!= mempty)
3491+ <*> (o .:? "kind" .!= "adexchangebuyer#negotiation")
3492+ <*> (o .:? "billedBuyer")
3493+ <*> (o .:? "buyerEmailContacts" .!= mempty)
3494+ <*> (o .:? "stats")
3495+ <*> (o .:? "seller")
3496+ <*> (o .:? "labelNames" .!= mempty)
3497+ <*> (o .:? "offerId")
3498+ <*> (o .:? "negotiationId")
3499+ <*> (o .:? "sellerEmailContacts" .!= mempty)
3500+ <*> (o .:? "buyer"))
3501+
3502+instance ToJSON NegotiationDto where
3503+ toJSON NegotiationDto{..}
3504+ = object
3505+ (catMaybes
3506+ [("negotiationState" .=) <$> _ndNegotiationState,
3507+ ("externalDealId" .=) <$> _ndExternalDealId,
3508+ ("status" .=) <$> _ndStatus,
3509+ ("dealType" .=) <$> _ndDealType,
3510+ ("negotiationRounds" .=) <$> _ndNegotiationRounds,
3511+ Just ("kind" .= _ndKind),
3512+ ("billedBuyer" .=) <$> _ndBilledBuyer,
3513+ ("buyerEmailContacts" .=) <$> _ndBuyerEmailContacts,
3514+ ("stats" .=) <$> _ndStats,
3515+ ("seller" .=) <$> _ndSeller,
3516+ ("labelNames" .=) <$> _ndLabelNames,
3517+ ("offerId" .=) <$> _ndOfferId,
3518+ ("negotiationId" .=) <$> _ndNegotiationId,
3519+ ("sellerEmailContacts" .=) <$>
3520+ _ndSellerEmailContacts,
3521+ ("buyer" .=) <$> _ndBuyer])
3522+
3523+--
3524+-- /See:/ 'audienceSegment' smart constructor.
3525+data AudienceSegment = AudienceSegment
3526+ { _asNumCookies :: !(Maybe Int64)
3527+ , _asName :: !(Maybe Text)
3528+ , _asId :: !(Maybe Int64)
3529+ , _asDescription :: !(Maybe Text)
3530+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
3531+
3532+-- | Creates a value of 'AudienceSegment' with the minimum fields required to make a request.
3533+--
3534+-- Use one of the following lenses to modify other fields as desired:
3535+--
3536+-- * 'asNumCookies'
3537+--
3538+-- * 'asName'
3539+--
3540+-- * 'asId'
3541+--
3542+-- * 'asDescription'
3543+audienceSegment
3544+ :: AudienceSegment
3545+audienceSegment =
3546+ AudienceSegment
3547+ { _asNumCookies = Nothing
3548+ , _asName = Nothing
3549+ , _asId = Nothing
3550+ , _asDescription = Nothing
3551+ }
3552+
3553+asNumCookies :: Lens' AudienceSegment (Maybe Int64)
3554+asNumCookies
3555+ = lens _asNumCookies (\ s a -> s{_asNumCookies = a})
3556+
3557+asName :: Lens' AudienceSegment (Maybe Text)
3558+asName = lens _asName (\ s a -> s{_asName = a})
3559+
3560+asId :: Lens' AudienceSegment (Maybe Int64)
3561+asId = lens _asId (\ s a -> s{_asId = a})
3562+
3563+asDescription :: Lens' AudienceSegment (Maybe Text)
3564+asDescription
3565+ = lens _asDescription
3566+ (\ s a -> s{_asDescription = a})
3567+
3568+instance FromJSON AudienceSegment where
3569+ parseJSON
3570+ = withObject "AudienceSegment"
3571+ (\ o ->
3572+ AudienceSegment <$>
3573+ (o .:? "numCookies") <*> (o .:? "name") <*>
3574+ (o .:? "id")
3575+ <*> (o .:? "description"))
3576+
3577+instance ToJSON AudienceSegment where
3578+ toJSON AudienceSegment{..}
3579+ = object
3580+ (catMaybes
3581+ [("numCookies" .=) <$> _asNumCookies,
3582+ ("name" .=) <$> _asName, ("id" .=) <$> _asId,
3583+ ("description" .=) <$> _asDescription])
3584+
3585+--
3586+-- /See:/ 'offerDto' smart constructor.
3587+data OfferDto = OfferDto
3588+ { _odCreator :: !(Maybe (Maybe DealPartyDto))
3589+ , _odStatus :: !(Maybe Text)
3590+ , _odOfferState :: !(Maybe Text)
3591+ , _odPointOfContact :: !(Maybe Text)
3592+ , _odTerms :: !(Maybe (Maybe TermsDto))
3593+ , _odKind :: !Text
3594+ , _odBilledBuyer :: !(Maybe (Maybe DealPartyDto))
3595+ , _odOpenToDealParties :: !(Maybe [Maybe DealPartyDto])
3596+ , _odEmailContacts :: !(Maybe [Text])
3597+ , _odLabelNames :: !(Maybe [Text])
3598+ , _odOfferId :: !(Maybe Int64)
3599+ , _odClosedToDealParties :: !(Maybe [Maybe DealPartyDto])
3600+ , _odAnonymous :: !(Maybe Bool)
3601+ , _odIsOpen :: !(Maybe Bool)
3602+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
3603+
3604+-- | Creates a value of 'OfferDto' with the minimum fields required to make a request.
3605+--
3606+-- Use one of the following lenses to modify other fields as desired:
3607+--
3608+-- * 'odCreator'
3609+--
3610+-- * 'odStatus'
3611+--
3612+-- * 'odOfferState'
3613+--
3614+-- * 'odPointOfContact'
3615+--
3616+-- * 'odTerms'
3617+--
3618+-- * 'odKind'
3619+--
3620+-- * 'odBilledBuyer'
3621+--
3622+-- * 'odOpenToDealParties'
3623+--
3624+-- * 'odEmailContacts'
3625+--
3626+-- * 'odLabelNames'
3627+--
3628+-- * 'odOfferId'
3629+--
3630+-- * 'odClosedToDealParties'
3631+--
3632+-- * 'odAnonymous'
3633+--
3634+-- * 'odIsOpen'
3635+offerDto
3636+ :: OfferDto
3637+offerDto =
3638+ OfferDto
3639+ { _odCreator = Nothing
3640+ , _odStatus = Nothing
3641+ , _odOfferState = Nothing
3642+ , _odPointOfContact = Nothing
3643+ , _odTerms = Nothing
3644+ , _odKind = "adexchangebuyer#offer"
3645+ , _odBilledBuyer = Nothing
3646+ , _odOpenToDealParties = Nothing
3647+ , _odEmailContacts = Nothing
3648+ , _odLabelNames = Nothing
3649+ , _odOfferId = Nothing
3650+ , _odClosedToDealParties = Nothing
3651+ , _odAnonymous = Nothing
3652+ , _odIsOpen = Nothing
3653+ }
3654+
3655+-- | The creator of this offer.
3656+odCreator :: Lens' OfferDto (Maybe (Maybe DealPartyDto))
3657+odCreator
3658+ = lens _odCreator (\ s a -> s{_odCreator = a})
3659+
3660+-- | The status of this offer.
3661+odStatus :: Lens' OfferDto (Maybe Text)
3662+odStatus = lens _odStatus (\ s a -> s{_odStatus = a})
3663+
3664+-- | The state of this offer.
3665+odOfferState :: Lens' OfferDto (Maybe Text)
3666+odOfferState
3667+ = lens _odOfferState (\ s a -> s{_odOfferState = a})
3668+
3669+-- | The point of contact for this offer.
3670+odPointOfContact :: Lens' OfferDto (Maybe Text)
3671+odPointOfContact
3672+ = lens _odPointOfContact
3673+ (\ s a -> s{_odPointOfContact = a})
3674+
3675+-- | The terms of this offer.
3676+odTerms :: Lens' OfferDto (Maybe (Maybe TermsDto))
3677+odTerms = lens _odTerms (\ s a -> s{_odTerms = a})
3678+
3679+odKind :: Lens' OfferDto Text
3680+odKind = lens _odKind (\ s a -> s{_odKind = a})
3681+
3682+-- | The billed buyer; For buyer initiated offers, buying through an
3683+-- intermediary.
3684+odBilledBuyer :: Lens' OfferDto (Maybe (Maybe DealPartyDto))
3685+odBilledBuyer
3686+ = lens _odBilledBuyer
3687+ (\ s a -> s{_odBilledBuyer = a})
3688+
3689+-- | The list of buyer or seller parties this offer is open to.
3690+odOpenToDealParties :: Lens' OfferDto [Maybe DealPartyDto]
3691+odOpenToDealParties
3692+ = lens _odOpenToDealParties
3693+ (\ s a -> s{_odOpenToDealParties = a})
3694+ . _Default
3695+ . _Coerce
3696+
3697+-- | The list of email contacts for this offer.
3698+odEmailContacts :: Lens' OfferDto [Text]
3699+odEmailContacts
3700+ = lens _odEmailContacts
3701+ (\ s a -> s{_odEmailContacts = a})
3702+ . _Default
3703+ . _Coerce
3704+
3705+-- | The list of label names applicable to this offer.
3706+odLabelNames :: Lens' OfferDto [Text]
3707+odLabelNames
3708+ = lens _odLabelNames (\ s a -> s{_odLabelNames = a})
3709+ . _Default
3710+ . _Coerce
3711+
3712+-- | The unique ID of this offer.
3713+odOfferId :: Lens' OfferDto (Maybe Int64)
3714+odOfferId
3715+ = lens _odOfferId (\ s a -> s{_odOfferId = a})
3716+
3717+-- | The list of buyer or seller parties this offer is closed to.
3718+odClosedToDealParties :: Lens' OfferDto [Maybe DealPartyDto]
3719+odClosedToDealParties
3720+ = lens _odClosedToDealParties
3721+ (\ s a -> s{_odClosedToDealParties = a})
3722+ . _Default
3723+ . _Coerce
3724+
3725+-- | Whether this offer is anonymous.
3726+odAnonymous :: Lens' OfferDto (Maybe Bool)
3727+odAnonymous
3728+ = lens _odAnonymous (\ s a -> s{_odAnonymous = a})
3729+
3730+-- | Whether this offer is open.
3731+odIsOpen :: Lens' OfferDto (Maybe Bool)
3732+odIsOpen = lens _odIsOpen (\ s a -> s{_odIsOpen = a})
3733+
3734+instance FromJSON OfferDto where
3735+ parseJSON
3736+ = withObject "OfferDto"
3737+ (\ o ->
3738+ OfferDto <$>
3739+ (o .:? "creator") <*> (o .:? "status") <*>
3740+ (o .:? "offerState")
3741+ <*> (o .:? "pointOfContact")
3742+ <*> (o .:? "terms")
3743+ <*> (o .:? "kind" .!= "adexchangebuyer#offer")
3744+ <*> (o .:? "billedBuyer")
3745+ <*> (o .:? "openToDealParties" .!= mempty)
3746+ <*> (o .:? "emailContacts" .!= mempty)
3747+ <*> (o .:? "labelNames" .!= mempty)
3748+ <*> (o .:? "offerId")
3749+ <*> (o .:? "closedToDealParties" .!= mempty)
3750+ <*> (o .:? "anonymous")
3751+ <*> (o .:? "isOpen"))
3752+
3753+instance ToJSON OfferDto where
3754+ toJSON OfferDto{..}
3755+ = object
3756+ (catMaybes
3757+ [("creator" .=) <$> _odCreator,
3758+ ("status" .=) <$> _odStatus,
3759+ ("offerState" .=) <$> _odOfferState,
3760+ ("pointOfContact" .=) <$> _odPointOfContact,
3761+ ("terms" .=) <$> _odTerms, Just ("kind" .= _odKind),
3762+ ("billedBuyer" .=) <$> _odBilledBuyer,
3763+ ("openToDealParties" .=) <$> _odOpenToDealParties,
3764+ ("emailContacts" .=) <$> _odEmailContacts,
3765+ ("labelNames" .=) <$> _odLabelNames,
3766+ ("offerId" .=) <$> _odOfferId,
3767+ ("closedToDealParties" .=) <$>
3768+ _odClosedToDealParties,
3769+ ("anonymous" .=) <$> _odAnonymous,
3770+ ("isOpen" .=) <$> _odIsOpen])
3771+
3772+--
3773+-- /See:/ 'targetingValueSize' smart constructor.
3774+data TargetingValueSize = TargetingValueSize
3775+ { _tvsHeight :: !(Maybe Int32)
3776+ , _tvsWidth :: !(Maybe Int32)
3777+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
3778+
3779+-- | Creates a value of 'TargetingValueSize' with the minimum fields required to make a request.
3780+--
3781+-- Use one of the following lenses to modify other fields as desired:
3782+--
3783+-- * 'tvsHeight'
3784+--
3785+-- * 'tvsWidth'
3786+targetingValueSize
3787+ :: TargetingValueSize
3788+targetingValueSize =
3789+ TargetingValueSize
3790+ { _tvsHeight = Nothing
3791+ , _tvsWidth = Nothing
3792+ }
3793+
3794+-- | The height of the creative.
3795+tvsHeight :: Lens' TargetingValueSize (Maybe Int32)
3796+tvsHeight
3797+ = lens _tvsHeight (\ s a -> s{_tvsHeight = a})
3798+
3799+-- | The width of the creative.
3800+tvsWidth :: Lens' TargetingValueSize (Maybe Int32)
3801+tvsWidth = lens _tvsWidth (\ s a -> s{_tvsWidth = a})
3802+
3803+instance FromJSON TargetingValueSize where
3804+ parseJSON
3805+ = withObject "TargetingValueSize"
3806+ (\ o ->
3807+ TargetingValueSize <$>
3808+ (o .:? "height") <*> (o .:? "width"))
3809+
3810+instance ToJSON TargetingValueSize where
3811+ toJSON TargetingValueSize{..}
3812+ = object
3813+ (catMaybes
3814+ [("height" .=) <$> _tvsHeight,
3815+ ("width" .=) <$> _tvsWidth])
3816+
3817+-- | An offer is segment of inventory that a seller wishes to sell. It is
3818+-- associated with certain terms and targeting information which helps
3819+-- buyer know more about the inventory. Each field in an order can have one
3820+-- of the following setting: (readonly) - It is an error to try and set
3821+-- this field. (buyer-readonly) - Only the seller can set this field.
3822+-- (seller-readonly) - Only the buyer can set this field. (updatable) - The
3823+-- field is updatable at all times by either buyer or the seller.
3824+--
3825+-- /See:/ 'marketplaceOffer' smart constructor.
3826+data MarketplaceOffer = MarketplaceOffer
3827+ { _moState :: !(Maybe Text)
3828+ , _moWebPropertyCode :: !(Maybe Text)
3829+ , _moCreationTimeMs :: !(Maybe Int64)
3830+ , _moTerms :: !(Maybe (Maybe DealTerms))
3831+ , _moLastUpdateTimeMs :: !(Maybe Int64)
3832+ , _moKind :: !Text
3833+ , _moRevisionNumber :: !(Maybe Int64)
3834+ , _moHasCreatorSignedOff :: !(Maybe Bool)
3835+ , _moFlightStartTimeMs :: !(Maybe Int64)
3836+ , _moSharedTargetings :: !(Maybe [Maybe SharedTargeting])
3837+ , _moSeller :: !(Maybe (Maybe Seller))
3838+ , _moSyndicationProduct :: !(Maybe Text)
3839+ , _moFlightEndTimeMs :: !(Maybe Int64)
3840+ , _moName :: !(Maybe Text)
3841+ , _moCreatorContacts :: !(Maybe [Maybe ContactInformation])
3842+ , _moOfferId :: !(Maybe Text)
3843+ , _moLabels :: !(Maybe [Maybe MarketplaceLabel])
3844+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
3845+
3846+-- | Creates a value of 'MarketplaceOffer' with the minimum fields required to make a request.
3847+--
3848+-- Use one of the following lenses to modify other fields as desired:
3849+--
3850+-- * 'moState'
3851+--
3852+-- * 'moWebPropertyCode'
3853+--
3854+-- * 'moCreationTimeMs'
3855+--
3856+-- * 'moTerms'
3857+--
3858+-- * 'moLastUpdateTimeMs'
3859+--
3860+-- * 'moKind'
3861+--
3862+-- * 'moRevisionNumber'
3863+--
3864+-- * 'moHasCreatorSignedOff'
3865+--
3866+-- * 'moFlightStartTimeMs'
3867+--
3868+-- * 'moSharedTargetings'
3869+--
3870+-- * 'moSeller'
3871+--
3872+-- * 'moSyndicationProduct'
3873+--
3874+-- * 'moFlightEndTimeMs'
3875+--
3876+-- * 'moName'
3877+--
3878+-- * 'moCreatorContacts'
3879+--
3880+-- * 'moOfferId'
3881+--
3882+-- * 'moLabels'
3883+marketplaceOffer
3884+ :: MarketplaceOffer
3885+marketplaceOffer =
3886+ MarketplaceOffer
3887+ { _moState = Nothing
3888+ , _moWebPropertyCode = Nothing
3889+ , _moCreationTimeMs = Nothing
3890+ , _moTerms = Nothing
3891+ , _moLastUpdateTimeMs = Nothing
3892+ , _moKind = "adexchangebuyer#marketplaceOffer"
3893+ , _moRevisionNumber = Nothing
3894+ , _moHasCreatorSignedOff = Nothing
3895+ , _moFlightStartTimeMs = Nothing
3896+ , _moSharedTargetings = Nothing
3897+ , _moSeller = Nothing
3898+ , _moSyndicationProduct = Nothing
3899+ , _moFlightEndTimeMs = Nothing
3900+ , _moName = Nothing
3901+ , _moCreatorContacts = Nothing
3902+ , _moOfferId = Nothing
3903+ , _moLabels = Nothing
3904+ }
3905+
3906+-- | The state of the offer. (buyer-readonly)
3907+moState :: Lens' MarketplaceOffer (Maybe Text)
3908+moState = lens _moState (\ s a -> s{_moState = a})
3909+
3910+moWebPropertyCode :: Lens' MarketplaceOffer (Maybe Text)
3911+moWebPropertyCode
3912+ = lens _moWebPropertyCode
3913+ (\ s a -> s{_moWebPropertyCode = a})
3914+
3915+-- | Creation time in ms. since epoch (readonly)
3916+moCreationTimeMs :: Lens' MarketplaceOffer (Maybe Int64)
3917+moCreationTimeMs
3918+ = lens _moCreationTimeMs
3919+ (\ s a -> s{_moCreationTimeMs = a})
3920+
3921+-- | The negotiable terms of the deal (buyer-readonly)
3922+moTerms :: Lens' MarketplaceOffer (Maybe (Maybe DealTerms))
3923+moTerms = lens _moTerms (\ s a -> s{_moTerms = a})
3924+
3925+-- | Time of last update in ms. since epoch (readonly)
3926+moLastUpdateTimeMs :: Lens' MarketplaceOffer (Maybe Int64)
3927+moLastUpdateTimeMs
3928+ = lens _moLastUpdateTimeMs
3929+ (\ s a -> s{_moLastUpdateTimeMs = a})
3930+
3931+-- | Identifies what kind of resource this is. Value: the fixed string
3932+-- \"adexchangebuyer#marketplaceOffer\".
3933+moKind :: Lens' MarketplaceOffer Text
3934+moKind = lens _moKind (\ s a -> s{_moKind = a})
3935+
3936+-- | The revision number of the offer. (readonly)
3937+moRevisionNumber :: Lens' MarketplaceOffer (Maybe Int64)
3938+moRevisionNumber
3939+ = lens _moRevisionNumber
3940+ (\ s a -> s{_moRevisionNumber = a})
3941+
3942+-- | If the creator has already signed off on the offer, then the buyer can
3943+-- finalize the deal by accepting the offer as is. When copying to an
3944+-- order, if any of the terms are changed, then auto_finalize is
3945+-- automatically set to false.
3946+moHasCreatorSignedOff :: Lens' MarketplaceOffer (Maybe Bool)
3947+moHasCreatorSignedOff
3948+ = lens _moHasCreatorSignedOff
3949+ (\ s a -> s{_moHasCreatorSignedOff = a})
3950+
3951+-- | Inventory availability dates. (times are in ms since epoch) The
3952+-- granularity is generally in the order of seconds. (buyer-readonly)
3953+moFlightStartTimeMs :: Lens' MarketplaceOffer (Maybe Int64)
3954+moFlightStartTimeMs
3955+ = lens _moFlightStartTimeMs
3956+ (\ s a -> s{_moFlightStartTimeMs = a})
3957+
3958+-- | Targeting that is shared between the buyer and the seller. Each
3959+-- targeting criteria has a specified key and for each key there is a list
3960+-- of inclusion value or exclusion values. (buyer-readonly)
3961+moSharedTargetings :: Lens' MarketplaceOffer [Maybe SharedTargeting]
3962+moSharedTargetings
3963+ = lens _moSharedTargetings
3964+ (\ s a -> s{_moSharedTargetings = a})
3965+ . _Default
3966+ . _Coerce
3967+
3968+-- | Information about the seller that created this offer (readonly, except
3969+-- on create)
3970+moSeller :: Lens' MarketplaceOffer (Maybe (Maybe Seller))
3971+moSeller = lens _moSeller (\ s a -> s{_moSeller = a})
3972+
3973+-- | The syndication product associated with the deal. (readonly, except on
3974+-- create)
3975+moSyndicationProduct :: Lens' MarketplaceOffer (Maybe Text)
3976+moSyndicationProduct
3977+ = lens _moSyndicationProduct
3978+ (\ s a -> s{_moSyndicationProduct = a})
3979+
3980+-- | The proposed end time for the deal (ms since epoch) (buyer-readonly)
3981+moFlightEndTimeMs :: Lens' MarketplaceOffer (Maybe Int64)
3982+moFlightEndTimeMs
3983+ = lens _moFlightEndTimeMs
3984+ (\ s a -> s{_moFlightEndTimeMs = a})
3985+
3986+-- | The name for this offer as set by the seller. (buyer-readonly)
3987+moName :: Lens' MarketplaceOffer (Maybe Text)
3988+moName = lens _moName (\ s a -> s{_moName = a})
3989+
3990+-- | Optional contact information for the creator of this offer.
3991+-- (buyer-readonly)
3992+moCreatorContacts :: Lens' MarketplaceOffer [Maybe ContactInformation]
3993+moCreatorContacts
3994+ = lens _moCreatorContacts
3995+ (\ s a -> s{_moCreatorContacts = a})
3996+ . _Default
3997+ . _Coerce
3998+
3999+-- | The unique id for the offer (readonly)
4000+moOfferId :: Lens' MarketplaceOffer (Maybe Text)
4001+moOfferId
4002+ = lens _moOfferId (\ s a -> s{_moOfferId = a})
4003+
4004+-- | Optional List of labels for the offer (optional, buyer-readonly).
4005+moLabels :: Lens' MarketplaceOffer [Maybe MarketplaceLabel]
4006+moLabels
4007+ = lens _moLabels (\ s a -> s{_moLabels = a}) .
4008+ _Default
4009+ . _Coerce
4010+
4011+instance FromJSON MarketplaceOffer where
4012+ parseJSON
4013+ = withObject "MarketplaceOffer"
4014+ (\ o ->
4015+ MarketplaceOffer <$>
4016+ (o .:? "state") <*> (o .:? "webPropertyCode") <*>
4017+ (o .:? "creationTimeMs")
4018+ <*> (o .:? "terms")
4019+ <*> (o .:? "lastUpdateTimeMs")
4020+ <*>
4021+ (o .:? "kind" .!= "adexchangebuyer#marketplaceOffer")
4022+ <*> (o .:? "revisionNumber")
4023+ <*> (o .:? "hasCreatorSignedOff")
4024+ <*> (o .:? "flightStartTimeMs")
4025+ <*> (o .:? "sharedTargetings" .!= mempty)
4026+ <*> (o .:? "seller")
4027+ <*> (o .:? "syndicationProduct")
4028+ <*> (o .:? "flightEndTimeMs")
4029+ <*> (o .:? "name")
4030+ <*> (o .:? "creatorContacts" .!= mempty)
4031+ <*> (o .:? "offerId")
4032+ <*> (o .:? "labels" .!= mempty))
4033+
4034+instance ToJSON MarketplaceOffer where
4035+ toJSON MarketplaceOffer{..}
4036+ = object
4037+ (catMaybes
4038+ [("state" .=) <$> _moState,
4039+ ("webPropertyCode" .=) <$> _moWebPropertyCode,
4040+ ("creationTimeMs" .=) <$> _moCreationTimeMs,
4041+ ("terms" .=) <$> _moTerms,
4042+ ("lastUpdateTimeMs" .=) <$> _moLastUpdateTimeMs,
4043+ Just ("kind" .= _moKind),
4044+ ("revisionNumber" .=) <$> _moRevisionNumber,
4045+ ("hasCreatorSignedOff" .=) <$>
4046+ _moHasCreatorSignedOff,
4047+ ("flightStartTimeMs" .=) <$> _moFlightStartTimeMs,
4048+ ("sharedTargetings" .=) <$> _moSharedTargetings,
4049+ ("seller" .=) <$> _moSeller,
4050+ ("syndicationProduct" .=) <$> _moSyndicationProduct,
4051+ ("flightEndTimeMs" .=) <$> _moFlightEndTimeMs,
4052+ ("name" .=) <$> _moName,
4053+ ("creatorContacts" .=) <$> _moCreatorContacts,
4054+ ("offerId" .=) <$> _moOfferId,
4055+ ("labels" .=) <$> _moLabels])
4056+
4057+--
4058+-- /See:/ 'getNegotiationsRequest' smart constructor.
4059+data GetNegotiationsRequest = GetNegotiationsRequest
4060+ { _gnrSinceTimestampMillis :: !(Maybe Int64)
4061+ , _gnrFinalized :: !(Maybe Bool)
4062+ , _gnrIncludePrivateAuctions :: !(Maybe Bool)
4063+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4064+
4065+-- | Creates a value of 'GetNegotiationsRequest' with the minimum fields required to make a request.
4066+--
4067+-- Use one of the following lenses to modify other fields as desired:
4068+--
4069+-- * 'gnrSinceTimestampMillis'
4070+--
4071+-- * 'gnrFinalized'
4072+--
4073+-- * 'gnrIncludePrivateAuctions'
4074+getNegotiationsRequest
4075+ :: GetNegotiationsRequest
4076+getNegotiationsRequest =
4077+ GetNegotiationsRequest
4078+ { _gnrSinceTimestampMillis = Nothing
4079+ , _gnrFinalized = Nothing
4080+ , _gnrIncludePrivateAuctions = Nothing
4081+ }
4082+
4083+gnrSinceTimestampMillis :: Lens' GetNegotiationsRequest (Maybe Int64)
4084+gnrSinceTimestampMillis
4085+ = lens _gnrSinceTimestampMillis
4086+ (\ s a -> s{_gnrSinceTimestampMillis = a})
4087+
4088+gnrFinalized :: Lens' GetNegotiationsRequest (Maybe Bool)
4089+gnrFinalized
4090+ = lens _gnrFinalized (\ s a -> s{_gnrFinalized = a})
4091+
4092+gnrIncludePrivateAuctions :: Lens' GetNegotiationsRequest (Maybe Bool)
4093+gnrIncludePrivateAuctions
4094+ = lens _gnrIncludePrivateAuctions
4095+ (\ s a -> s{_gnrIncludePrivateAuctions = a})
4096+
4097+instance FromJSON GetNegotiationsRequest where
4098+ parseJSON
4099+ = withObject "GetNegotiationsRequest"
4100+ (\ o ->
4101+ GetNegotiationsRequest <$>
4102+ (o .:? "sinceTimestampMillis") <*>
4103+ (o .:? "finalized")
4104+ <*> (o .:? "includePrivateAuctions"))
4105+
4106+instance ToJSON GetNegotiationsRequest where
4107+ toJSON GetNegotiationsRequest{..}
4108+ = object
4109+ (catMaybes
4110+ [("sinceTimestampMillis" .=) <$>
4111+ _gnrSinceTimestampMillis,
4112+ ("finalized" .=) <$> _gnrFinalized,
4113+ ("includePrivateAuctions" .=) <$>
4114+ _gnrIncludePrivateAuctions])
4115+
4116+-- | A billing info feed lists Billing Info the Ad Exchange buyer account has
4117+-- access to. Each entry in the feed corresponds to a single billing info.
4118+--
4119+-- /See:/ 'billingInfoList' smart constructor.
4120+data BillingInfoList = BillingInfoList
4121+ { _bilKind :: !Text
4122+ , _bilItems :: !(Maybe [Maybe BillingInfo])
4123+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4124+
4125+-- | Creates a value of 'BillingInfoList' with the minimum fields required to make a request.
4126+--
4127+-- Use one of the following lenses to modify other fields as desired:
4128+--
4129+-- * 'bilKind'
4130+--
4131+-- * 'bilItems'
4132+billingInfoList
4133+ :: BillingInfoList
4134+billingInfoList =
4135+ BillingInfoList
4136+ { _bilKind = "adexchangebuyer#billingInfoList"
4137+ , _bilItems = Nothing
4138+ }
4139+
4140+-- | Resource type.
4141+bilKind :: Lens' BillingInfoList Text
4142+bilKind = lens _bilKind (\ s a -> s{_bilKind = a})
4143+
4144+-- | A list of billing info relevant for your account.
4145+bilItems :: Lens' BillingInfoList [Maybe BillingInfo]
4146+bilItems
4147+ = lens _bilItems (\ s a -> s{_bilItems = a}) .
4148+ _Default
4149+ . _Coerce
4150+
4151+instance FromJSON BillingInfoList where
4152+ parseJSON
4153+ = withObject "BillingInfoList"
4154+ (\ o ->
4155+ BillingInfoList <$>
4156+ (o .:? "kind" .!= "adexchangebuyer#billingInfoList")
4157+ <*> (o .:? "items" .!= mempty))
4158+
4159+instance ToJSON BillingInfoList where
4160+ toJSON BillingInfoList{..}
4161+ = object
4162+ (catMaybes
4163+ [Just ("kind" .= _bilKind),
4164+ ("items" .=) <$> _bilItems])
4165+
4166+--
4167+-- /See:/ 'addOrderNotesResponse' smart constructor.
4168+newtype AddOrderNotesResponse = AddOrderNotesResponse
4169+ { _aNotes :: Maybe [Maybe MarketplaceNote]
4170+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4171+
4172+-- | Creates a value of 'AddOrderNotesResponse' with the minimum fields required to make a request.
4173+--
4174+-- Use one of the following lenses to modify other fields as desired:
4175+--
4176+-- * 'aNotes'
4177+addOrderNotesResponse
4178+ :: AddOrderNotesResponse
4179+addOrderNotesResponse =
4180+ AddOrderNotesResponse
4181+ { _aNotes = Nothing
4182+ }
4183+
4184+aNotes :: Lens' AddOrderNotesResponse [Maybe MarketplaceNote]
4185+aNotes
4186+ = lens _aNotes (\ s a -> s{_aNotes = a}) . _Default .
4187+ _Coerce
4188+
4189+instance FromJSON AddOrderNotesResponse where
4190+ parseJSON
4191+ = withObject "AddOrderNotesResponse"
4192+ (\ o ->
4193+ AddOrderNotesResponse <$> (o .:? "notes" .!= mempty))
4194+
4195+instance ToJSON AddOrderNotesResponse where
4196+ toJSON AddOrderNotesResponse{..}
4197+ = object (catMaybes [("notes" .=) <$> _aNotes])
4198+
4199+--
4200+-- /See:/ 'moneyDto' smart constructor.
4201+data MoneyDto = MoneyDto
4202+ { _mdCurrencyCode :: !(Maybe Text)
4203+ , _mdMicros :: !(Maybe Int64)
4204+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4205+
4206+-- | Creates a value of 'MoneyDto' with the minimum fields required to make a request.
4207+--
4208+-- Use one of the following lenses to modify other fields as desired:
4209+--
4210+-- * 'mdCurrencyCode'
4211+--
4212+-- * 'mdMicros'
4213+moneyDto
4214+ :: MoneyDto
4215+moneyDto =
4216+ MoneyDto
4217+ { _mdCurrencyCode = Nothing
4218+ , _mdMicros = Nothing
4219+ }
4220+
4221+mdCurrencyCode :: Lens' MoneyDto (Maybe Text)
4222+mdCurrencyCode
4223+ = lens _mdCurrencyCode
4224+ (\ s a -> s{_mdCurrencyCode = a})
4225+
4226+mdMicros :: Lens' MoneyDto (Maybe Int64)
4227+mdMicros = lens _mdMicros (\ s a -> s{_mdMicros = a})
4228+
4229+instance FromJSON MoneyDto where
4230+ parseJSON
4231+ = withObject "MoneyDto"
4232+ (\ o ->
4233+ MoneyDto <$>
4234+ (o .:? "currencyCode") <*> (o .:? "micros"))
4235+
4236+instance ToJSON MoneyDto where
4237+ toJSON MoneyDto{..}
4238+ = object
4239+ (catMaybes
4240+ [("currencyCode" .=) <$> _mdCurrencyCode,
4241+ ("micros" .=) <$> _mdMicros])
4242+
4243+--
4244+-- /See:/ 'listClientAccessCapabilitiesResponse' smart constructor.
4245+newtype ListClientAccessCapabilitiesResponse = ListClientAccessCapabilitiesResponse
4246+ { _lcacrClientAccessPermissions :: Maybe [Maybe ClientAccessCapabilities]
4247+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4248+
4249+-- | Creates a value of 'ListClientAccessCapabilitiesResponse' with the minimum fields required to make a request.
4250+--
4251+-- Use one of the following lenses to modify other fields as desired:
4252+--
4253+-- * 'lcacrClientAccessPermissions'
4254+listClientAccessCapabilitiesResponse
4255+ :: ListClientAccessCapabilitiesResponse
4256+listClientAccessCapabilitiesResponse =
4257+ ListClientAccessCapabilitiesResponse
4258+ { _lcacrClientAccessPermissions = Nothing
4259+ }
4260+
4261+lcacrClientAccessPermissions :: Lens' ListClientAccessCapabilitiesResponse [Maybe ClientAccessCapabilities]
4262+lcacrClientAccessPermissions
4263+ = lens _lcacrClientAccessPermissions
4264+ (\ s a -> s{_lcacrClientAccessPermissions = a})
4265+ . _Default
4266+ . _Coerce
4267+
4268+instance FromJSON
4269+ ListClientAccessCapabilitiesResponse where
4270+ parseJSON
4271+ = withObject "ListClientAccessCapabilitiesResponse"
4272+ (\ o ->
4273+ ListClientAccessCapabilitiesResponse <$>
4274+ (o .:? "clientAccessPermissions" .!= mempty))
4275+
4276+instance ToJSON ListClientAccessCapabilitiesResponse
4277+ where
4278+ toJSON ListClientAccessCapabilitiesResponse{..}
4279+ = object
4280+ (catMaybes
4281+ [("clientAccessPermissions" .=) <$>
4282+ _lcacrClientAccessPermissions])
4283+
4284+--
4285+-- /See:/ 'getNegotiationByIdRequest' smart constructor.
4286+newtype GetNegotiationByIdRequest = GetNegotiationByIdRequest
4287+ { _gnbirIncludePrivateAuctions :: Maybe Bool
4288+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4289+
4290+-- | Creates a value of 'GetNegotiationByIdRequest' with the minimum fields required to make a request.
4291+--
4292+-- Use one of the following lenses to modify other fields as desired:
4293+--
4294+-- * 'gnbirIncludePrivateAuctions'
4295+getNegotiationByIdRequest
4296+ :: GetNegotiationByIdRequest
4297+getNegotiationByIdRequest =
4298+ GetNegotiationByIdRequest
4299+ { _gnbirIncludePrivateAuctions = Nothing
4300+ }
4301+
4302+gnbirIncludePrivateAuctions :: Lens' GetNegotiationByIdRequest (Maybe Bool)
4303+gnbirIncludePrivateAuctions
4304+ = lens _gnbirIncludePrivateAuctions
4305+ (\ s a -> s{_gnbirIncludePrivateAuctions = a})
4306+
4307+instance FromJSON GetNegotiationByIdRequest where
4308+ parseJSON
4309+ = withObject "GetNegotiationByIdRequest"
4310+ (\ o ->
4311+ GetNegotiationByIdRequest <$>
4312+ (o .:? "includePrivateAuctions"))
4313+
4314+instance ToJSON GetNegotiationByIdRequest where
4315+ toJSON GetNegotiationByIdRequest{..}
4316+ = object
4317+ (catMaybes
4318+ [("includePrivateAuctions" .=) <$>
4319+ _gnbirIncludePrivateAuctions])
4320+
4321+--
4322+-- /See:/ 'listOffersResponse' smart constructor.
4323+data ListOffersResponse = ListOffersResponse
4324+ { _lorKind :: !Text
4325+ , _lorOffers :: !(Maybe [Maybe OfferDto])
4326+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4327+
4328+-- | Creates a value of 'ListOffersResponse' with the minimum fields required to make a request.
4329+--
4330+-- Use one of the following lenses to modify other fields as desired:
4331+--
4332+-- * 'lorKind'
4333+--
4334+-- * 'lorOffers'
4335+listOffersResponse
4336+ :: ListOffersResponse
4337+listOffersResponse =
4338+ ListOffersResponse
4339+ { _lorKind = "adexchangebuyer#offersList"
4340+ , _lorOffers = Nothing
4341+ }
4342+
4343+lorKind :: Lens' ListOffersResponse Text
4344+lorKind = lens _lorKind (\ s a -> s{_lorKind = a})
4345+
4346+lorOffers :: Lens' ListOffersResponse [Maybe OfferDto]
4347+lorOffers
4348+ = lens _lorOffers (\ s a -> s{_lorOffers = a}) .
4349+ _Default
4350+ . _Coerce
4351+
4352+instance FromJSON ListOffersResponse where
4353+ parseJSON
4354+ = withObject "ListOffersResponse"
4355+ (\ o ->
4356+ ListOffersResponse <$>
4357+ (o .:? "kind" .!= "adexchangebuyer#offersList") <*>
4358+ (o .:? "offers" .!= mempty))
4359+
4360+instance ToJSON ListOffersResponse where
4361+ toJSON ListOffersResponse{..}
4362+ = object
4363+ (catMaybes
4364+ [Just ("kind" .= _lorKind),
4365+ ("offers" .=) <$> _lorOffers])
4366+
4367+--
4368+-- /See:/ 'advertiserDto' smart constructor.
4369+data AdvertiserDto = AdvertiserDto
4370+ { _adStatus :: !(Maybe Text)
4371+ , _adBrands :: !(Maybe [Maybe BrandDto])
4372+ , _adName :: !(Maybe Text)
4373+ , _adId :: !(Maybe Int64)
4374+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4375+
4376+-- | Creates a value of 'AdvertiserDto' with the minimum fields required to make a request.
4377+--
4378+-- Use one of the following lenses to modify other fields as desired:
4379+--
4380+-- * 'adStatus'
4381+--
4382+-- * 'adBrands'
4383+--
4384+-- * 'adName'
4385+--
4386+-- * 'adId'
4387+advertiserDto
4388+ :: AdvertiserDto
4389+advertiserDto =
4390+ AdvertiserDto
4391+ { _adStatus = Nothing
4392+ , _adBrands = Nothing
4393+ , _adName = Nothing
4394+ , _adId = Nothing
4395+ }
4396+
4397+adStatus :: Lens' AdvertiserDto (Maybe Text)
4398+adStatus = lens _adStatus (\ s a -> s{_adStatus = a})
4399+
4400+adBrands :: Lens' AdvertiserDto [Maybe BrandDto]
4401+adBrands
4402+ = lens _adBrands (\ s a -> s{_adBrands = a}) .
4403+ _Default
4404+ . _Coerce
4405+
4406+adName :: Lens' AdvertiserDto (Maybe Text)
4407+adName = lens _adName (\ s a -> s{_adName = a})
4408+
4409+adId :: Lens' AdvertiserDto (Maybe Int64)
4410+adId = lens _adId (\ s a -> s{_adId = a})
4411+
4412+instance FromJSON AdvertiserDto where
4413+ parseJSON
4414+ = withObject "AdvertiserDto"
4415+ (\ o ->
4416+ AdvertiserDto <$>
4417+ (o .:? "status") <*> (o .:? "brands" .!= mempty) <*>
4418+ (o .:? "name")
4419+ <*> (o .:? "id"))
4420+
4421+instance ToJSON AdvertiserDto where
4422+ toJSON AdvertiserDto{..}
4423+ = object
4424+ (catMaybes
4425+ [("status" .=) <$> _adStatus,
4426+ ("brands" .=) <$> _adBrands, ("name" .=) <$> _adName,
4427+ ("id" .=) <$> _adId])
4428+
4429+--
4430+-- /See:/ 'targetingValue' smart constructor.
4431+data TargetingValue = TargetingValue
4432+ { _tvCreativeSizeValue :: !(Maybe (Maybe TargetingValueCreativeSize))
4433+ , _tvStringValue :: !(Maybe Text)
4434+ , _tvLongValue :: !(Maybe Int64)
4435+ , _tvDayPartTargetingValue :: !(Maybe (Maybe TargetingValueDayPartTargeting))
4436+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4437+
4438+-- | Creates a value of 'TargetingValue' with the minimum fields required to make a request.
4439+--
4440+-- Use one of the following lenses to modify other fields as desired:
4441+--
4442+-- * 'tvCreativeSizeValue'
4443+--
4444+-- * 'tvStringValue'
4445+--
4446+-- * 'tvLongValue'
4447+--
4448+-- * 'tvDayPartTargetingValue'
4449+targetingValue
4450+ :: TargetingValue
4451+targetingValue =
4452+ TargetingValue
4453+ { _tvCreativeSizeValue = Nothing
4454+ , _tvStringValue = Nothing
4455+ , _tvLongValue = Nothing
4456+ , _tvDayPartTargetingValue = Nothing
4457+ }
4458+
4459+-- | The creative size value to exclude\/include.
4460+tvCreativeSizeValue :: Lens' TargetingValue (Maybe (Maybe TargetingValueCreativeSize))
4461+tvCreativeSizeValue
4462+ = lens _tvCreativeSizeValue
4463+ (\ s a -> s{_tvCreativeSizeValue = a})
4464+
4465+-- | The string value to exclude\/include.
4466+tvStringValue :: Lens' TargetingValue (Maybe Text)
4467+tvStringValue
4468+ = lens _tvStringValue
4469+ (\ s a -> s{_tvStringValue = a})
4470+
4471+-- | The long value to exclude\/include.
4472+tvLongValue :: Lens' TargetingValue (Maybe Int64)
4473+tvLongValue
4474+ = lens _tvLongValue (\ s a -> s{_tvLongValue = a})
4475+
4476+-- | The daypart targeting to include \/ exclude. Filled in when the key is
4477+-- GOOG_DAYPART_TARGETING.
4478+tvDayPartTargetingValue :: Lens' TargetingValue (Maybe (Maybe TargetingValueDayPartTargeting))
4479+tvDayPartTargetingValue
4480+ = lens _tvDayPartTargetingValue
4481+ (\ s a -> s{_tvDayPartTargetingValue = a})
4482+
4483+instance FromJSON TargetingValue where
4484+ parseJSON
4485+ = withObject "TargetingValue"
4486+ (\ o ->
4487+ TargetingValue <$>
4488+ (o .:? "creativeSizeValue") <*> (o .:? "stringValue")
4489+ <*> (o .:? "longValue")
4490+ <*> (o .:? "dayPartTargetingValue"))
4491+
4492+instance ToJSON TargetingValue where
4493+ toJSON TargetingValue{..}
4494+ = object
4495+ (catMaybes
4496+ [("creativeSizeValue" .=) <$> _tvCreativeSizeValue,
4497+ ("stringValue" .=) <$> _tvStringValue,
4498+ ("longValue" .=) <$> _tvLongValue,
4499+ ("dayPartTargetingValue" .=) <$>
4500+ _tvDayPartTargetingValue])
4501+
4502+--
4503+-- /See:/ 'price' smart constructor.
4504+data Price = Price
4505+ { _pCurrencyCode :: !(Maybe Text)
4506+ , _pAmountMicros :: !(Maybe Double)
4507+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4508+
4509+-- | Creates a value of 'Price' with the minimum fields required to make a request.
4510+--
4511+-- Use one of the following lenses to modify other fields as desired:
4512+--
4513+-- * 'pCurrencyCode'
4514+--
4515+-- * 'pAmountMicros'
4516+price
4517+ :: Price
4518+price =
4519+ Price
4520+ { _pCurrencyCode = Nothing
4521+ , _pAmountMicros = Nothing
4522+ }
4523+
4524+-- | The currency code for the price.
4525+pCurrencyCode :: Lens' Price (Maybe Text)
4526+pCurrencyCode
4527+ = lens _pCurrencyCode
4528+ (\ s a -> s{_pCurrencyCode = a})
4529+
4530+-- | The CPM value in micros.
4531+pAmountMicros :: Lens' Price (Maybe Double)
4532+pAmountMicros
4533+ = lens _pAmountMicros
4534+ (\ s a -> s{_pAmountMicros = a})
4535+
4536+instance FromJSON Price where
4537+ parseJSON
4538+ = withObject "Price"
4539+ (\ o ->
4540+ Price <$>
4541+ (o .:? "currencyCode") <*> (o .:? "amountMicros"))
4542+
4543+instance ToJSON Price where
4544+ toJSON Price{..}
4545+ = object
4546+ (catMaybes
4547+ [("currencyCode" .=) <$> _pCurrencyCode,
4548+ ("amountMicros" .=) <$> _pAmountMicros])
4549+
4550+--
4551+-- /See:/ 'editAllOrderDealsRequest' smart constructor.
4552+data EditAllOrderDealsRequest = EditAllOrderDealsRequest
4553+ { _eUpdateAction :: !(Maybe Text)
4554+ , _eDeals :: !(Maybe [Maybe MarketplaceDeal])
4555+ , _eOrder :: !(Maybe (Maybe MarketplaceOrder))
4556+ , _eOrderRevisionNumber :: !(Maybe Int64)
4557+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4558+
4559+-- | Creates a value of 'EditAllOrderDealsRequest' with the minimum fields required to make a request.
4560+--
4561+-- Use one of the following lenses to modify other fields as desired:
4562+--
4563+-- * 'eUpdateAction'
4564+--
4565+-- * 'eDeals'
4566+--
4567+-- * 'eOrder'
4568+--
4569+-- * 'eOrderRevisionNumber'
4570+editAllOrderDealsRequest
4571+ :: EditAllOrderDealsRequest
4572+editAllOrderDealsRequest =
4573+ EditAllOrderDealsRequest
4574+ { _eUpdateAction = Nothing
4575+ , _eDeals = Nothing
4576+ , _eOrder = Nothing
4577+ , _eOrderRevisionNumber = Nothing
4578+ }
4579+
4580+-- | Indicates an optional action to take on the order
4581+eUpdateAction :: Lens' EditAllOrderDealsRequest (Maybe Text)
4582+eUpdateAction
4583+ = lens _eUpdateAction
4584+ (\ s a -> s{_eUpdateAction = a})
4585+
4586+-- | List of deals to edit. Service may perform 3 different operations based
4587+-- on comparison of deals in this list vs deals already persisted in
4588+-- database: 1. Add new deal to order If a deal in this list does not exist
4589+-- in the order, the service will create a new deal and add it to the
4590+-- order. Validation will follow AddOrderDealsRequest. 2. Update existing
4591+-- deal in the order If a deal in this list already exist in the order, the
4592+-- service will update that existing deal to this new deal in the request.
4593+-- Validation will follow UpdateOrderDealsRequest. 3. Delete deals from the
4594+-- order (just need the id) If a existing deal in the order is not present
4595+-- in this list, the service will delete that deal from the order.
4596+-- Validation will follow DeleteOrderDealsRequest.
4597+eDeals :: Lens' EditAllOrderDealsRequest [Maybe MarketplaceDeal]
4598+eDeals
4599+ = lens _eDeals (\ s a -> s{_eDeals = a}) . _Default .
4600+ _Coerce
4601+
4602+-- | If specified, also updates the order in the batch transaction. This is
4603+-- useful when the order and the deals need to be updated in one
4604+-- transaction.
4605+eOrder :: Lens' EditAllOrderDealsRequest (Maybe (Maybe MarketplaceOrder))
4606+eOrder = lens _eOrder (\ s a -> s{_eOrder = a})
4607+
4608+-- | The last known revision number for the order.
4609+eOrderRevisionNumber :: Lens' EditAllOrderDealsRequest (Maybe Int64)
4610+eOrderRevisionNumber
4611+ = lens _eOrderRevisionNumber
4612+ (\ s a -> s{_eOrderRevisionNumber = a})
4613+
4614+instance FromJSON EditAllOrderDealsRequest where
4615+ parseJSON
4616+ = withObject "EditAllOrderDealsRequest"
4617+ (\ o ->
4618+ EditAllOrderDealsRequest <$>
4619+ (o .:? "updateAction") <*> (o .:? "deals" .!= mempty)
4620+ <*> (o .:? "order")
4621+ <*> (o .:? "orderRevisionNumber"))
4622+
4623+instance ToJSON EditAllOrderDealsRequest where
4624+ toJSON EditAllOrderDealsRequest{..}
4625+ = object
4626+ (catMaybes
4627+ [("updateAction" .=) <$> _eUpdateAction,
4628+ ("deals" .=) <$> _eDeals, ("order" .=) <$> _eOrder,
4629+ ("orderRevisionNumber" .=) <$>
4630+ _eOrderRevisionNumber])
4631+
4632+-- | The configuration data for an Ad Exchange billing info.
4633+--
4634+-- /See:/ 'billingInfo' smart constructor.
4635+data BillingInfo = BillingInfo
4636+ { _biKind :: !Text
4637+ , _biAccountName :: !(Maybe Text)
4638+ , _biAccountId :: !(Maybe Int32)
4639+ , _biBillingId :: !(Maybe [Text])
4640+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4641+
4642+-- | Creates a value of 'BillingInfo' with the minimum fields required to make a request.
4643+--
4644+-- Use one of the following lenses to modify other fields as desired:
4645+--
4646+-- * 'biKind'
4647+--
4648+-- * 'biAccountName'
4649+--
4650+-- * 'biAccountId'
4651+--
4652+-- * 'biBillingId'
4653+billingInfo
4654+ :: BillingInfo
4655+billingInfo =
4656+ BillingInfo
4657+ { _biKind = "adexchangebuyer#billingInfo"
4658+ , _biAccountName = Nothing
4659+ , _biAccountId = Nothing
4660+ , _biBillingId = Nothing
4661+ }
4662+
4663+-- | Resource type.
4664+biKind :: Lens' BillingInfo Text
4665+biKind = lens _biKind (\ s a -> s{_biKind = a})
4666+
4667+-- | Account name.
4668+biAccountName :: Lens' BillingInfo (Maybe Text)
4669+biAccountName
4670+ = lens _biAccountName
4671+ (\ s a -> s{_biAccountName = a})
4672+
4673+-- | Account id.
4674+biAccountId :: Lens' BillingInfo (Maybe Int32)
4675+biAccountId
4676+ = lens _biAccountId (\ s a -> s{_biAccountId = a})
4677+
4678+-- | A list of adgroup IDs associated with this particular account. These IDs
4679+-- may show up as part of a realtime bidding BidRequest, which indicates a
4680+-- bid request for this account.
4681+biBillingId :: Lens' BillingInfo [Text]
4682+biBillingId
4683+ = lens _biBillingId (\ s a -> s{_biBillingId = a}) .
4684+ _Default
4685+ . _Coerce
4686+
4687+instance FromJSON BillingInfo where
4688+ parseJSON
4689+ = withObject "BillingInfo"
4690+ (\ o ->
4691+ BillingInfo <$>
4692+ (o .:? "kind" .!= "adexchangebuyer#billingInfo") <*>
4693+ (o .:? "accountName")
4694+ <*> (o .:? "accountId")
4695+ <*> (o .:? "billingId" .!= mempty))
4696+
4697+instance ToJSON BillingInfo where
4698+ toJSON BillingInfo{..}
4699+ = object
4700+ (catMaybes
4701+ [Just ("kind" .= _biKind),
4702+ ("accountName" .=) <$> _biAccountName,
4703+ ("accountId" .=) <$> _biAccountId,
4704+ ("billingId" .=) <$> _biBillingId])
4705+
4706+--
4707+-- /See:/ 'webPropertyDto' smart constructor.
4708+data WebPropertyDto = WebPropertyDto
4709+ { _wpdEnabledForPreferredDeals :: !(Maybe Bool)
4710+ , _wpdSyndicationProduct :: !(Maybe Text)
4711+ , _wpdName :: !(Maybe Text)
4712+ , _wpdPropertyCode :: !(Maybe Text)
4713+ , _wpdId :: !(Maybe Int32)
4714+ , _wpdSiteUrls :: !(Maybe [Text])
4715+ , _wpdAllowInterestTargetedAds :: !(Maybe Bool)
4716+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4717+
4718+-- | Creates a value of 'WebPropertyDto' with the minimum fields required to make a request.
4719+--
4720+-- Use one of the following lenses to modify other fields as desired:
4721+--
4722+-- * 'wpdEnabledForPreferredDeals'
4723+--
4724+-- * 'wpdSyndicationProduct'
4725+--
4726+-- * 'wpdName'
4727+--
4728+-- * 'wpdPropertyCode'
4729+--
4730+-- * 'wpdId'
4731+--
4732+-- * 'wpdSiteUrls'
4733+--
4734+-- * 'wpdAllowInterestTargetedAds'
4735+webPropertyDto
4736+ :: WebPropertyDto
4737+webPropertyDto =
4738+ WebPropertyDto
4739+ { _wpdEnabledForPreferredDeals = Nothing
4740+ , _wpdSyndicationProduct = Nothing
4741+ , _wpdName = Nothing
4742+ , _wpdPropertyCode = Nothing
4743+ , _wpdId = Nothing
4744+ , _wpdSiteUrls = Nothing
4745+ , _wpdAllowInterestTargetedAds = Nothing
4746+ }
4747+
4748+wpdEnabledForPreferredDeals :: Lens' WebPropertyDto (Maybe Bool)
4749+wpdEnabledForPreferredDeals
4750+ = lens _wpdEnabledForPreferredDeals
4751+ (\ s a -> s{_wpdEnabledForPreferredDeals = a})
4752+
4753+wpdSyndicationProduct :: Lens' WebPropertyDto (Maybe Text)
4754+wpdSyndicationProduct
4755+ = lens _wpdSyndicationProduct
4756+ (\ s a -> s{_wpdSyndicationProduct = a})
4757+
4758+wpdName :: Lens' WebPropertyDto (Maybe Text)
4759+wpdName = lens _wpdName (\ s a -> s{_wpdName = a})
4760+
4761+wpdPropertyCode :: Lens' WebPropertyDto (Maybe Text)
4762+wpdPropertyCode
4763+ = lens _wpdPropertyCode
4764+ (\ s a -> s{_wpdPropertyCode = a})
4765+
4766+wpdId :: Lens' WebPropertyDto (Maybe Int32)
4767+wpdId = lens _wpdId (\ s a -> s{_wpdId = a})
4768+
4769+wpdSiteUrls :: Lens' WebPropertyDto [Text]
4770+wpdSiteUrls
4771+ = lens _wpdSiteUrls (\ s a -> s{_wpdSiteUrls = a}) .
4772+ _Default
4773+ . _Coerce
4774+
4775+wpdAllowInterestTargetedAds :: Lens' WebPropertyDto (Maybe Bool)
4776+wpdAllowInterestTargetedAds
4777+ = lens _wpdAllowInterestTargetedAds
4778+ (\ s a -> s{_wpdAllowInterestTargetedAds = a})
4779+
4780+instance FromJSON WebPropertyDto where
4781+ parseJSON
4782+ = withObject "WebPropertyDto"
4783+ (\ o ->
4784+ WebPropertyDto <$>
4785+ (o .:? "enabledForPreferredDeals") <*>
4786+ (o .:? "syndicationProduct")
4787+ <*> (o .:? "name")
4788+ <*> (o .:? "propertyCode")
4789+ <*> (o .:? "id")
4790+ <*> (o .:? "siteUrls" .!= mempty)
4791+ <*> (o .:? "allowInterestTargetedAds"))
4792+
4793+instance ToJSON WebPropertyDto where
4794+ toJSON WebPropertyDto{..}
4795+ = object
4796+ (catMaybes
4797+ [("enabledForPreferredDeals" .=) <$>
4798+ _wpdEnabledForPreferredDeals,
4799+ ("syndicationProduct" .=) <$> _wpdSyndicationProduct,
4800+ ("name" .=) <$> _wpdName,
4801+ ("propertyCode" .=) <$> _wpdPropertyCode,
4802+ ("id" .=) <$> _wpdId,
4803+ ("siteUrls" .=) <$> _wpdSiteUrls,
4804+ ("allowInterestTargetedAds" .=) <$>
4805+ _wpdAllowInterestTargetedAds])
4806+
4807+--
4808+-- /See:/ 'targetingValueDayPartTargeting' smart constructor.
4809+data TargetingValueDayPartTargeting = TargetingValueDayPartTargeting
4810+ { _tvdptTimeZoneType :: !(Maybe Text)
4811+ , _tvdptDayParts :: !(Maybe [Maybe TargetingValueDayPartTargetingDayPart])
4812+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4813+
4814+-- | Creates a value of 'TargetingValueDayPartTargeting' with the minimum fields required to make a request.
4815+--
4816+-- Use one of the following lenses to modify other fields as desired:
4817+--
4818+-- * 'tvdptTimeZoneType'
4819+--
4820+-- * 'tvdptDayParts'
4821+targetingValueDayPartTargeting
4822+ :: TargetingValueDayPartTargeting
4823+targetingValueDayPartTargeting =
4824+ TargetingValueDayPartTargeting
4825+ { _tvdptTimeZoneType = Nothing
4826+ , _tvdptDayParts = Nothing
4827+ }
4828+
4829+tvdptTimeZoneType :: Lens' TargetingValueDayPartTargeting (Maybe Text)
4830+tvdptTimeZoneType
4831+ = lens _tvdptTimeZoneType
4832+ (\ s a -> s{_tvdptTimeZoneType = a})
4833+
4834+tvdptDayParts :: Lens' TargetingValueDayPartTargeting [Maybe TargetingValueDayPartTargetingDayPart]
4835+tvdptDayParts
4836+ = lens _tvdptDayParts
4837+ (\ s a -> s{_tvdptDayParts = a})
4838+ . _Default
4839+ . _Coerce
4840+
4841+instance FromJSON TargetingValueDayPartTargeting
4842+ where
4843+ parseJSON
4844+ = withObject "TargetingValueDayPartTargeting"
4845+ (\ o ->
4846+ TargetingValueDayPartTargeting <$>
4847+ (o .:? "timeZoneType") <*>
4848+ (o .:? "dayParts" .!= mempty))
4849+
4850+instance ToJSON TargetingValueDayPartTargeting where
4851+ toJSON TargetingValueDayPartTargeting{..}
4852+ = object
4853+ (catMaybes
4854+ [("timeZoneType" .=) <$> _tvdptTimeZoneType,
4855+ ("dayParts" .=) <$> _tvdptDayParts])
4856+
4857+--
4858+-- /See:/ 'listOffersRequest' smart constructor.
4859+newtype ListOffersRequest = ListOffersRequest
4860+ { _lorSinceTimestampMillis :: Maybe Int64
4861+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4862+
4863+-- | Creates a value of 'ListOffersRequest' with the minimum fields required to make a request.
4864+--
4865+-- Use one of the following lenses to modify other fields as desired:
4866+--
4867+-- * 'lorSinceTimestampMillis'
4868+listOffersRequest
4869+ :: ListOffersRequest
4870+listOffersRequest =
4871+ ListOffersRequest
4872+ { _lorSinceTimestampMillis = Nothing
4873+ }
4874+
4875+lorSinceTimestampMillis :: Lens' ListOffersRequest (Maybe Int64)
4876+lorSinceTimestampMillis
4877+ = lens _lorSinceTimestampMillis
4878+ (\ s a -> s{_lorSinceTimestampMillis = a})
4879+
4880+instance FromJSON ListOffersRequest where
4881+ parseJSON
4882+ = withObject "ListOffersRequest"
4883+ (\ o ->
4884+ ListOffersRequest <$> (o .:? "sinceTimestampMillis"))
4885+
4886+instance ToJSON ListOffersRequest where
4887+ toJSON ListOffersRequest{..}
4888+ = object
4889+ (catMaybes
4890+ [("sinceTimestampMillis" .=) <$>
4891+ _lorSinceTimestampMillis])
4892+
4893+--
4894+-- /See:/ 'listClientAccessCapabilitiesRequest' smart constructor.
4895+newtype ListClientAccessCapabilitiesRequest = ListClientAccessCapabilitiesRequest
4896+ { _lcacrSponsorAccountId :: Maybe Int64
4897+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4898+
4899+-- | Creates a value of 'ListClientAccessCapabilitiesRequest' with the minimum fields required to make a request.
4900+--
4901+-- Use one of the following lenses to modify other fields as desired:
4902+--
4903+-- * 'lcacrSponsorAccountId'
4904+listClientAccessCapabilitiesRequest
4905+ :: ListClientAccessCapabilitiesRequest
4906+listClientAccessCapabilitiesRequest =
4907+ ListClientAccessCapabilitiesRequest
4908+ { _lcacrSponsorAccountId = Nothing
4909+ }
4910+
4911+lcacrSponsorAccountId :: Lens' ListClientAccessCapabilitiesRequest (Maybe Int64)
4912+lcacrSponsorAccountId
4913+ = lens _lcacrSponsorAccountId
4914+ (\ s a -> s{_lcacrSponsorAccountId = a})
4915+
4916+instance FromJSON ListClientAccessCapabilitiesRequest
4917+ where
4918+ parseJSON
4919+ = withObject "ListClientAccessCapabilitiesRequest"
4920+ (\ o ->
4921+ ListClientAccessCapabilitiesRequest <$>
4922+ (o .:? "sponsorAccountId"))
4923+
4924+instance ToJSON ListClientAccessCapabilitiesRequest
4925+ where
4926+ toJSON ListClientAccessCapabilitiesRequest{..}
4927+ = object
4928+ (catMaybes
4929+ [("sponsorAccountId" .=) <$> _lcacrSponsorAccountId])
4930+
4931+--
4932+-- /See:/ 'inventorySegmentTargeting' smart constructor.
4933+data InventorySegmentTargeting = InventorySegmentTargeting
4934+ { _istNegativeVideoDurationSegments :: !(Maybe [Int64])
4935+ , _istNegativeIcmBrands :: !(Maybe [Int64])
4936+ , _istNegativeKeyValues :: !(Maybe [Maybe RuleKeyValuePair])
4937+ , _istPositiveAudienceSegments :: !(Maybe [Int64])
4938+ , _istPositiveXfpPlacements :: !(Maybe [Int64])
4939+ , _istNegativeXfpAdSlots :: !(Maybe [Int64])
4940+ , _istPositiveOperatingSystemVersions :: !(Maybe [Int64])
4941+ , _istPositiveSizes :: !(Maybe [Int64])
4942+ , _istPositiveDeviceCategories :: !(Maybe [Int64])
4943+ , _istPositiveLocations :: !(Maybe [Int64])
4944+ , _istNegativeAdSizes :: !(Maybe [Maybe AdSize])
4945+ , _istPositiveOperatingSystems :: !(Maybe [Int64])
4946+ , _istPositiveSiteUrls :: !(Maybe [Text])
4947+ , _istNegativeInventorySlots :: !(Maybe [Text])
4948+ , _istNegativeVideoAdPositionSegments :: !(Maybe [Text])
4949+ , _istPositiveAdTypeSegments :: !(Maybe [Text])
4950+ , _istPositiveIcmInterests :: !(Maybe [Int64])
4951+ , _istPositiveMobileApps :: !(Maybe [Text])
4952+ , _istPositiveKeyValues :: !(Maybe [Maybe RuleKeyValuePair])
4953+ , _istPositiveIcmBrands :: !(Maybe [Int64])
4954+ , _istPositiveVideoDurationSegments :: !(Maybe [Int64])
4955+ , _istNegativeAudienceSegments :: !(Maybe [Int64])
4956+ , _istNegativeXfpPlacements :: !(Maybe [Int64])
4957+ , _istPositiveXfpAdSlots :: !(Maybe [Int64])
4958+ , _istNegativeOperatingSystemVersions :: !(Maybe [Int64])
4959+ , _istNegativeSizes :: !(Maybe [Int64])
4960+ , _istNegativeLocations :: !(Maybe [Int64])
4961+ , _istNegativeDeviceCategories :: !(Maybe [Int64])
4962+ , _istNegativeOperatingSystems :: !(Maybe [Int64])
4963+ , _istPositiveAdSizes :: !(Maybe [Maybe AdSize])
4964+ , _istNegativeSiteUrls :: !(Maybe [Text])
4965+ , _istNegativeAdTypeSegments :: !(Maybe [Text])
4966+ , _istPositiveVideoAdPositionSegments :: !(Maybe [Text])
4967+ , _istPositiveInventorySlots :: !(Maybe [Text])
4968+ , _istNegativeMobileApps :: !(Maybe [Text])
4969+ , _istNegativeIcmInterests :: !(Maybe [Int64])
4970+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
4971+
4972+-- | Creates a value of 'InventorySegmentTargeting' with the minimum fields required to make a request.
4973+--
4974+-- Use one of the following lenses to modify other fields as desired:
4975+--
4976+-- * 'istNegativeVideoDurationSegments'
4977+--
4978+-- * 'istNegativeIcmBrands'
4979+--
4980+-- * 'istNegativeKeyValues'
4981+--
4982+-- * 'istPositiveAudienceSegments'
4983+--
4984+-- * 'istPositiveXfpPlacements'
4985+--
4986+-- * 'istNegativeXfpAdSlots'
4987+--
4988+-- * 'istPositiveOperatingSystemVersions'
4989+--
4990+-- * 'istPositiveSizes'
4991+--
4992+-- * 'istPositiveDeviceCategories'
4993+--
4994+-- * 'istPositiveLocations'
4995+--
4996+-- * 'istNegativeAdSizes'
4997+--
4998+-- * 'istPositiveOperatingSystems'
4999+--
5000+-- * 'istPositiveSiteUrls'
5001+--
5002+-- * 'istNegativeInventorySlots'
5003+--
5004+-- * 'istNegativeVideoAdPositionSegments'
5005+--
5006+-- * 'istPositiveAdTypeSegments'
5007+--
5008+-- * 'istPositiveIcmInterests'
5009+--
5010+-- * 'istPositiveMobileApps'
5011+--
5012+-- * 'istPositiveKeyValues'
5013+--
5014+-- * 'istPositiveIcmBrands'
5015+--
5016+-- * 'istPositiveVideoDurationSegments'
5017+--
5018+-- * 'istNegativeAudienceSegments'
5019+--
5020+-- * 'istNegativeXfpPlacements'
5021+--
5022+-- * 'istPositiveXfpAdSlots'
5023+--
5024+-- * 'istNegativeOperatingSystemVersions'
5025+--
5026+-- * 'istNegativeSizes'
5027+--
5028+-- * 'istNegativeLocations'
5029+--
5030+-- * 'istNegativeDeviceCategories'
5031+--
5032+-- * 'istNegativeOperatingSystems'
5033+--
5034+-- * 'istPositiveAdSizes'
5035+--
5036+-- * 'istNegativeSiteUrls'
5037+--
5038+-- * 'istNegativeAdTypeSegments'
5039+--
5040+-- * 'istPositiveVideoAdPositionSegments'
5041+--
5042+-- * 'istPositiveInventorySlots'
5043+--
5044+-- * 'istNegativeMobileApps'
5045+--
5046+-- * 'istNegativeIcmInterests'
5047+inventorySegmentTargeting
5048+ :: InventorySegmentTargeting
5049+inventorySegmentTargeting =
5050+ InventorySegmentTargeting
5051+ { _istNegativeVideoDurationSegments = Nothing
5052+ , _istNegativeIcmBrands = Nothing
5053+ , _istNegativeKeyValues = Nothing
5054+ , _istPositiveAudienceSegments = Nothing
5055+ , _istPositiveXfpPlacements = Nothing
5056+ , _istNegativeXfpAdSlots = Nothing
5057+ , _istPositiveOperatingSystemVersions = Nothing
5058+ , _istPositiveSizes = Nothing
5059+ , _istPositiveDeviceCategories = Nothing
5060+ , _istPositiveLocations = Nothing
5061+ , _istNegativeAdSizes = Nothing
5062+ , _istPositiveOperatingSystems = Nothing
5063+ , _istPositiveSiteUrls = Nothing
5064+ , _istNegativeInventorySlots = Nothing
5065+ , _istNegativeVideoAdPositionSegments = Nothing
5066+ , _istPositiveAdTypeSegments = Nothing
5067+ , _istPositiveIcmInterests = Nothing
5068+ , _istPositiveMobileApps = Nothing
5069+ , _istPositiveKeyValues = Nothing
5070+ , _istPositiveIcmBrands = Nothing
5071+ , _istPositiveVideoDurationSegments = Nothing
5072+ , _istNegativeAudienceSegments = Nothing
5073+ , _istNegativeXfpPlacements = Nothing
5074+ , _istPositiveXfpAdSlots = Nothing
5075+ , _istNegativeOperatingSystemVersions = Nothing
5076+ , _istNegativeSizes = Nothing
5077+ , _istNegativeLocations = Nothing
5078+ , _istNegativeDeviceCategories = Nothing
5079+ , _istNegativeOperatingSystems = Nothing
5080+ , _istPositiveAdSizes = Nothing
5081+ , _istNegativeSiteUrls = Nothing
5082+ , _istNegativeAdTypeSegments = Nothing
5083+ , _istPositiveVideoAdPositionSegments = Nothing
5084+ , _istPositiveInventorySlots = Nothing
5085+ , _istNegativeMobileApps = Nothing
5086+ , _istNegativeIcmInterests = Nothing
5087+ }
5088+
5089+istNegativeVideoDurationSegments :: Lens' InventorySegmentTargeting [Int64]
5090+istNegativeVideoDurationSegments
5091+ = lens _istNegativeVideoDurationSegments
5092+ (\ s a -> s{_istNegativeVideoDurationSegments = a})
5093+ . _Default
5094+ . _Coerce
5095+
5096+istNegativeIcmBrands :: Lens' InventorySegmentTargeting [Int64]
5097+istNegativeIcmBrands
5098+ = lens _istNegativeIcmBrands
5099+ (\ s a -> s{_istNegativeIcmBrands = a})
5100+ . _Default
5101+ . _Coerce
5102+
5103+istNegativeKeyValues :: Lens' InventorySegmentTargeting [Maybe RuleKeyValuePair]
5104+istNegativeKeyValues
5105+ = lens _istNegativeKeyValues
5106+ (\ s a -> s{_istNegativeKeyValues = a})
5107+ . _Default
5108+ . _Coerce
5109+
5110+istPositiveAudienceSegments :: Lens' InventorySegmentTargeting [Int64]
5111+istPositiveAudienceSegments
5112+ = lens _istPositiveAudienceSegments
5113+ (\ s a -> s{_istPositiveAudienceSegments = a})
5114+ . _Default
5115+ . _Coerce
5116+
5117+istPositiveXfpPlacements :: Lens' InventorySegmentTargeting [Int64]
5118+istPositiveXfpPlacements
5119+ = lens _istPositiveXfpPlacements
5120+ (\ s a -> s{_istPositiveXfpPlacements = a})
5121+ . _Default
5122+ . _Coerce
5123+
5124+istNegativeXfpAdSlots :: Lens' InventorySegmentTargeting [Int64]
5125+istNegativeXfpAdSlots
5126+ = lens _istNegativeXfpAdSlots
5127+ (\ s a -> s{_istNegativeXfpAdSlots = a})
5128+ . _Default
5129+ . _Coerce
5130+
5131+istPositiveOperatingSystemVersions :: Lens' InventorySegmentTargeting [Int64]
5132+istPositiveOperatingSystemVersions
5133+ = lens _istPositiveOperatingSystemVersions
5134+ (\ s a -> s{_istPositiveOperatingSystemVersions = a})
5135+ . _Default
5136+ . _Coerce
5137+
5138+istPositiveSizes :: Lens' InventorySegmentTargeting [Int64]
5139+istPositiveSizes
5140+ = lens _istPositiveSizes
5141+ (\ s a -> s{_istPositiveSizes = a})
5142+ . _Default
5143+ . _Coerce
5144+
5145+istPositiveDeviceCategories :: Lens' InventorySegmentTargeting [Int64]
5146+istPositiveDeviceCategories
5147+ = lens _istPositiveDeviceCategories
5148+ (\ s a -> s{_istPositiveDeviceCategories = a})
5149+ . _Default
5150+ . _Coerce
5151+
5152+istPositiveLocations :: Lens' InventorySegmentTargeting [Int64]
5153+istPositiveLocations
5154+ = lens _istPositiveLocations
5155+ (\ s a -> s{_istPositiveLocations = a})
5156+ . _Default
5157+ . _Coerce
5158+
5159+istNegativeAdSizes :: Lens' InventorySegmentTargeting [Maybe AdSize]
5160+istNegativeAdSizes
5161+ = lens _istNegativeAdSizes
5162+ (\ s a -> s{_istNegativeAdSizes = a})
5163+ . _Default
5164+ . _Coerce
5165+
5166+istPositiveOperatingSystems :: Lens' InventorySegmentTargeting [Int64]
5167+istPositiveOperatingSystems
5168+ = lens _istPositiveOperatingSystems
5169+ (\ s a -> s{_istPositiveOperatingSystems = a})
5170+ . _Default
5171+ . _Coerce
5172+
5173+istPositiveSiteUrls :: Lens' InventorySegmentTargeting [Text]
5174+istPositiveSiteUrls
5175+ = lens _istPositiveSiteUrls
5176+ (\ s a -> s{_istPositiveSiteUrls = a})
5177+ . _Default
5178+ . _Coerce
5179+
5180+istNegativeInventorySlots :: Lens' InventorySegmentTargeting [Text]
5181+istNegativeInventorySlots
5182+ = lens _istNegativeInventorySlots
5183+ (\ s a -> s{_istNegativeInventorySlots = a})
5184+ . _Default
5185+ . _Coerce
5186+
5187+istNegativeVideoAdPositionSegments :: Lens' InventorySegmentTargeting [Text]
5188+istNegativeVideoAdPositionSegments
5189+ = lens _istNegativeVideoAdPositionSegments
5190+ (\ s a -> s{_istNegativeVideoAdPositionSegments = a})
5191+ . _Default
5192+ . _Coerce
5193+
5194+istPositiveAdTypeSegments :: Lens' InventorySegmentTargeting [Text]
5195+istPositiveAdTypeSegments
5196+ = lens _istPositiveAdTypeSegments
5197+ (\ s a -> s{_istPositiveAdTypeSegments = a})
5198+ . _Default
5199+ . _Coerce
5200+
5201+istPositiveIcmInterests :: Lens' InventorySegmentTargeting [Int64]
5202+istPositiveIcmInterests
5203+ = lens _istPositiveIcmInterests
5204+ (\ s a -> s{_istPositiveIcmInterests = a})
5205+ . _Default
5206+ . _Coerce
5207+
5208+istPositiveMobileApps :: Lens' InventorySegmentTargeting [Text]
5209+istPositiveMobileApps
5210+ = lens _istPositiveMobileApps
5211+ (\ s a -> s{_istPositiveMobileApps = a})
5212+ . _Default
5213+ . _Coerce
5214+
5215+istPositiveKeyValues :: Lens' InventorySegmentTargeting [Maybe RuleKeyValuePair]
5216+istPositiveKeyValues
5217+ = lens _istPositiveKeyValues
5218+ (\ s a -> s{_istPositiveKeyValues = a})
5219+ . _Default
5220+ . _Coerce
5221+
5222+istPositiveIcmBrands :: Lens' InventorySegmentTargeting [Int64]
5223+istPositiveIcmBrands
5224+ = lens _istPositiveIcmBrands
5225+ (\ s a -> s{_istPositiveIcmBrands = a})
5226+ . _Default
5227+ . _Coerce
5228+
5229+istPositiveVideoDurationSegments :: Lens' InventorySegmentTargeting [Int64]
5230+istPositiveVideoDurationSegments
5231+ = lens _istPositiveVideoDurationSegments
5232+ (\ s a -> s{_istPositiveVideoDurationSegments = a})
5233+ . _Default
5234+ . _Coerce
5235+
5236+istNegativeAudienceSegments :: Lens' InventorySegmentTargeting [Int64]
5237+istNegativeAudienceSegments
5238+ = lens _istNegativeAudienceSegments
5239+ (\ s a -> s{_istNegativeAudienceSegments = a})
5240+ . _Default
5241+ . _Coerce
5242+
5243+istNegativeXfpPlacements :: Lens' InventorySegmentTargeting [Int64]
5244+istNegativeXfpPlacements
5245+ = lens _istNegativeXfpPlacements
5246+ (\ s a -> s{_istNegativeXfpPlacements = a})
5247+ . _Default
5248+ . _Coerce
5249+
5250+istPositiveXfpAdSlots :: Lens' InventorySegmentTargeting [Int64]
5251+istPositiveXfpAdSlots
5252+ = lens _istPositiveXfpAdSlots
5253+ (\ s a -> s{_istPositiveXfpAdSlots = a})
5254+ . _Default
5255+ . _Coerce
5256+
5257+istNegativeOperatingSystemVersions :: Lens' InventorySegmentTargeting [Int64]
5258+istNegativeOperatingSystemVersions
5259+ = lens _istNegativeOperatingSystemVersions
5260+ (\ s a -> s{_istNegativeOperatingSystemVersions = a})
5261+ . _Default
5262+ . _Coerce
5263+
5264+istNegativeSizes :: Lens' InventorySegmentTargeting [Int64]
5265+istNegativeSizes
5266+ = lens _istNegativeSizes
5267+ (\ s a -> s{_istNegativeSizes = a})
5268+ . _Default
5269+ . _Coerce
5270+
5271+istNegativeLocations :: Lens' InventorySegmentTargeting [Int64]
5272+istNegativeLocations
5273+ = lens _istNegativeLocations
5274+ (\ s a -> s{_istNegativeLocations = a})
5275+ . _Default
5276+ . _Coerce
5277+
5278+istNegativeDeviceCategories :: Lens' InventorySegmentTargeting [Int64]
5279+istNegativeDeviceCategories
5280+ = lens _istNegativeDeviceCategories
5281+ (\ s a -> s{_istNegativeDeviceCategories = a})
5282+ . _Default
5283+ . _Coerce
5284+
5285+istNegativeOperatingSystems :: Lens' InventorySegmentTargeting [Int64]
5286+istNegativeOperatingSystems
5287+ = lens _istNegativeOperatingSystems
5288+ (\ s a -> s{_istNegativeOperatingSystems = a})
5289+ . _Default
5290+ . _Coerce
5291+
5292+istPositiveAdSizes :: Lens' InventorySegmentTargeting [Maybe AdSize]
5293+istPositiveAdSizes
5294+ = lens _istPositiveAdSizes
5295+ (\ s a -> s{_istPositiveAdSizes = a})
5296+ . _Default
5297+ . _Coerce
5298+
5299+istNegativeSiteUrls :: Lens' InventorySegmentTargeting [Text]
5300+istNegativeSiteUrls
5301+ = lens _istNegativeSiteUrls
5302+ (\ s a -> s{_istNegativeSiteUrls = a})
5303+ . _Default
5304+ . _Coerce
5305+
5306+istNegativeAdTypeSegments :: Lens' InventorySegmentTargeting [Text]
5307+istNegativeAdTypeSegments
5308+ = lens _istNegativeAdTypeSegments
5309+ (\ s a -> s{_istNegativeAdTypeSegments = a})
5310+ . _Default
5311+ . _Coerce
5312+
5313+istPositiveVideoAdPositionSegments :: Lens' InventorySegmentTargeting [Text]
5314+istPositiveVideoAdPositionSegments
5315+ = lens _istPositiveVideoAdPositionSegments
5316+ (\ s a -> s{_istPositiveVideoAdPositionSegments = a})
5317+ . _Default
5318+ . _Coerce
5319+
5320+istPositiveInventorySlots :: Lens' InventorySegmentTargeting [Text]
5321+istPositiveInventorySlots
5322+ = lens _istPositiveInventorySlots
5323+ (\ s a -> s{_istPositiveInventorySlots = a})
5324+ . _Default
5325+ . _Coerce
5326+
5327+istNegativeMobileApps :: Lens' InventorySegmentTargeting [Text]
5328+istNegativeMobileApps
5329+ = lens _istNegativeMobileApps
5330+ (\ s a -> s{_istNegativeMobileApps = a})
5331+ . _Default
5332+ . _Coerce
5333+
5334+istNegativeIcmInterests :: Lens' InventorySegmentTargeting [Int64]
5335+istNegativeIcmInterests
5336+ = lens _istNegativeIcmInterests
5337+ (\ s a -> s{_istNegativeIcmInterests = a})
5338+ . _Default
5339+ . _Coerce
5340+
5341+instance FromJSON InventorySegmentTargeting where
5342+ parseJSON
5343+ = withObject "InventorySegmentTargeting"
5344+ (\ o ->
5345+ InventorySegmentTargeting <$>
5346+ (o .:? "negativeVideoDurationSegments" .!= mempty)
5347+ <*> (o .:? "negativeIcmBrands" .!= mempty)
5348+ <*> (o .:? "negativeKeyValues" .!= mempty)
5349+ <*> (o .:? "positiveAudienceSegments" .!= mempty)
5350+ <*> (o .:? "positiveXfpPlacements" .!= mempty)
5351+ <*> (o .:? "negativeXfpAdSlots" .!= mempty)
5352+ <*>
5353+ (o .:? "positiveOperatingSystemVersions" .!= mempty)
5354+ <*> (o .:? "positiveSizes" .!= mempty)
5355+ <*> (o .:? "positiveDeviceCategories" .!= mempty)
5356+ <*> (o .:? "positiveLocations" .!= mempty)
5357+ <*> (o .:? "negativeAdSizes" .!= mempty)
5358+ <*> (o .:? "positiveOperatingSystems" .!= mempty)
5359+ <*> (o .:? "positiveSiteUrls" .!= mempty)
5360+ <*> (o .:? "negativeInventorySlots" .!= mempty)
5361+ <*>
5362+ (o .:? "negativeVideoAdPositionSegments" .!= mempty)
5363+ <*> (o .:? "positiveAdTypeSegments" .!= mempty)
5364+ <*> (o .:? "positiveIcmInterests" .!= mempty)
5365+ <*> (o .:? "positiveMobileApps" .!= mempty)
5366+ <*> (o .:? "positiveKeyValues" .!= mempty)
5367+ <*> (o .:? "positiveIcmBrands" .!= mempty)
5368+ <*>
5369+ (o .:? "positiveVideoDurationSegments" .!= mempty)
5370+ <*> (o .:? "negativeAudienceSegments" .!= mempty)
5371+ <*> (o .:? "negativeXfpPlacements" .!= mempty)
5372+ <*> (o .:? "positiveXfpAdSlots" .!= mempty)
5373+ <*>
5374+ (o .:? "negativeOperatingSystemVersions" .!= mempty)
5375+ <*> (o .:? "negativeSizes" .!= mempty)
5376+ <*> (o .:? "negativeLocations" .!= mempty)
5377+ <*> (o .:? "negativeDeviceCategories" .!= mempty)
5378+ <*> (o .:? "negativeOperatingSystems" .!= mempty)
5379+ <*> (o .:? "positiveAdSizes" .!= mempty)
5380+ <*> (o .:? "negativeSiteUrls" .!= mempty)
5381+ <*> (o .:? "negativeAdTypeSegments" .!= mempty)
5382+ <*>
5383+ (o .:? "positiveVideoAdPositionSegments" .!= mempty)
5384+ <*> (o .:? "positiveInventorySlots" .!= mempty)
5385+ <*> (o .:? "negativeMobileApps" .!= mempty)
5386+ <*> (o .:? "negativeIcmInterests" .!= mempty))
5387+
5388+instance ToJSON InventorySegmentTargeting where
5389+ toJSON InventorySegmentTargeting{..}
5390+ = object
5391+ (catMaybes
5392+ [("negativeVideoDurationSegments" .=) <$>
5393+ _istNegativeVideoDurationSegments,
5394+ ("negativeIcmBrands" .=) <$> _istNegativeIcmBrands,
5395+ ("negativeKeyValues" .=) <$> _istNegativeKeyValues,
5396+ ("positiveAudienceSegments" .=) <$>
5397+ _istPositiveAudienceSegments,
5398+ ("positiveXfpPlacements" .=) <$>
5399+ _istPositiveXfpPlacements,
5400+ ("negativeXfpAdSlots" .=) <$> _istNegativeXfpAdSlots,
5401+ ("positiveOperatingSystemVersions" .=) <$>
5402+ _istPositiveOperatingSystemVersions,
5403+ ("positiveSizes" .=) <$> _istPositiveSizes,
5404+ ("positiveDeviceCategories" .=) <$>
5405+ _istPositiveDeviceCategories,
5406+ ("positiveLocations" .=) <$> _istPositiveLocations,
5407+ ("negativeAdSizes" .=) <$> _istNegativeAdSizes,
5408+ ("positiveOperatingSystems" .=) <$>
5409+ _istPositiveOperatingSystems,
5410+ ("positiveSiteUrls" .=) <$> _istPositiveSiteUrls,
5411+ ("negativeInventorySlots" .=) <$>
5412+ _istNegativeInventorySlots,
5413+ ("negativeVideoAdPositionSegments" .=) <$>
5414+ _istNegativeVideoAdPositionSegments,
5415+ ("positiveAdTypeSegments" .=) <$>
5416+ _istPositiveAdTypeSegments,
5417+ ("positiveIcmInterests" .=) <$>
5418+ _istPositiveIcmInterests,
5419+ ("positiveMobileApps" .=) <$> _istPositiveMobileApps,
5420+ ("positiveKeyValues" .=) <$> _istPositiveKeyValues,
5421+ ("positiveIcmBrands" .=) <$> _istPositiveIcmBrands,
5422+ ("positiveVideoDurationSegments" .=) <$>
5423+ _istPositiveVideoDurationSegments,
5424+ ("negativeAudienceSegments" .=) <$>
5425+ _istNegativeAudienceSegments,
5426+ ("negativeXfpPlacements" .=) <$>
5427+ _istNegativeXfpPlacements,
5428+ ("positiveXfpAdSlots" .=) <$> _istPositiveXfpAdSlots,
5429+ ("negativeOperatingSystemVersions" .=) <$>
5430+ _istNegativeOperatingSystemVersions,
5431+ ("negativeSizes" .=) <$> _istNegativeSizes,
5432+ ("negativeLocations" .=) <$> _istNegativeLocations,
5433+ ("negativeDeviceCategories" .=) <$>
5434+ _istNegativeDeviceCategories,
5435+ ("negativeOperatingSystems" .=) <$>
5436+ _istNegativeOperatingSystems,
5437+ ("positiveAdSizes" .=) <$> _istPositiveAdSizes,
5438+ ("negativeSiteUrls" .=) <$> _istNegativeSiteUrls,
5439+ ("negativeAdTypeSegments" .=) <$>
5440+ _istNegativeAdTypeSegments,
5441+ ("positiveVideoAdPositionSegments" .=) <$>
5442+ _istPositiveVideoAdPositionSegments,
5443+ ("positiveInventorySlots" .=) <$>
5444+ _istPositiveInventorySlots,
5445+ ("negativeMobileApps" .=) <$> _istNegativeMobileApps,
5446+ ("negativeIcmInterests" .=) <$>
5447+ _istNegativeIcmInterests])
5448+
5449+--
5450+-- /See:/ 'sharedTargeting' smart constructor.
5451+data SharedTargeting = SharedTargeting
5452+ { _stKey :: !(Maybe Text)
5453+ , _stExclusions :: !(Maybe [Maybe TargetingValue])
5454+ , _stInclusions :: !(Maybe [Maybe TargetingValue])
5455+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
5456+
5457+-- | Creates a value of 'SharedTargeting' with the minimum fields required to make a request.
5458+--
5459+-- Use one of the following lenses to modify other fields as desired:
5460+--
5461+-- * 'stKey'
5462+--
5463+-- * 'stExclusions'
5464+--
5465+-- * 'stInclusions'
5466+sharedTargeting
5467+ :: SharedTargeting
5468+sharedTargeting =
5469+ SharedTargeting
5470+ { _stKey = Nothing
5471+ , _stExclusions = Nothing
5472+ , _stInclusions = Nothing
5473+ }
5474+
5475+-- | The key representing the shared targeting criterion.
5476+stKey :: Lens' SharedTargeting (Maybe Text)
5477+stKey = lens _stKey (\ s a -> s{_stKey = a})
5478+
5479+-- | The list of values to exclude from targeting.
5480+stExclusions :: Lens' SharedTargeting [Maybe TargetingValue]
5481+stExclusions
5482+ = lens _stExclusions (\ s a -> s{_stExclusions = a})
5483+ . _Default
5484+ . _Coerce
5485+
5486+-- | The list of value to include as part of the targeting.
5487+stInclusions :: Lens' SharedTargeting [Maybe TargetingValue]
5488+stInclusions
5489+ = lens _stInclusions (\ s a -> s{_stInclusions = a})
5490+ . _Default
5491+ . _Coerce
5492+
5493+instance FromJSON SharedTargeting where
5494+ parseJSON
5495+ = withObject "SharedTargeting"
5496+ (\ o ->
5497+ SharedTargeting <$>
5498+ (o .:? "key") <*> (o .:? "exclusions" .!= mempty) <*>
5499+ (o .:? "inclusions" .!= mempty))
5500+
5501+instance ToJSON SharedTargeting where
5502+ toJSON SharedTargeting{..}
5503+ = object
5504+ (catMaybes
5505+ [("key" .=) <$> _stKey,
5506+ ("exclusions" .=) <$> _stExclusions,
5507+ ("inclusions" .=) <$> _stInclusions])
5508+
5509+--
5510+-- /See:/ 'clientAccessCapabilities' smart constructor.
5511+data ClientAccessCapabilities = ClientAccessCapabilities
5512+ { _cacClientAccountId :: !(Maybe Int64)
5513+ , _cacCapabilities :: !(Maybe [Int32])
5514+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
5515+
5516+-- | Creates a value of 'ClientAccessCapabilities' with the minimum fields required to make a request.
5517+--
5518+-- Use one of the following lenses to modify other fields as desired:
5519+--
5520+-- * 'cacClientAccountId'
5521+--
5522+-- * 'cacCapabilities'
5523+clientAccessCapabilities
5524+ :: ClientAccessCapabilities
5525+clientAccessCapabilities =
5526+ ClientAccessCapabilities
5527+ { _cacClientAccountId = Nothing
5528+ , _cacCapabilities = Nothing
5529+ }
5530+
5531+cacClientAccountId :: Lens' ClientAccessCapabilities (Maybe Int64)
5532+cacClientAccountId
5533+ = lens _cacClientAccountId
5534+ (\ s a -> s{_cacClientAccountId = a})
5535+
5536+cacCapabilities :: Lens' ClientAccessCapabilities [Int32]
5537+cacCapabilities
5538+ = lens _cacCapabilities
5539+ (\ s a -> s{_cacCapabilities = a})
5540+ . _Default
5541+ . _Coerce
5542+
5543+instance FromJSON ClientAccessCapabilities where
5544+ parseJSON
5545+ = withObject "ClientAccessCapabilities"
5546+ (\ o ->
5547+ ClientAccessCapabilities <$>
5548+ (o .:? "clientAccountId") <*>
5549+ (o .:? "capabilities" .!= mempty))
5550+
5551+instance ToJSON ClientAccessCapabilities where
5552+ toJSON ClientAccessCapabilities{..}
5553+ = object
5554+ (catMaybes
5555+ [("clientAccountId" .=) <$> _cacClientAccountId,
5556+ ("capabilities" .=) <$> _cacCapabilities])
5557+
5558+--
5559+-- /See:/ 'deleteOrderDealsResponse' smart constructor.
5560+data DeleteOrderDealsResponse = DeleteOrderDealsResponse
5561+ { _dDeals :: !(Maybe [Maybe MarketplaceDeal])
5562+ , _dOrderRevisionNumber :: !(Maybe Int64)
5563+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
5564+
5565+-- | Creates a value of 'DeleteOrderDealsResponse' with the minimum fields required to make a request.
5566+--
5567+-- Use one of the following lenses to modify other fields as desired:
5568+--
5569+-- * 'dDeals'
5570+--
5571+-- * 'dOrderRevisionNumber'
5572+deleteOrderDealsResponse
5573+ :: DeleteOrderDealsResponse
5574+deleteOrderDealsResponse =
5575+ DeleteOrderDealsResponse
5576+ { _dDeals = Nothing
5577+ , _dOrderRevisionNumber = Nothing
5578+ }
5579+
5580+-- | List of deals deleted (in the same order as passed in the request)
5581+dDeals :: Lens' DeleteOrderDealsResponse [Maybe MarketplaceDeal]
5582+dDeals
5583+ = lens _dDeals (\ s a -> s{_dDeals = a}) . _Default .
5584+ _Coerce
5585+
5586+-- | The updated revision number for the order.
5587+dOrderRevisionNumber :: Lens' DeleteOrderDealsResponse (Maybe Int64)
5588+dOrderRevisionNumber
5589+ = lens _dOrderRevisionNumber
5590+ (\ s a -> s{_dOrderRevisionNumber = a})
5591+
5592+instance FromJSON DeleteOrderDealsResponse where
5593+ parseJSON
5594+ = withObject "DeleteOrderDealsResponse"
5595+ (\ o ->
5596+ DeleteOrderDealsResponse <$>
5597+ (o .:? "deals" .!= mempty) <*>
5598+ (o .:? "orderRevisionNumber"))
5599+
5600+instance ToJSON DeleteOrderDealsResponse where
5601+ toJSON DeleteOrderDealsResponse{..}
5602+ = object
5603+ (catMaybes
5604+ [("deals" .=) <$> _dDeals,
5605+ ("orderRevisionNumber" .=) <$>
5606+ _dOrderRevisionNumber])
5607+
5608+-- | An order can contain multiple deals. A deal contains the terms and
5609+-- targeting information that is used for serving.
5610+--
5611+-- /See:/ 'marketplaceDeal' smart constructor.
5612+data MarketplaceDeal = MarketplaceDeal
5613+ { _mdExternalDealId :: !(Maybe Text)
5614+ , _mdBuyerPrivateData :: !(Maybe (Maybe PrivateData))
5615+ , _mdWebPropertyCode :: !(Maybe Text)
5616+ , _mdCreationTimeMs :: !(Maybe Int64)
5617+ , _mdTerms :: !(Maybe (Maybe DealTerms))
5618+ , _mdOfferRevisionNumber :: !(Maybe Int64)
5619+ , _mdLastUpdateTimeMs :: !(Maybe Int64)
5620+ , _mdKind :: !Text
5621+ , _mdDeliveryControl :: !(Maybe (Maybe DeliveryControl))
5622+ , _mdFlightStartTimeMs :: !(Maybe Int64)
5623+ , _mdSharedTargetings :: !(Maybe [Maybe SharedTargeting])
5624+ , _mdDealId :: !(Maybe Text)
5625+ , _mdInventoryDescription :: !(Maybe Text)
5626+ , _mdSyndicationProduct :: !(Maybe Text)
5627+ , _mdFlightEndTimeMs :: !(Maybe Int64)
5628+ , _mdName :: !(Maybe Text)
5629+ , _mdSellerContacts :: !(Maybe [Maybe ContactInformation])
5630+ , _mdOfferId :: !(Maybe Text)
5631+ , _mdOrderId :: !(Maybe Text)
5632+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
5633+
5634+-- | Creates a value of 'MarketplaceDeal' with the minimum fields required to make a request.
5635+--
5636+-- Use one of the following lenses to modify other fields as desired:
5637+--
5638+-- * 'mdExternalDealId'
5639+--
5640+-- * 'mdBuyerPrivateData'
5641+--
5642+-- * 'mdWebPropertyCode'
5643+--
5644+-- * 'mdCreationTimeMs'
5645+--
5646+-- * 'mdTerms'
5647+--
5648+-- * 'mdOfferRevisionNumber'
5649+--
5650+-- * 'mdLastUpdateTimeMs'
5651+--
5652+-- * 'mdKind'
5653+--
5654+-- * 'mdDeliveryControl'
5655+--
5656+-- * 'mdFlightStartTimeMs'
5657+--
5658+-- * 'mdSharedTargetings'
5659+--
5660+-- * 'mdDealId'
5661+--
5662+-- * 'mdInventoryDescription'
5663+--
5664+-- * 'mdSyndicationProduct'
5665+--
5666+-- * 'mdFlightEndTimeMs'
5667+--
5668+-- * 'mdName'
5669+--
5670+-- * 'mdSellerContacts'
5671+--
5672+-- * 'mdOfferId'
5673+--
5674+-- * 'mdOrderId'
5675+marketplaceDeal
5676+ :: MarketplaceDeal
5677+marketplaceDeal =
5678+ MarketplaceDeal
5679+ { _mdExternalDealId = Nothing
5680+ , _mdBuyerPrivateData = Nothing
5681+ , _mdWebPropertyCode = Nothing
5682+ , _mdCreationTimeMs = Nothing
5683+ , _mdTerms = Nothing
5684+ , _mdOfferRevisionNumber = Nothing
5685+ , _mdLastUpdateTimeMs = Nothing
5686+ , _mdKind = "adexchangebuyer#marketplaceDeal"
5687+ , _mdDeliveryControl = Nothing
5688+ , _mdFlightStartTimeMs = Nothing
5689+ , _mdSharedTargetings = Nothing
5690+ , _mdDealId = Nothing
5691+ , _mdInventoryDescription = Nothing
5692+ , _mdSyndicationProduct = Nothing
5693+ , _mdFlightEndTimeMs = Nothing
5694+ , _mdName = Nothing
5695+ , _mdSellerContacts = Nothing
5696+ , _mdOfferId = Nothing
5697+ , _mdOrderId = Nothing
5698+ }
5699+
5700+-- | The external deal id assigned to this deal once the deal is finalized.
5701+-- This is the deal-id that shows up in serving\/reporting etc. (readonly)
5702+mdExternalDealId :: Lens' MarketplaceDeal (Maybe Text)
5703+mdExternalDealId
5704+ = lens _mdExternalDealId
5705+ (\ s a -> s{_mdExternalDealId = a})
5706+
5707+-- | Buyer private data (hidden from seller).
5708+mdBuyerPrivateData :: Lens' MarketplaceDeal (Maybe (Maybe PrivateData))
5709+mdBuyerPrivateData
5710+ = lens _mdBuyerPrivateData
5711+ (\ s a -> s{_mdBuyerPrivateData = a})
5712+
5713+mdWebPropertyCode :: Lens' MarketplaceDeal (Maybe Text)
5714+mdWebPropertyCode
5715+ = lens _mdWebPropertyCode
5716+ (\ s a -> s{_mdWebPropertyCode = a})
5717+
5718+-- | The time (ms since epoch) of the deal creation. (readonly)
5719+mdCreationTimeMs :: Lens' MarketplaceDeal (Maybe Int64)
5720+mdCreationTimeMs
5721+ = lens _mdCreationTimeMs
5722+ (\ s a -> s{_mdCreationTimeMs = a})
5723+
5724+-- | The negotiable terms of the deal. (updatable)
5725+mdTerms :: Lens' MarketplaceDeal (Maybe (Maybe DealTerms))
5726+mdTerms = lens _mdTerms (\ s a -> s{_mdTerms = a})
5727+
5728+-- | The revision number of the offer that the deal was created from
5729+-- (readonly, except on create)
5730+mdOfferRevisionNumber :: Lens' MarketplaceDeal (Maybe Int64)
5731+mdOfferRevisionNumber
5732+ = lens _mdOfferRevisionNumber
5733+ (\ s a -> s{_mdOfferRevisionNumber = a})
5734+
5735+-- | The time (ms since epoch) when the deal was last updated. (readonly)
5736+mdLastUpdateTimeMs :: Lens' MarketplaceDeal (Maybe Int64)
5737+mdLastUpdateTimeMs
5738+ = lens _mdLastUpdateTimeMs
5739+ (\ s a -> s{_mdLastUpdateTimeMs = a})
5740+
5741+-- | Identifies what kind of resource this is. Value: the fixed string
5742+-- \"adexchangebuyer#marketplaceDeal\".
5743+mdKind :: Lens' MarketplaceDeal Text
5744+mdKind = lens _mdKind (\ s a -> s{_mdKind = a})
5745+
5746+-- | The set of fields around delivery control that are interesting for a
5747+-- buyer to see but are non-negotiable. These are set by the publisher.
5748+-- This message is assigned an id of 100 since some day we would want to
5749+-- model this as a protobuf extension.
5750+mdDeliveryControl :: Lens' MarketplaceDeal (Maybe (Maybe DeliveryControl))
5751+mdDeliveryControl
5752+ = lens _mdDeliveryControl
5753+ (\ s a -> s{_mdDeliveryControl = a})
5754+
5755+-- | Proposed flight start time of the deal (ms since epoch) This will
5756+-- generally be stored in a granularity of a second. (updatable)
5757+mdFlightStartTimeMs :: Lens' MarketplaceDeal (Maybe Int64)
5758+mdFlightStartTimeMs
5759+ = lens _mdFlightStartTimeMs
5760+ (\ s a -> s{_mdFlightStartTimeMs = a})
5761+
5762+-- | The shared targeting visible to buyers and sellers. (updatable)
5763+mdSharedTargetings :: Lens' MarketplaceDeal [Maybe SharedTargeting]
5764+mdSharedTargetings
5765+ = lens _mdSharedTargetings
5766+ (\ s a -> s{_mdSharedTargetings = a})
5767+ . _Default
5768+ . _Coerce
5769+
5770+-- | A unique deal=id for the deal (readonly).
5771+mdDealId :: Lens' MarketplaceDeal (Maybe Text)
5772+mdDealId = lens _mdDealId (\ s a -> s{_mdDealId = a})
5773+
5774+-- | Description for the deal terms. (updatable)
5775+mdInventoryDescription :: Lens' MarketplaceDeal (Maybe Text)
5776+mdInventoryDescription
5777+ = lens _mdInventoryDescription
5778+ (\ s a -> s{_mdInventoryDescription = a})
5779+
5780+-- | The syndication product associated with the deal. (readonly, except on
5781+-- create)
5782+mdSyndicationProduct :: Lens' MarketplaceDeal (Maybe Text)
5783+mdSyndicationProduct
5784+ = lens _mdSyndicationProduct
5785+ (\ s a -> s{_mdSyndicationProduct = a})
5786+
5787+-- | Proposed flight end time of the deal (ms since epoch) This will
5788+-- generally be stored in a granularity of a second. (updatable)
5789+mdFlightEndTimeMs :: Lens' MarketplaceDeal (Maybe Int64)
5790+mdFlightEndTimeMs
5791+ = lens _mdFlightEndTimeMs
5792+ (\ s a -> s{_mdFlightEndTimeMs = a})
5793+
5794+-- | The name of the deal. (updatable)
5795+mdName :: Lens' MarketplaceDeal (Maybe Text)
5796+mdName = lens _mdName (\ s a -> s{_mdName = a})
5797+
5798+-- | Optional Seller contact information for the deal (buyer-readonly)
5799+mdSellerContacts :: Lens' MarketplaceDeal [Maybe ContactInformation]
5800+mdSellerContacts
5801+ = lens _mdSellerContacts
5802+ (\ s a -> s{_mdSellerContacts = a})
5803+ . _Default
5804+ . _Coerce
5805+
5806+-- | The offer-id from which this deal was created. (readonly, except on
5807+-- create)
5808+mdOfferId :: Lens' MarketplaceDeal (Maybe Text)
5809+mdOfferId
5810+ = lens _mdOfferId (\ s a -> s{_mdOfferId = a})
5811+
5812+mdOrderId :: Lens' MarketplaceDeal (Maybe Text)
5813+mdOrderId
5814+ = lens _mdOrderId (\ s a -> s{_mdOrderId = a})
5815+
5816+instance FromJSON MarketplaceDeal where
5817+ parseJSON
5818+ = withObject "MarketplaceDeal"
5819+ (\ o ->
5820+ MarketplaceDeal <$>
5821+ (o .:? "externalDealId") <*>
5822+ (o .:? "buyerPrivateData")
5823+ <*> (o .:? "webPropertyCode")
5824+ <*> (o .:? "creationTimeMs")
5825+ <*> (o .:? "terms")
5826+ <*> (o .:? "offerRevisionNumber")
5827+ <*> (o .:? "lastUpdateTimeMs")
5828+ <*>
5829+ (o .:? "kind" .!= "adexchangebuyer#marketplaceDeal")
5830+ <*> (o .:? "deliveryControl")
5831+ <*> (o .:? "flightStartTimeMs")
5832+ <*> (o .:? "sharedTargetings" .!= mempty)
5833+ <*> (o .:? "dealId")
5834+ <*> (o .:? "inventoryDescription")
5835+ <*> (o .:? "syndicationProduct")
5836+ <*> (o .:? "flightEndTimeMs")
5837+ <*> (o .:? "name")
5838+ <*> (o .:? "sellerContacts" .!= mempty)
5839+ <*> (o .:? "offerId")
5840+ <*> (o .:? "orderId"))
5841+
5842+instance ToJSON MarketplaceDeal where
5843+ toJSON MarketplaceDeal{..}
5844+ = object
5845+ (catMaybes
5846+ [("externalDealId" .=) <$> _mdExternalDealId,
5847+ ("buyerPrivateData" .=) <$> _mdBuyerPrivateData,
5848+ ("webPropertyCode" .=) <$> _mdWebPropertyCode,
5849+ ("creationTimeMs" .=) <$> _mdCreationTimeMs,
5850+ ("terms" .=) <$> _mdTerms,
5851+ ("offerRevisionNumber" .=) <$>
5852+ _mdOfferRevisionNumber,
5853+ ("lastUpdateTimeMs" .=) <$> _mdLastUpdateTimeMs,
5854+ Just ("kind" .= _mdKind),
5855+ ("deliveryControl" .=) <$> _mdDeliveryControl,
5856+ ("flightStartTimeMs" .=) <$> _mdFlightStartTimeMs,
5857+ ("sharedTargetings" .=) <$> _mdSharedTargetings,
5858+ ("dealId" .=) <$> _mdDealId,
5859+ ("inventoryDescription" .=) <$>
5860+ _mdInventoryDescription,
5861+ ("syndicationProduct" .=) <$> _mdSyndicationProduct,
5862+ ("flightEndTimeMs" .=) <$> _mdFlightEndTimeMs,
5863+ ("name" .=) <$> _mdName,
5864+ ("sellerContacts" .=) <$> _mdSellerContacts,
5865+ ("offerId" .=) <$> _mdOfferId,
5866+ ("orderId" .=) <$> _mdOrderId])
5867+
5868+--
5869+-- /See:/ 'negotiationRoundDto' smart constructor.
5870+data NegotiationRoundDto = NegotiationRoundDto
5871+ { _nrdTerms :: !(Maybe (Maybe TermsDto))
5872+ , _nrdKind :: !Text
5873+ , _nrdOriginatorRole :: !(Maybe Text)
5874+ , _nrdAction :: !(Maybe Text)
5875+ , _nrdDbmPartnerId :: !(Maybe Int64)
5876+ , _nrdNotes :: !(Maybe Text)
5877+ , _nrdNegotiationId :: !(Maybe Int64)
5878+ , _nrdEditHistory :: !(Maybe (Maybe EditHistoryDto))
5879+ , _nrdRoundNumber :: !(Maybe Int64)
5880+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
5881+
5882+-- | Creates a value of 'NegotiationRoundDto' with the minimum fields required to make a request.
5883+--
5884+-- Use one of the following lenses to modify other fields as desired:
5885+--
5886+-- * 'nrdTerms'
5887+--
5888+-- * 'nrdKind'
5889+--
5890+-- * 'nrdOriginatorRole'
5891+--
5892+-- * 'nrdAction'
5893+--
5894+-- * 'nrdDbmPartnerId'
5895+--
5896+-- * 'nrdNotes'
5897+--
5898+-- * 'nrdNegotiationId'
5899+--
5900+-- * 'nrdEditHistory'
5901+--
5902+-- * 'nrdRoundNumber'
5903+negotiationRoundDto
5904+ :: NegotiationRoundDto
5905+negotiationRoundDto =
5906+ NegotiationRoundDto
5907+ { _nrdTerms = Nothing
5908+ , _nrdKind = "adexchangebuyer#negotiationRound"
5909+ , _nrdOriginatorRole = Nothing
5910+ , _nrdAction = Nothing
5911+ , _nrdDbmPartnerId = Nothing
5912+ , _nrdNotes = Nothing
5913+ , _nrdNegotiationId = Nothing
5914+ , _nrdEditHistory = Nothing
5915+ , _nrdRoundNumber = Nothing
5916+ }
5917+
5918+-- | The detailed terms proposed in this negotiation round.
5919+nrdTerms :: Lens' NegotiationRoundDto (Maybe (Maybe TermsDto))
5920+nrdTerms = lens _nrdTerms (\ s a -> s{_nrdTerms = a})
5921+
5922+nrdKind :: Lens' NegotiationRoundDto Text
5923+nrdKind = lens _nrdKind (\ s a -> s{_nrdKind = a})
5924+
5925+-- | The role, either buyer or seller, initiating this negotiation round.
5926+nrdOriginatorRole :: Lens' NegotiationRoundDto (Maybe Text)
5927+nrdOriginatorRole
5928+ = lens _nrdOriginatorRole
5929+ (\ s a -> s{_nrdOriginatorRole = a})
5930+
5931+-- | The action performed by this negotiation round.
5932+nrdAction :: Lens' NegotiationRoundDto (Maybe Text)
5933+nrdAction
5934+ = lens _nrdAction (\ s a -> s{_nrdAction = a})
5935+
5936+-- | Stores DBM partner ID for use by DBM
5937+nrdDbmPartnerId :: Lens' NegotiationRoundDto (Maybe Int64)
5938+nrdDbmPartnerId
5939+ = lens _nrdDbmPartnerId
5940+ (\ s a -> s{_nrdDbmPartnerId = a})
5941+
5942+-- | Notes regarding this negotiation round.
5943+nrdNotes :: Lens' NegotiationRoundDto (Maybe Text)
5944+nrdNotes = lens _nrdNotes (\ s a -> s{_nrdNotes = a})
5945+
5946+-- | The ID of the negotiation to which this negotiation round applies.
5947+nrdNegotiationId :: Lens' NegotiationRoundDto (Maybe Int64)
5948+nrdNegotiationId
5949+ = lens _nrdNegotiationId
5950+ (\ s a -> s{_nrdNegotiationId = a})
5951+
5952+-- | The edit history of this negotiation round.
5953+nrdEditHistory :: Lens' NegotiationRoundDto (Maybe (Maybe EditHistoryDto))
5954+nrdEditHistory
5955+ = lens _nrdEditHistory
5956+ (\ s a -> s{_nrdEditHistory = a})
5957+
5958+-- | The number of this negotiation round, in sequence.
5959+nrdRoundNumber :: Lens' NegotiationRoundDto (Maybe Int64)
5960+nrdRoundNumber
5961+ = lens _nrdRoundNumber
5962+ (\ s a -> s{_nrdRoundNumber = a})
5963+
5964+instance FromJSON NegotiationRoundDto where
5965+ parseJSON
5966+ = withObject "NegotiationRoundDto"
5967+ (\ o ->
5968+ NegotiationRoundDto <$>
5969+ (o .:? "terms") <*>
5970+ (o .:? "kind" .!= "adexchangebuyer#negotiationRound")
5971+ <*> (o .:? "originatorRole")
5972+ <*> (o .:? "action")
5973+ <*> (o .:? "dbmPartnerId")
5974+ <*> (o .:? "notes")
5975+ <*> (o .:? "negotiationId")
5976+ <*> (o .:? "editHistory")
5977+ <*> (o .:? "roundNumber"))
5978+
5979+instance ToJSON NegotiationRoundDto where
5980+ toJSON NegotiationRoundDto{..}
5981+ = object
5982+ (catMaybes
5983+ [("terms" .=) <$> _nrdTerms,
5984+ Just ("kind" .= _nrdKind),
5985+ ("originatorRole" .=) <$> _nrdOriginatorRole,
5986+ ("action" .=) <$> _nrdAction,
5987+ ("dbmPartnerId" .=) <$> _nrdDbmPartnerId,
5988+ ("notes" .=) <$> _nrdNotes,
5989+ ("negotiationId" .=) <$> _nrdNegotiationId,
5990+ ("editHistory" .=) <$> _nrdEditHistory,
5991+ ("roundNumber" .=) <$> _nrdRoundNumber])
5992+
5993+--
5994+-- /See:/ 'statsDto' smart constructor.
5995+data StatsDto = StatsDto
5996+ { _sdBids :: !(Maybe Int64)
5997+ , _sdSpend :: !(Maybe (Maybe MoneyDto))
5998+ , _sdImpressions :: !(Maybe Int64)
5999+ , _sdGoodBids :: !(Maybe Int64)
6000+ , _sdRevenue :: !(Maybe (Maybe MoneyDto))
6001+ , _sdRequests :: !(Maybe Int64)
6002+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6003+
6004+-- | Creates a value of 'StatsDto' with the minimum fields required to make a request.
6005+--
6006+-- Use one of the following lenses to modify other fields as desired:
6007+--
6008+-- * 'sdBids'
6009+--
6010+-- * 'sdSpend'
6011+--
6012+-- * 'sdImpressions'
6013+--
6014+-- * 'sdGoodBids'
6015+--
6016+-- * 'sdRevenue'
6017+--
6018+-- * 'sdRequests'
6019+statsDto
6020+ :: StatsDto
6021+statsDto =
6022+ StatsDto
6023+ { _sdBids = Nothing
6024+ , _sdSpend = Nothing
6025+ , _sdImpressions = Nothing
6026+ , _sdGoodBids = Nothing
6027+ , _sdRevenue = Nothing
6028+ , _sdRequests = Nothing
6029+ }
6030+
6031+sdBids :: Lens' StatsDto (Maybe Int64)
6032+sdBids = lens _sdBids (\ s a -> s{_sdBids = a})
6033+
6034+sdSpend :: Lens' StatsDto (Maybe (Maybe MoneyDto))
6035+sdSpend = lens _sdSpend (\ s a -> s{_sdSpend = a})
6036+
6037+sdImpressions :: Lens' StatsDto (Maybe Int64)
6038+sdImpressions
6039+ = lens _sdImpressions
6040+ (\ s a -> s{_sdImpressions = a})
6041+
6042+sdGoodBids :: Lens' StatsDto (Maybe Int64)
6043+sdGoodBids
6044+ = lens _sdGoodBids (\ s a -> s{_sdGoodBids = a})
6045+
6046+sdRevenue :: Lens' StatsDto (Maybe (Maybe MoneyDto))
6047+sdRevenue
6048+ = lens _sdRevenue (\ s a -> s{_sdRevenue = a})
6049+
6050+sdRequests :: Lens' StatsDto (Maybe Int64)
6051+sdRequests
6052+ = lens _sdRequests (\ s a -> s{_sdRequests = a})
6053+
6054+instance FromJSON StatsDto where
6055+ parseJSON
6056+ = withObject "StatsDto"
6057+ (\ o ->
6058+ StatsDto <$>
6059+ (o .:? "bids") <*> (o .:? "spend") <*>
6060+ (o .:? "impressions")
6061+ <*> (o .:? "goodBids")
6062+ <*> (o .:? "revenue")
6063+ <*> (o .:? "requests"))
6064+
6065+instance ToJSON StatsDto where
6066+ toJSON StatsDto{..}
6067+ = object
6068+ (catMaybes
6069+ [("bids" .=) <$> _sdBids, ("spend" .=) <$> _sdSpend,
6070+ ("impressions" .=) <$> _sdImpressions,
6071+ ("goodBids" .=) <$> _sdGoodBids,
6072+ ("revenue" .=) <$> _sdRevenue,
6073+ ("requests" .=) <$> _sdRequests])
6074+
6075+--
6076+-- /See:/ 'getOffersResponse' smart constructor.
6077+newtype GetOffersResponse = GetOffersResponse
6078+ { _gorOffers :: Maybe [Maybe MarketplaceOffer]
6079+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6080+
6081+-- | Creates a value of 'GetOffersResponse' with the minimum fields required to make a request.
6082+--
6083+-- Use one of the following lenses to modify other fields as desired:
6084+--
6085+-- * 'gorOffers'
6086+getOffersResponse
6087+ :: GetOffersResponse
6088+getOffersResponse =
6089+ GetOffersResponse
6090+ { _gorOffers = Nothing
6091+ }
6092+
6093+-- | The returned list of offers.
6094+gorOffers :: Lens' GetOffersResponse [Maybe MarketplaceOffer]
6095+gorOffers
6096+ = lens _gorOffers (\ s a -> s{_gorOffers = a}) .
6097+ _Default
6098+ . _Coerce
6099+
6100+instance FromJSON GetOffersResponse where
6101+ parseJSON
6102+ = withObject "GetOffersResponse"
6103+ (\ o ->
6104+ GetOffersResponse <$> (o .:? "offers" .!= mempty))
6105+
6106+instance ToJSON GetOffersResponse where
6107+ toJSON GetOffersResponse{..}
6108+ = object (catMaybes [("offers" .=) <$> _gorOffers])
6109+
6110+--
6111+-- /See:/ 'dealTermsNonGuaranteedAuctionTerms' smart constructor.
6112+data DealTermsNonGuaranteedAuctionTerms = DealTermsNonGuaranteedAuctionTerms
6113+ { _dtngatReservePricePerBuyers :: !(Maybe [Maybe PricePerBuyer])
6114+ , _dtngatPrivateAuctionId :: !(Maybe Text)
6115+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6116+
6117+-- | Creates a value of 'DealTermsNonGuaranteedAuctionTerms' with the minimum fields required to make a request.
6118+--
6119+-- Use one of the following lenses to modify other fields as desired:
6120+--
6121+-- * 'dtngatReservePricePerBuyers'
6122+--
6123+-- * 'dtngatPrivateAuctionId'
6124+dealTermsNonGuaranteedAuctionTerms
6125+ :: DealTermsNonGuaranteedAuctionTerms
6126+dealTermsNonGuaranteedAuctionTerms =
6127+ DealTermsNonGuaranteedAuctionTerms
6128+ { _dtngatReservePricePerBuyers = Nothing
6129+ , _dtngatPrivateAuctionId = Nothing
6130+ }
6131+
6132+-- | Reserve price for the specified buyer.
6133+dtngatReservePricePerBuyers :: Lens' DealTermsNonGuaranteedAuctionTerms [Maybe PricePerBuyer]
6134+dtngatReservePricePerBuyers
6135+ = lens _dtngatReservePricePerBuyers
6136+ (\ s a -> s{_dtngatReservePricePerBuyers = a})
6137+ . _Default
6138+ . _Coerce
6139+
6140+-- | Id of the corresponding private auction.
6141+dtngatPrivateAuctionId :: Lens' DealTermsNonGuaranteedAuctionTerms (Maybe Text)
6142+dtngatPrivateAuctionId
6143+ = lens _dtngatPrivateAuctionId
6144+ (\ s a -> s{_dtngatPrivateAuctionId = a})
6145+
6146+instance FromJSON DealTermsNonGuaranteedAuctionTerms
6147+ where
6148+ parseJSON
6149+ = withObject "DealTermsNonGuaranteedAuctionTerms"
6150+ (\ o ->
6151+ DealTermsNonGuaranteedAuctionTerms <$>
6152+ (o .:? "reservePricePerBuyers" .!= mempty) <*>
6153+ (o .:? "privateAuctionId"))
6154+
6155+instance ToJSON DealTermsNonGuaranteedAuctionTerms
6156+ where
6157+ toJSON DealTermsNonGuaranteedAuctionTerms{..}
6158+ = object
6159+ (catMaybes
6160+ [("reservePricePerBuyers" .=) <$>
6161+ _dtngatReservePricePerBuyers,
6162+ ("privateAuctionId" .=) <$> _dtngatPrivateAuctionId])
6163+
6164+--
6165+-- /See:/ 'buyer' smart constructor.
6166+newtype Buyer = Buyer
6167+ { _bbAccountId :: Maybe Text
6168+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6169+
6170+-- | Creates a value of 'Buyer' with the minimum fields required to make a request.
6171+--
6172+-- Use one of the following lenses to modify other fields as desired:
6173+--
6174+-- * 'bbAccountId'
6175+buyer
6176+ :: Buyer
6177+buyer =
6178+ Buyer
6179+ { _bbAccountId = Nothing
6180+ }
6181+
6182+-- | Adx account id of the buyer.
6183+bbAccountId :: Lens' Buyer (Maybe Text)
6184+bbAccountId
6185+ = lens _bbAccountId (\ s a -> s{_bbAccountId = a})
6186+
6187+instance FromJSON Buyer where
6188+ parseJSON
6189+ = withObject "Buyer"
6190+ (\ o -> Buyer <$> (o .:? "accountId"))
6191+
6192+instance ToJSON Buyer where
6193+ toJSON Buyer{..}
6194+ = object
6195+ (catMaybes [("accountId" .=) <$> _bbAccountId])
6196+
6197+--
6198+-- /See:/ 'marketplaceLabel' smart constructor.
6199+data MarketplaceLabel = MarketplaceLabel
6200+ { _mlDeprecatedMarketplaceDealParty :: !(Maybe (Maybe MarketplaceDealParty))
6201+ , _mlAccountId :: !(Maybe Text)
6202+ , _mlCreateTimeMs :: !(Maybe Int64)
6203+ , _mlLabel :: !(Maybe Text)
6204+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6205+
6206+-- | Creates a value of 'MarketplaceLabel' with the minimum fields required to make a request.
6207+--
6208+-- Use one of the following lenses to modify other fields as desired:
6209+--
6210+-- * 'mlDeprecatedMarketplaceDealParty'
6211+--
6212+-- * 'mlAccountId'
6213+--
6214+-- * 'mlCreateTimeMs'
6215+--
6216+-- * 'mlLabel'
6217+marketplaceLabel
6218+ :: MarketplaceLabel
6219+marketplaceLabel =
6220+ MarketplaceLabel
6221+ { _mlDeprecatedMarketplaceDealParty = Nothing
6222+ , _mlAccountId = Nothing
6223+ , _mlCreateTimeMs = Nothing
6224+ , _mlLabel = Nothing
6225+ }
6226+
6227+-- | Information about the party that created the label.
6228+mlDeprecatedMarketplaceDealParty :: Lens' MarketplaceLabel (Maybe (Maybe MarketplaceDealParty))
6229+mlDeprecatedMarketplaceDealParty
6230+ = lens _mlDeprecatedMarketplaceDealParty
6231+ (\ s a -> s{_mlDeprecatedMarketplaceDealParty = a})
6232+
6233+-- | The accountId of the party that created the label.
6234+mlAccountId :: Lens' MarketplaceLabel (Maybe Text)
6235+mlAccountId
6236+ = lens _mlAccountId (\ s a -> s{_mlAccountId = a})
6237+
6238+-- | The creation time (in ms since epoch) for the label.
6239+mlCreateTimeMs :: Lens' MarketplaceLabel (Maybe Int64)
6240+mlCreateTimeMs
6241+ = lens _mlCreateTimeMs
6242+ (\ s a -> s{_mlCreateTimeMs = a})
6243+
6244+-- | The label to use.
6245+mlLabel :: Lens' MarketplaceLabel (Maybe Text)
6246+mlLabel = lens _mlLabel (\ s a -> s{_mlLabel = a})
6247+
6248+instance FromJSON MarketplaceLabel where
6249+ parseJSON
6250+ = withObject "MarketplaceLabel"
6251+ (\ o ->
6252+ MarketplaceLabel <$>
6253+ (o .:? "deprecatedMarketplaceDealParty") <*>
6254+ (o .:? "accountId")
6255+ <*> (o .:? "createTimeMs")
6256+ <*> (o .:? "label"))
6257+
6258+instance ToJSON MarketplaceLabel where
6259+ toJSON MarketplaceLabel{..}
6260+ = object
6261+ (catMaybes
6262+ [("deprecatedMarketplaceDealParty" .=) <$>
6263+ _mlDeprecatedMarketplaceDealParty,
6264+ ("accountId" .=) <$> _mlAccountId,
6265+ ("createTimeMs" .=) <$> _mlCreateTimeMs,
6266+ ("label" .=) <$> _mlLabel])
6267+
6268+--
6269+-- /See:/ 'dateTime' smart constructor.
6270+data DateTime = DateTime
6271+ { _dtSecond :: !(Maybe Int32)
6272+ , _dtDay :: !(Maybe Int32)
6273+ , _dtYear :: !(Maybe Int32)
6274+ , _dtHour :: !(Maybe Int32)
6275+ , _dtMonth :: !(Maybe Int32)
6276+ , _dtMinute :: !(Maybe Int32)
6277+ , _dtTimeZoneId :: !(Maybe Text)
6278+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6279+
6280+-- | Creates a value of 'DateTime' with the minimum fields required to make a request.
6281+--
6282+-- Use one of the following lenses to modify other fields as desired:
6283+--
6284+-- * 'dtSecond'
6285+--
6286+-- * 'dtDay'
6287+--
6288+-- * 'dtYear'
6289+--
6290+-- * 'dtHour'
6291+--
6292+-- * 'dtMonth'
6293+--
6294+-- * 'dtMinute'
6295+--
6296+-- * 'dtTimeZoneId'
6297+dateTime
6298+ :: DateTime
6299+dateTime =
6300+ DateTime
6301+ { _dtSecond = Nothing
6302+ , _dtDay = Nothing
6303+ , _dtYear = Nothing
6304+ , _dtHour = Nothing
6305+ , _dtMonth = Nothing
6306+ , _dtMinute = Nothing
6307+ , _dtTimeZoneId = Nothing
6308+ }
6309+
6310+dtSecond :: Lens' DateTime (Maybe Int32)
6311+dtSecond = lens _dtSecond (\ s a -> s{_dtSecond = a})
6312+
6313+dtDay :: Lens' DateTime (Maybe Int32)
6314+dtDay = lens _dtDay (\ s a -> s{_dtDay = a})
6315+
6316+dtYear :: Lens' DateTime (Maybe Int32)
6317+dtYear = lens _dtYear (\ s a -> s{_dtYear = a})
6318+
6319+dtHour :: Lens' DateTime (Maybe Int32)
6320+dtHour = lens _dtHour (\ s a -> s{_dtHour = a})
6321+
6322+dtMonth :: Lens' DateTime (Maybe Int32)
6323+dtMonth = lens _dtMonth (\ s a -> s{_dtMonth = a})
6324+
6325+dtMinute :: Lens' DateTime (Maybe Int32)
6326+dtMinute = lens _dtMinute (\ s a -> s{_dtMinute = a})
6327+
6328+dtTimeZoneId :: Lens' DateTime (Maybe Text)
6329+dtTimeZoneId
6330+ = lens _dtTimeZoneId (\ s a -> s{_dtTimeZoneId = a})
6331+
6332+instance FromJSON DateTime where
6333+ parseJSON
6334+ = withObject "DateTime"
6335+ (\ o ->
6336+ DateTime <$>
6337+ (o .:? "second") <*> (o .:? "day") <*> (o .:? "year")
6338+ <*> (o .:? "hour")
6339+ <*> (o .:? "month")
6340+ <*> (o .:? "minute")
6341+ <*> (o .:? "timeZoneId"))
6342+
6343+instance ToJSON DateTime where
6344+ toJSON DateTime{..}
6345+ = object
6346+ (catMaybes
6347+ [("second" .=) <$> _dtSecond, ("day" .=) <$> _dtDay,
6348+ ("year" .=) <$> _dtYear, ("hour" .=) <$> _dtHour,
6349+ ("month" .=) <$> _dtMonth,
6350+ ("minute" .=) <$> _dtMinute,
6351+ ("timeZoneId" .=) <$> _dtTimeZoneId])
6352+
6353+--
6354+-- /See:/ 'dealTermsGuaranteedFixedPriceTerms' smart constructor.
6355+data DealTermsGuaranteedFixedPriceTerms = DealTermsGuaranteedFixedPriceTerms
6356+ { _dtgfptGuaranteedLooks :: !(Maybe Int64)
6357+ , _dtgfptGuaranteedImpressions :: !(Maybe Int64)
6358+ , _dtgfptFixedPrices :: !(Maybe [Maybe PricePerBuyer])
6359+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6360+
6361+-- | Creates a value of 'DealTermsGuaranteedFixedPriceTerms' with the minimum fields required to make a request.
6362+--
6363+-- Use one of the following lenses to modify other fields as desired:
6364+--
6365+-- * 'dtgfptGuaranteedLooks'
6366+--
6367+-- * 'dtgfptGuaranteedImpressions'
6368+--
6369+-- * 'dtgfptFixedPrices'
6370+dealTermsGuaranteedFixedPriceTerms
6371+ :: DealTermsGuaranteedFixedPriceTerms
6372+dealTermsGuaranteedFixedPriceTerms =
6373+ DealTermsGuaranteedFixedPriceTerms
6374+ { _dtgfptGuaranteedLooks = Nothing
6375+ , _dtgfptGuaranteedImpressions = Nothing
6376+ , _dtgfptFixedPrices = Nothing
6377+ }
6378+
6379+-- | Count of guaranteed looks. Required for deal, optional for offer.
6380+dtgfptGuaranteedLooks :: Lens' DealTermsGuaranteedFixedPriceTerms (Maybe Int64)
6381+dtgfptGuaranteedLooks
6382+ = lens _dtgfptGuaranteedLooks
6383+ (\ s a -> s{_dtgfptGuaranteedLooks = a})
6384+
6385+-- | Guaranteed impressions as a percentage. This is the percentage of
6386+-- guaranteed looks that the buyer is guaranteeing to buy.
6387+dtgfptGuaranteedImpressions :: Lens' DealTermsGuaranteedFixedPriceTerms (Maybe Int64)
6388+dtgfptGuaranteedImpressions
6389+ = lens _dtgfptGuaranteedImpressions
6390+ (\ s a -> s{_dtgfptGuaranteedImpressions = a})
6391+
6392+-- | Fixed price for the specified buyer.
6393+dtgfptFixedPrices :: Lens' DealTermsGuaranteedFixedPriceTerms [Maybe PricePerBuyer]
6394+dtgfptFixedPrices
6395+ = lens _dtgfptFixedPrices
6396+ (\ s a -> s{_dtgfptFixedPrices = a})
6397+ . _Default
6398+ . _Coerce
6399+
6400+instance FromJSON DealTermsGuaranteedFixedPriceTerms
6401+ where
6402+ parseJSON
6403+ = withObject "DealTermsGuaranteedFixedPriceTerms"
6404+ (\ o ->
6405+ DealTermsGuaranteedFixedPriceTerms <$>
6406+ (o .:? "guaranteedLooks") <*>
6407+ (o .:? "guaranteedImpressions")
6408+ <*> (o .:? "fixedPrices" .!= mempty))
6409+
6410+instance ToJSON DealTermsGuaranteedFixedPriceTerms
6411+ where
6412+ toJSON DealTermsGuaranteedFixedPriceTerms{..}
6413+ = object
6414+ (catMaybes
6415+ [("guaranteedLooks" .=) <$> _dtgfptGuaranteedLooks,
6416+ ("guaranteedImpressions" .=) <$>
6417+ _dtgfptGuaranteedImpressions,
6418+ ("fixedPrices" .=) <$> _dtgfptFixedPrices])
6419+
6420+-- | Represents an order in the marketplace. An order is the unit of
6421+-- negotiation between a seller and a buyer and contains deals which are
6422+-- served. Each field in an order can have one of the following setting:
6423+-- (readonly) - It is an error to try and set this field. (buyer-readonly)
6424+-- - Only the seller can set this field. (seller-readonly) - Only the buyer
6425+-- can set this field. (updatable) - The field is updatable at all times by
6426+-- either buyer or the seller.
6427+--
6428+-- /See:/ 'marketplaceOrder' smart constructor.
6429+data MarketplaceOrder = MarketplaceOrder
6430+ { _mBuyerPrivateData :: !(Maybe (Maybe PrivateData))
6431+ , _mIsSetupComplete :: !(Maybe Bool)
6432+ , _mBuyerContacts :: !(Maybe [Maybe ContactInformation])
6433+ , _mKind :: !Text
6434+ , _mOriginatorRole :: !(Maybe Text)
6435+ , _mRevisionNumber :: !(Maybe Int64)
6436+ , _mBilledBuyer :: !(Maybe (Maybe Buyer))
6437+ , _mIsRenegotiating :: !(Maybe Bool)
6438+ , _mHasSellerSignedOff :: !(Maybe Bool)
6439+ , _mSeller :: !(Maybe (Maybe Seller))
6440+ , _mOrderState :: !(Maybe Text)
6441+ , _mName :: !(Maybe Text)
6442+ , _mSellerContacts :: !(Maybe [Maybe ContactInformation])
6443+ , _mLastUpdaterRole :: !(Maybe Text)
6444+ , _mLabels :: !(Maybe [Maybe MarketplaceLabel])
6445+ , _mRevisionTimeMs :: !(Maybe Int64)
6446+ , _mOrderId :: !(Maybe Text)
6447+ , _mLastUpdaterOrCommentorRole :: !(Maybe Text)
6448+ , _mHasBuyerSignedOff :: !(Maybe Bool)
6449+ , _mBuyer :: !(Maybe (Maybe Buyer))
6450+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6451+
6452+-- | Creates a value of 'MarketplaceOrder' with the minimum fields required to make a request.
6453+--
6454+-- Use one of the following lenses to modify other fields as desired:
6455+--
6456+-- * 'mBuyerPrivateData'
6457+--
6458+-- * 'mIsSetupComplete'
6459+--
6460+-- * 'mBuyerContacts'
6461+--
6462+-- * 'mKind'
6463+--
6464+-- * 'mOriginatorRole'
6465+--
6466+-- * 'mRevisionNumber'
6467+--
6468+-- * 'mBilledBuyer'
6469+--
6470+-- * 'mIsRenegotiating'
6471+--
6472+-- * 'mHasSellerSignedOff'
6473+--
6474+-- * 'mSeller'
6475+--
6476+-- * 'mOrderState'
6477+--
6478+-- * 'mName'
6479+--
6480+-- * 'mSellerContacts'
6481+--
6482+-- * 'mLastUpdaterRole'
6483+--
6484+-- * 'mLabels'
6485+--
6486+-- * 'mRevisionTimeMs'
6487+--
6488+-- * 'mOrderId'
6489+--
6490+-- * 'mLastUpdaterOrCommentorRole'
6491+--
6492+-- * 'mHasBuyerSignedOff'
6493+--
6494+-- * 'mBuyer'
6495+marketplaceOrder
6496+ :: MarketplaceOrder
6497+marketplaceOrder =
6498+ MarketplaceOrder
6499+ { _mBuyerPrivateData = Nothing
6500+ , _mIsSetupComplete = Nothing
6501+ , _mBuyerContacts = Nothing
6502+ , _mKind = "adexchangebuyer#marketplaceOrder"
6503+ , _mOriginatorRole = Nothing
6504+ , _mRevisionNumber = Nothing
6505+ , _mBilledBuyer = Nothing
6506+ , _mIsRenegotiating = Nothing
6507+ , _mHasSellerSignedOff = Nothing
6508+ , _mSeller = Nothing
6509+ , _mOrderState = Nothing
6510+ , _mName = Nothing
6511+ , _mSellerContacts = Nothing
6512+ , _mLastUpdaterRole = Nothing
6513+ , _mLabels = Nothing
6514+ , _mRevisionTimeMs = Nothing
6515+ , _mOrderId = Nothing
6516+ , _mLastUpdaterOrCommentorRole = Nothing
6517+ , _mHasBuyerSignedOff = Nothing
6518+ , _mBuyer = Nothing
6519+ }
6520+
6521+-- | Private data for buyer. (hidden from seller).
6522+mBuyerPrivateData :: Lens' MarketplaceOrder (Maybe (Maybe PrivateData))
6523+mBuyerPrivateData
6524+ = lens _mBuyerPrivateData
6525+ (\ s a -> s{_mBuyerPrivateData = a})
6526+
6527+-- | True, if the buyside inventory setup is complete for this order.
6528+-- (readonly)
6529+mIsSetupComplete :: Lens' MarketplaceOrder (Maybe Bool)
6530+mIsSetupComplete
6531+ = lens _mIsSetupComplete
6532+ (\ s a -> s{_mIsSetupComplete = a})
6533+
6534+-- | Optional contact information fort the buyer. (seller-readonly)
6535+mBuyerContacts :: Lens' MarketplaceOrder [Maybe ContactInformation]
6536+mBuyerContacts
6537+ = lens _mBuyerContacts
6538+ (\ s a -> s{_mBuyerContacts = a})
6539+ . _Default
6540+ . _Coerce
6541+
6542+-- | Identifies what kind of resource this is. Value: the fixed string
6543+-- \"adexchangebuyer#marketplaceOrder\".
6544+mKind :: Lens' MarketplaceOrder Text
6545+mKind = lens _mKind (\ s a -> s{_mKind = a})
6546+
6547+-- | Indicates whether the buyer\/seller created the offer.(readonly)
6548+mOriginatorRole :: Lens' MarketplaceOrder (Maybe Text)
6549+mOriginatorRole
6550+ = lens _mOriginatorRole
6551+ (\ s a -> s{_mOriginatorRole = a})
6552+
6553+-- | The revision number for the order (readonly).
6554+mRevisionNumber :: Lens' MarketplaceOrder (Maybe Int64)
6555+mRevisionNumber
6556+ = lens _mRevisionNumber
6557+ (\ s a -> s{_mRevisionNumber = a})
6558+
6559+-- | Reference to the buyer that will get billed for this order. (readonly)
6560+mBilledBuyer :: Lens' MarketplaceOrder (Maybe (Maybe Buyer))
6561+mBilledBuyer
6562+ = lens _mBilledBuyer (\ s a -> s{_mBilledBuyer = a})
6563+
6564+-- | True if the order is being renegotiated (readonly).
6565+mIsRenegotiating :: Lens' MarketplaceOrder (Maybe Bool)
6566+mIsRenegotiating
6567+ = lens _mIsRenegotiating
6568+ (\ s a -> s{_mIsRenegotiating = a})
6569+
6570+-- | When an order is in an accepted state, indicates whether the buyer has
6571+-- signed off Once both sides have signed off on a deal, the order can be
6572+-- finalized by the seller. (buyer-readonly)
6573+mHasSellerSignedOff :: Lens' MarketplaceOrder (Maybe Bool)
6574+mHasSellerSignedOff
6575+ = lens _mHasSellerSignedOff
6576+ (\ s a -> s{_mHasSellerSignedOff = a})
6577+
6578+-- | Reference to the seller on the order. (readonly, except on create)
6579+mSeller :: Lens' MarketplaceOrder (Maybe (Maybe Seller))
6580+mSeller = lens _mSeller (\ s a -> s{_mSeller = a})
6581+
6582+-- | The current state of the order. (readonly)
6583+mOrderState :: Lens' MarketplaceOrder (Maybe Text)
6584+mOrderState
6585+ = lens _mOrderState (\ s a -> s{_mOrderState = a})
6586+
6587+-- | The name for the order (updatable)
6588+mName :: Lens' MarketplaceOrder (Maybe Text)
6589+mName = lens _mName (\ s a -> s{_mName = a})
6590+
6591+-- | Optional contact information for the seller (buyer-readonly).
6592+mSellerContacts :: Lens' MarketplaceOrder [Maybe ContactInformation]
6593+mSellerContacts
6594+ = lens _mSellerContacts
6595+ (\ s a -> s{_mSellerContacts = a})
6596+ . _Default
6597+ . _Coerce
6598+
6599+mLastUpdaterRole :: Lens' MarketplaceOrder (Maybe Text)
6600+mLastUpdaterRole
6601+ = lens _mLastUpdaterRole
6602+ (\ s a -> s{_mLastUpdaterRole = a})
6603+
6604+-- | List of labels associated with the order. (readonly)
6605+mLabels :: Lens' MarketplaceOrder [Maybe MarketplaceLabel]
6606+mLabels
6607+ = lens _mLabels (\ s a -> s{_mLabels = a}) . _Default
6608+ . _Coerce
6609+
6610+-- | The time (ms since epoch) when the order was last revised (readonly).
6611+mRevisionTimeMs :: Lens' MarketplaceOrder (Maybe Int64)
6612+mRevisionTimeMs
6613+ = lens _mRevisionTimeMs
6614+ (\ s a -> s{_mRevisionTimeMs = a})
6615+
6616+-- | The unique id of the order. (readonly).
6617+mOrderId :: Lens' MarketplaceOrder (Maybe Text)
6618+mOrderId = lens _mOrderId (\ s a -> s{_mOrderId = a})
6619+
6620+-- | The role of the last user that either updated the order or left a
6621+-- comment. (readonly)
6622+mLastUpdaterOrCommentorRole :: Lens' MarketplaceOrder (Maybe Text)
6623+mLastUpdaterOrCommentorRole
6624+ = lens _mLastUpdaterOrCommentorRole
6625+ (\ s a -> s{_mLastUpdaterOrCommentorRole = a})
6626+
6627+-- | When an order is in an accepted state, indicates whether the buyer has
6628+-- signed off Once both sides have signed off on a deal, the order can be
6629+-- finalized by the seller. (seller-readonly)
6630+mHasBuyerSignedOff :: Lens' MarketplaceOrder (Maybe Bool)
6631+mHasBuyerSignedOff
6632+ = lens _mHasBuyerSignedOff
6633+ (\ s a -> s{_mHasBuyerSignedOff = a})
6634+
6635+-- | Reference to the buyer on the order. (readonly, except on create)
6636+mBuyer :: Lens' MarketplaceOrder (Maybe (Maybe Buyer))
6637+mBuyer = lens _mBuyer (\ s a -> s{_mBuyer = a})
6638+
6639+instance FromJSON MarketplaceOrder where
6640+ parseJSON
6641+ = withObject "MarketplaceOrder"
6642+ (\ o ->
6643+ MarketplaceOrder <$>
6644+ (o .:? "buyerPrivateData") <*>
6645+ (o .:? "isSetupComplete")
6646+ <*> (o .:? "buyerContacts" .!= mempty)
6647+ <*>
6648+ (o .:? "kind" .!= "adexchangebuyer#marketplaceOrder")
6649+ <*> (o .:? "originatorRole")
6650+ <*> (o .:? "revisionNumber")
6651+ <*> (o .:? "billedBuyer")
6652+ <*> (o .:? "isRenegotiating")
6653+ <*> (o .:? "hasSellerSignedOff")
6654+ <*> (o .:? "seller")
6655+ <*> (o .:? "orderState")
6656+ <*> (o .:? "name")
6657+ <*> (o .:? "sellerContacts" .!= mempty)
6658+ <*> (o .:? "lastUpdaterRole")
6659+ <*> (o .:? "labels" .!= mempty)
6660+ <*> (o .:? "revisionTimeMs")
6661+ <*> (o .:? "orderId")
6662+ <*> (o .:? "lastUpdaterOrCommentorRole")
6663+ <*> (o .:? "hasBuyerSignedOff")
6664+ <*> (o .:? "buyer"))
6665+
6666+instance ToJSON MarketplaceOrder where
6667+ toJSON MarketplaceOrder{..}
6668+ = object
6669+ (catMaybes
6670+ [("buyerPrivateData" .=) <$> _mBuyerPrivateData,
6671+ ("isSetupComplete" .=) <$> _mIsSetupComplete,
6672+ ("buyerContacts" .=) <$> _mBuyerContacts,
6673+ Just ("kind" .= _mKind),
6674+ ("originatorRole" .=) <$> _mOriginatorRole,
6675+ ("revisionNumber" .=) <$> _mRevisionNumber,
6676+ ("billedBuyer" .=) <$> _mBilledBuyer,
6677+ ("isRenegotiating" .=) <$> _mIsRenegotiating,
6678+ ("hasSellerSignedOff" .=) <$> _mHasSellerSignedOff,
6679+ ("seller" .=) <$> _mSeller,
6680+ ("orderState" .=) <$> _mOrderState,
6681+ ("name" .=) <$> _mName,
6682+ ("sellerContacts" .=) <$> _mSellerContacts,
6683+ ("lastUpdaterRole" .=) <$> _mLastUpdaterRole,
6684+ ("labels" .=) <$> _mLabels,
6685+ ("revisionTimeMs" .=) <$> _mRevisionTimeMs,
6686+ ("orderId" .=) <$> _mOrderId,
6687+ ("lastUpdaterOrCommentorRole" .=) <$>
6688+ _mLastUpdaterOrCommentorRole,
6689+ ("hasBuyerSignedOff" .=) <$> _mHasBuyerSignedOff,
6690+ ("buyer" .=) <$> _mBuyer])
6691+
6692+--
6693+-- /See:/ 'addOrderDealsRequest' smart constructor.
6694+data AddOrderDealsRequest = AddOrderDealsRequest
6695+ { _aUpdateAction :: !(Maybe Text)
6696+ , _aDeals :: !(Maybe [Maybe MarketplaceDeal])
6697+ , _aOrderRevisionNumber :: !(Maybe Int64)
6698+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6699+
6700+-- | Creates a value of 'AddOrderDealsRequest' with the minimum fields required to make a request.
6701+--
6702+-- Use one of the following lenses to modify other fields as desired:
6703+--
6704+-- * 'aUpdateAction'
6705+--
6706+-- * 'aDeals'
6707+--
6708+-- * 'aOrderRevisionNumber'
6709+addOrderDealsRequest
6710+ :: AddOrderDealsRequest
6711+addOrderDealsRequest =
6712+ AddOrderDealsRequest
6713+ { _aUpdateAction = Nothing
6714+ , _aDeals = Nothing
6715+ , _aOrderRevisionNumber = Nothing
6716+ }
6717+
6718+-- | Indicates an optional action to take on the order
6719+aUpdateAction :: Lens' AddOrderDealsRequest (Maybe Text)
6720+aUpdateAction
6721+ = lens _aUpdateAction
6722+ (\ s a -> s{_aUpdateAction = a})
6723+
6724+-- | The list of deals to add
6725+aDeals :: Lens' AddOrderDealsRequest [Maybe MarketplaceDeal]
6726+aDeals
6727+ = lens _aDeals (\ s a -> s{_aDeals = a}) . _Default .
6728+ _Coerce
6729+
6730+-- | The last known order revision number.
6731+aOrderRevisionNumber :: Lens' AddOrderDealsRequest (Maybe Int64)
6732+aOrderRevisionNumber
6733+ = lens _aOrderRevisionNumber
6734+ (\ s a -> s{_aOrderRevisionNumber = a})
6735+
6736+instance FromJSON AddOrderDealsRequest where
6737+ parseJSON
6738+ = withObject "AddOrderDealsRequest"
6739+ (\ o ->
6740+ AddOrderDealsRequest <$>
6741+ (o .:? "updateAction") <*> (o .:? "deals" .!= mempty)
6742+ <*> (o .:? "orderRevisionNumber"))
6743+
6744+instance ToJSON AddOrderDealsRequest where
6745+ toJSON AddOrderDealsRequest{..}
6746+ = object
6747+ (catMaybes
6748+ [("updateAction" .=) <$> _aUpdateAction,
6749+ ("deals" .=) <$> _aDeals,
6750+ ("orderRevisionNumber" .=) <$>
6751+ _aOrderRevisionNumber])
6752+
6753+--
6754+-- /See:/ 'dealTerms' smart constructor.
6755+data DealTerms = DealTerms
6756+ { _dtNonGuaranteedFixedPriceTerms :: !(Maybe (Maybe DealTermsNonGuaranteedFixedPriceTerms))
6757+ , _dtNonGuaranteedAuctionTerms :: !(Maybe (Maybe DealTermsNonGuaranteedAuctionTerms))
6758+ , _dtGuaranteedFixedPriceTerms :: !(Maybe (Maybe DealTermsGuaranteedFixedPriceTerms))
6759+ , _dtDescription :: !(Maybe Text)
6760+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6761+
6762+-- | Creates a value of 'DealTerms' with the minimum fields required to make a request.
6763+--
6764+-- Use one of the following lenses to modify other fields as desired:
6765+--
6766+-- * 'dtNonGuaranteedFixedPriceTerms'
6767+--
6768+-- * 'dtNonGuaranteedAuctionTerms'
6769+--
6770+-- * 'dtGuaranteedFixedPriceTerms'
6771+--
6772+-- * 'dtDescription'
6773+dealTerms
6774+ :: DealTerms
6775+dealTerms =
6776+ DealTerms
6777+ { _dtNonGuaranteedFixedPriceTerms = Nothing
6778+ , _dtNonGuaranteedAuctionTerms = Nothing
6779+ , _dtGuaranteedFixedPriceTerms = Nothing
6780+ , _dtDescription = Nothing
6781+ }
6782+
6783+-- | The terms for non-guaranteed fixed price deals.
6784+dtNonGuaranteedFixedPriceTerms :: Lens' DealTerms (Maybe (Maybe DealTermsNonGuaranteedFixedPriceTerms))
6785+dtNonGuaranteedFixedPriceTerms
6786+ = lens _dtNonGuaranteedFixedPriceTerms
6787+ (\ s a -> s{_dtNonGuaranteedFixedPriceTerms = a})
6788+
6789+-- | The terms for non-guaranteed auction deals.
6790+dtNonGuaranteedAuctionTerms :: Lens' DealTerms (Maybe (Maybe DealTermsNonGuaranteedAuctionTerms))
6791+dtNonGuaranteedAuctionTerms
6792+ = lens _dtNonGuaranteedAuctionTerms
6793+ (\ s a -> s{_dtNonGuaranteedAuctionTerms = a})
6794+
6795+-- | The terms for guaranteed fixed price deals.
6796+dtGuaranteedFixedPriceTerms :: Lens' DealTerms (Maybe (Maybe DealTermsGuaranteedFixedPriceTerms))
6797+dtGuaranteedFixedPriceTerms
6798+ = lens _dtGuaranteedFixedPriceTerms
6799+ (\ s a -> s{_dtGuaranteedFixedPriceTerms = a})
6800+
6801+-- | Description for the proposed terms of the deal.
6802+dtDescription :: Lens' DealTerms (Maybe Text)
6803+dtDescription
6804+ = lens _dtDescription
6805+ (\ s a -> s{_dtDescription = a})
6806+
6807+instance FromJSON DealTerms where
6808+ parseJSON
6809+ = withObject "DealTerms"
6810+ (\ o ->
6811+ DealTerms <$>
6812+ (o .:? "nonGuaranteedFixedPriceTerms") <*>
6813+ (o .:? "nonGuaranteedAuctionTerms")
6814+ <*> (o .:? "guaranteedFixedPriceTerms")
6815+ <*> (o .:? "description"))
6816+
6817+instance ToJSON DealTerms where
6818+ toJSON DealTerms{..}
6819+ = object
6820+ (catMaybes
6821+ [("nonGuaranteedFixedPriceTerms" .=) <$>
6822+ _dtNonGuaranteedFixedPriceTerms,
6823+ ("nonGuaranteedAuctionTerms" .=) <$>
6824+ _dtNonGuaranteedAuctionTerms,
6825+ ("guaranteedFixedPriceTerms" .=) <$>
6826+ _dtGuaranteedFixedPriceTerms,
6827+ ("description" .=) <$> _dtDescription])
6828+
6829+--
6830+-- /See:/ 'editHistoryDto' smart constructor.
6831+data EditHistoryDto = EditHistoryDto
6832+ { _ehdLastUpdatedByLoginName :: !(Maybe Text)
6833+ , _ehdCreatedByLoginName :: !(Maybe Text)
6834+ , _ehdLastUpdateTimeStamp :: !(Maybe Int64)
6835+ , _ehdCreatedTimeStamp :: !(Maybe Int64)
6836+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
6837+
6838+-- | Creates a value of 'EditHistoryDto' with the minimum fields required to make a request.
6839+--
6840+-- Use one of the following lenses to modify other fields as desired:
6841+--
6842+-- * 'ehdLastUpdatedByLoginName'
6843+--
6844+-- * 'ehdCreatedByLoginName'
6845+--
6846+-- * 'ehdLastUpdateTimeStamp'
6847+--
6848+-- * 'ehdCreatedTimeStamp'
6849+editHistoryDto
6850+ :: EditHistoryDto
6851+editHistoryDto =
6852+ EditHistoryDto
6853+ { _ehdLastUpdatedByLoginName = Nothing
6854+ , _ehdCreatedByLoginName = Nothing
6855+ , _ehdLastUpdateTimeStamp = Nothing
6856+ , _ehdCreatedTimeStamp = Nothing
6857+ }
6858+
6859+ehdLastUpdatedByLoginName :: Lens' EditHistoryDto (Maybe Text)
6860+ehdLastUpdatedByLoginName
6861+ = lens _ehdLastUpdatedByLoginName
6862+ (\ s a -> s{_ehdLastUpdatedByLoginName = a})
6863+
6864+ehdCreatedByLoginName :: Lens' EditHistoryDto (Maybe Text)
6865+ehdCreatedByLoginName
6866+ = lens _ehdCreatedByLoginName
6867+ (\ s a -> s{_ehdCreatedByLoginName = a})
6868+
6869+ehdLastUpdateTimeStamp :: Lens' EditHistoryDto (Maybe Int64)
6870+ehdLastUpdateTimeStamp
6871+ = lens _ehdLastUpdateTimeStamp
6872+ (\ s a -> s{_ehdLastUpdateTimeStamp = a})
6873+
6874+ehdCreatedTimeStamp :: Lens' EditHistoryDto (Maybe Int64)
6875+ehdCreatedTimeStamp
6876+ = lens _ehdCreatedTimeStamp
6877+ (\ s a -> s{_ehdCreatedTimeStamp = a})
6878+
6879+instance FromJSON EditHistoryDto where
6880+ parseJSON
6881+ = withObject "EditHistoryDto"
6882+ (\ o ->
6883+ EditHistoryDto <$>
6884+ (o .:? "lastUpdatedByLoginName") <*>
6885+ (o .:? "createdByLoginName")
6886+ <*> (o .:? "lastUpdateTimeStamp")
6887+ <*> (o .:? "createdTimeStamp"))
6888+
6889+instance ToJSON EditHistoryDto where
6890+ toJSON EditHistoryDto{..}
6891+ = object
6892+ (catMaybes
6893+ [("lastUpdatedByLoginName" .=) <$>
6894+ _ehdLastUpdatedByLoginName,
6895+ ("createdByLoginName" .=) <$> _ehdCreatedByLoginName,
6896+ ("lastUpdateTimeStamp" .=) <$>
6897+ _ehdLastUpdateTimeStamp,
6898+ ("createdTimeStamp" .=) <$> _ehdCreatedTimeStamp])