1#![allow(clippy::too_many_arguments)]
13
14use crate::client::Ghl;
15use crate::error::Result;
16use ghl_models::v2::ad_manager as models;
17
18#[derive(Debug, Clone)]
21pub struct AdManagerService {
22 pub(crate) client: Ghl,
23}
24
25impl AdManagerService {
26 pub(crate) fn new(client: Ghl) -> Self {
27 Self { client }
28 }
29}
30
31#[derive(Debug, Clone, Default)]
33pub struct GetAdAccountsParams {
34 pub location_id: String,
37 pub type_: Option<String>,
39 pub next: Option<String>,
41 pub fetch_all: Option<String>,
43 pub limit: Option<String>,
45}
46
47impl GetAdAccountsParams {
48 pub fn new(location_id: impl Into<String>) -> Self {
50 Self {
51 location_id: location_id.into(),
52 ..Default::default()
53 }
54 }
55
56 pub fn type_(mut self, v: impl Into<String>) -> Self {
58 self.type_ = Some(v.into());
59 self
60 }
61
62 pub fn next(mut self, v: impl Into<String>) -> Self {
64 self.next = Some(v.into());
65 self
66 }
67
68 pub fn fetch_all(mut self, v: impl Into<String>) -> Self {
70 self.fetch_all = Some(v.into());
71 self
72 }
73
74 pub fn limit(mut self, v: impl Into<String>) -> Self {
76 self.limit = Some(v.into());
77 self
78 }
79
80 fn to_query(&self) -> Vec<(String, String)> {
81 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
82 if let Some(v) = &self.type_ {
83 q.push(("type".into(), v.to_string()));
84 }
85 if let Some(v) = &self.next {
86 q.push(("next".into(), v.to_string()));
87 }
88 if let Some(v) = &self.fetch_all {
89 q.push(("fetchAll".into(), v.to_string()));
90 }
91 if let Some(v) = &self.limit {
92 q.push(("limit".into(), v.to_string()));
93 }
94 q
95 }
96}
97
98#[derive(Debug, Clone, Default)]
100pub struct GetAdAccountDetailsParams {
101 pub location_id: String,
104}
105
106impl GetAdAccountDetailsParams {
107 pub fn new(location_id: impl Into<String>) -> Self {
109 Self {
110 location_id: location_id.into(),
111 }
112 }
113
114 fn to_query(&self) -> Vec<(String, String)> {
115 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
116 q
117 }
118}
119
120#[derive(Debug, Clone, Default)]
122pub struct GetCampaignWithLinkedEntitiesParams {
123 pub location_id: String,
126 pub fields: Option<String>,
128 pub source: Option<String>,
130}
131
132impl GetCampaignWithLinkedEntitiesParams {
133 pub fn new(location_id: impl Into<String>) -> Self {
135 Self {
136 location_id: location_id.into(),
137 ..Default::default()
138 }
139 }
140
141 pub fn fields(mut self, v: impl Into<String>) -> Self {
143 self.fields = Some(v.into());
144 self
145 }
146
147 pub fn source(mut self, v: impl Into<String>) -> Self {
149 self.source = Some(v.into());
150 self
151 }
152
153 fn to_query(&self) -> Vec<(String, String)> {
154 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
155 if let Some(v) = &self.fields {
156 q.push(("fields".into(), v.to_string()));
157 }
158 if let Some(v) = &self.source {
159 q.push(("source".into(), v.to_string()));
160 }
161 q
162 }
163}
164
165#[derive(Debug, Clone, Default)]
167pub struct GetConversationFormsParams {
168 pub location_id: String,
171}
172
173impl GetConversationFormsParams {
174 pub fn new(location_id: impl Into<String>) -> Self {
176 Self {
177 location_id: location_id.into(),
178 }
179 }
180
181 fn to_query(&self) -> Vec<(String, String)> {
182 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
183 q
184 }
185}
186
187#[derive(Debug, Clone, Default)]
189pub struct GetCustomAudiencesParams {
190 pub location_id: String,
193 pub type_: String,
197 pub source: Option<String>,
200 pub ad_account_id: String,
203}
204
205impl GetCustomAudiencesParams {
206 pub fn new(
208 location_id: impl Into<String>,
209 type_: impl Into<String>,
210 ad_account_id: impl Into<String>,
211 ) -> Self {
212 Self {
213 location_id: location_id.into(),
214 type_: type_.into(),
215 ad_account_id: ad_account_id.into(),
216 ..Default::default()
217 }
218 }
219
220 pub fn source(mut self, v: impl Into<String>) -> Self {
222 self.source = Some(v.into());
223 self
224 }
225
226 fn to_query(&self) -> Vec<(String, String)> {
227 let mut q: Vec<(String, String)> = vec![
228 ("locationId".into(), self.location_id.clone()),
229 ("type".into(), self.type_.clone()),
230 ("adAccountId".into(), self.ad_account_id.clone()),
231 ];
232 if let Some(v) = &self.source {
233 q.push(("source".into(), v.to_string()));
234 }
235 q
236 }
237}
238
239#[derive(Debug, Clone, Default)]
241pub struct DeleteCustomAudienceParams {
242 pub location_id: String,
245}
246
247impl DeleteCustomAudienceParams {
248 pub fn new(location_id: impl Into<String>) -> Self {
250 Self {
251 location_id: location_id.into(),
252 }
253 }
254
255 fn to_query(&self) -> Vec<(String, String)> {
256 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
257 q
258 }
259}
260
261#[derive(Debug, Clone, Default)]
263pub struct GetCustomAudienceByIdParams {
264 pub location_id: String,
267}
268
269impl GetCustomAudienceByIdParams {
270 pub fn new(location_id: impl Into<String>) -> Self {
272 Self {
273 location_id: location_id.into(),
274 }
275 }
276
277 fn to_query(&self) -> Vec<(String, String)> {
278 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
279 q
280 }
281}
282
283#[derive(Debug, Clone, Default)]
285pub struct GetEntitiesParams {
286 pub location_id: String,
289 pub type_: String,
293 pub next: Option<String>,
295 pub fetch_all: Option<String>,
297 pub campaign_id: Option<String>,
299 pub ad_set_id: Option<String>,
301 pub entity_type: String,
305 pub search_id: Option<String>,
307 pub selected_ad_account_id: Option<String>,
309}
310
311impl GetEntitiesParams {
312 pub fn new(
314 location_id: impl Into<String>,
315 type_: impl Into<String>,
316 entity_type: impl Into<String>,
317 ) -> Self {
318 Self {
319 location_id: location_id.into(),
320 type_: type_.into(),
321 entity_type: entity_type.into(),
322 ..Default::default()
323 }
324 }
325
326 pub fn next(mut self, v: impl Into<String>) -> Self {
328 self.next = Some(v.into());
329 self
330 }
331
332 pub fn fetch_all(mut self, v: impl Into<String>) -> Self {
334 self.fetch_all = Some(v.into());
335 self
336 }
337
338 pub fn campaign_id(mut self, v: impl Into<String>) -> Self {
340 self.campaign_id = Some(v.into());
341 self
342 }
343
344 pub fn ad_set_id(mut self, v: impl Into<String>) -> Self {
346 self.ad_set_id = Some(v.into());
347 self
348 }
349
350 pub fn search_id(mut self, v: impl Into<String>) -> Self {
352 self.search_id = Some(v.into());
353 self
354 }
355
356 pub fn selected_ad_account_id(mut self, v: impl Into<String>) -> Self {
358 self.selected_ad_account_id = Some(v.into());
359 self
360 }
361
362 fn to_query(&self) -> Vec<(String, String)> {
363 let mut q: Vec<(String, String)> = vec![
364 ("locationId".into(), self.location_id.clone()),
365 ("type".into(), self.type_.clone()),
366 ("entityType".into(), self.entity_type.clone()),
367 ];
368 if let Some(v) = &self.next {
369 q.push(("next".into(), v.to_string()));
370 }
371 if let Some(v) = &self.fetch_all {
372 q.push(("fetchAll".into(), v.to_string()));
373 }
374 if let Some(v) = &self.campaign_id {
375 q.push(("campaignId".into(), v.to_string()));
376 }
377 if let Some(v) = &self.ad_set_id {
378 q.push(("adSetId".into(), v.to_string()));
379 }
380 if let Some(v) = &self.search_id {
381 q.push(("searchId".into(), v.to_string()));
382 }
383 if let Some(v) = &self.selected_ad_account_id {
384 q.push(("selectedAdAccountId".into(), v.to_string()));
385 }
386 q
387 }
388}
389
390#[derive(Debug, Clone, Default)]
392pub struct GetFacebookIntegrationParams {
393 pub location_id: String,
396}
397
398impl GetFacebookIntegrationParams {
399 pub fn new(location_id: impl Into<String>) -> Self {
401 Self {
402 location_id: location_id.into(),
403 }
404 }
405
406 fn to_query(&self) -> Vec<(String, String)> {
407 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
408 q
409 }
410}
411
412#[derive(Debug, Clone, Default)]
414pub struct GetLeadFormByIdParams {
415 pub location_id: String,
418}
419
420impl GetLeadFormByIdParams {
421 pub fn new(location_id: impl Into<String>) -> Self {
423 Self {
424 location_id: location_id.into(),
425 }
426 }
427
428 fn to_query(&self) -> Vec<(String, String)> {
429 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
430 q
431 }
432}
433
434#[derive(Debug, Clone, Default)]
436pub struct GetCurrentFacebookUserParams {
437 pub location_id: String,
440}
441
442impl GetCurrentFacebookUserParams {
443 pub fn new(location_id: impl Into<String>) -> Self {
445 Self {
446 location_id: location_id.into(),
447 }
448 }
449
450 fn to_query(&self) -> Vec<(String, String)> {
451 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
452 q
453 }
454}
455
456#[derive(Debug, Clone, Default)]
458pub struct DeletePageConnectionParams {
459 pub location_id: String,
462 pub page_id: String,
465}
466
467impl DeletePageConnectionParams {
468 pub fn new(location_id: impl Into<String>, page_id: impl Into<String>) -> Self {
470 Self {
471 location_id: location_id.into(),
472 page_id: page_id.into(),
473 }
474 }
475
476 fn to_query(&self) -> Vec<(String, String)> {
477 let q: Vec<(String, String)> = vec![
478 ("locationId".into(), self.location_id.clone()),
479 ("pageId".into(), self.page_id.clone()),
480 ];
481 q
482 }
483}
484
485#[derive(Debug, Clone, Default)]
487pub struct SetDefaultPageParams {
488 pub location_id: String,
491}
492
493impl SetDefaultPageParams {
494 pub fn new(location_id: impl Into<String>) -> Self {
496 Self {
497 location_id: location_id.into(),
498 }
499 }
500
501 fn to_query(&self) -> Vec<(String, String)> {
502 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
503 q
504 }
505}
506
507#[derive(Debug, Clone, Default)]
509pub struct GetPageLeadFormsParams {
510 pub location_id: String,
513}
514
515impl GetPageLeadFormsParams {
516 pub fn new(location_id: impl Into<String>) -> Self {
518 Self {
519 location_id: location_id.into(),
520 }
521 }
522
523 fn to_query(&self) -> Vec<(String, String)> {
524 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
525 q
526 }
527}
528
529#[derive(Debug, Clone, Default)]
531pub struct GetInstagramAccountsForPageParams {
532 pub location_id: String,
535 pub type_: Option<String>,
538}
539
540impl GetInstagramAccountsForPageParams {
541 pub fn new(location_id: impl Into<String>) -> Self {
543 Self {
544 location_id: location_id.into(),
545 ..Default::default()
546 }
547 }
548
549 pub fn type_(mut self, v: impl Into<String>) -> Self {
551 self.type_ = Some(v.into());
552 self
553 }
554
555 fn to_query(&self) -> Vec<(String, String)> {
556 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
557 if let Some(v) = &self.type_ {
558 q.push(("type".into(), v.to_string()));
559 }
560 q
561 }
562}
563
564#[derive(Debug, Clone, Default)]
566pub struct GetFacebookPagesParams {
567 pub location_id: String,
570 pub fetch_existing: Option<String>,
572}
573
574impl GetFacebookPagesParams {
575 pub fn new(location_id: impl Into<String>) -> Self {
577 Self {
578 location_id: location_id.into(),
579 ..Default::default()
580 }
581 }
582
583 pub fn fetch_existing(mut self, v: impl Into<String>) -> Self {
585 self.fetch_existing = Some(v.into());
586 self
587 }
588
589 fn to_query(&self) -> Vec<(String, String)> {
590 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
591 if let Some(v) = &self.fetch_existing {
592 q.push(("fetchExisting".into(), v.to_string()));
593 }
594 q
595 }
596}
597
598#[derive(Debug, Clone, Default)]
600pub struct GetConversionPixelsParams {
601 pub location_id: String,
604 pub channel: Option<String>,
606 pub page_id: Option<String>,
608 pub ig_user_id: Option<String>,
610}
611
612impl GetConversionPixelsParams {
613 pub fn new(location_id: impl Into<String>) -> Self {
615 Self {
616 location_id: location_id.into(),
617 ..Default::default()
618 }
619 }
620
621 pub fn channel(mut self, v: impl Into<String>) -> Self {
623 self.channel = Some(v.into());
624 self
625 }
626
627 pub fn page_id(mut self, v: impl Into<String>) -> Self {
629 self.page_id = Some(v.into());
630 self
631 }
632
633 pub fn ig_user_id(mut self, v: impl Into<String>) -> Self {
635 self.ig_user_id = Some(v.into());
636 self
637 }
638
639 fn to_query(&self) -> Vec<(String, String)> {
640 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
641 if let Some(v) = &self.channel {
642 q.push(("channel".into(), v.to_string()));
643 }
644 if let Some(v) = &self.page_id {
645 q.push(("pageId".into(), v.to_string()));
646 }
647 if let Some(v) = &self.ig_user_id {
648 q.push(("igUserId".into(), v.to_string()));
649 }
650 q
651 }
652}
653
654#[derive(Debug, Clone, Default)]
656pub struct GetReportingDataParams {
657 pub location_id: String,
660 pub group_by: String,
664 pub start_date: String,
667 pub end_date: String,
670 pub type_: String,
674 pub fields: String,
677}
678
679impl GetReportingDataParams {
680 pub fn new(
682 location_id: impl Into<String>,
683 group_by: impl Into<String>,
684 start_date: impl Into<String>,
685 end_date: impl Into<String>,
686 type_: impl Into<String>,
687 fields: impl Into<String>,
688 ) -> Self {
689 Self {
690 location_id: location_id.into(),
691 group_by: group_by.into(),
692 start_date: start_date.into(),
693 end_date: end_date.into(),
694 type_: type_.into(),
695 fields: fields.into(),
696 }
697 }
698
699 fn to_query(&self) -> Vec<(String, String)> {
700 let q: Vec<(String, String)> = vec![
701 ("locationId".into(), self.location_id.clone()),
702 ("groupBy".into(), self.group_by.clone()),
703 ("startDate".into(), self.start_date.clone()),
704 ("endDate".into(), self.end_date.clone()),
705 ("type".into(), self.type_.clone()),
706 ("fields".into(), self.fields.clone()),
707 ];
708 q
709 }
710}
711
712#[derive(Debug, Clone, Default)]
714pub struct GetCampaignReportingParams {
715 pub location_id: String,
718 pub start_date: String,
721 pub end_date: String,
724}
725
726impl GetCampaignReportingParams {
727 pub fn new(
729 location_id: impl Into<String>,
730 start_date: impl Into<String>,
731 end_date: impl Into<String>,
732 ) -> Self {
733 Self {
734 location_id: location_id.into(),
735 start_date: start_date.into(),
736 end_date: end_date.into(),
737 }
738 }
739
740 fn to_query(&self) -> Vec<(String, String)> {
741 let q: Vec<(String, String)> = vec![
742 ("locationId".into(), self.location_id.clone()),
743 ("startDate".into(), self.start_date.clone()),
744 ("endDate".into(), self.end_date.clone()),
745 ];
746 q
747 }
748}
749
750#[derive(Debug, Clone, Default)]
752pub struct GetReportingListParams {
753 pub location_id: String,
756 pub list_type: String,
759 pub start_date: String,
762 pub end_date: String,
765 pub campaign_id: String,
768 pub type_: String,
772}
773
774impl GetReportingListParams {
775 pub fn new(
777 location_id: impl Into<String>,
778 list_type: impl Into<String>,
779 start_date: impl Into<String>,
780 end_date: impl Into<String>,
781 campaign_id: impl Into<String>,
782 type_: impl Into<String>,
783 ) -> Self {
784 Self {
785 location_id: location_id.into(),
786 list_type: list_type.into(),
787 start_date: start_date.into(),
788 end_date: end_date.into(),
789 campaign_id: campaign_id.into(),
790 type_: type_.into(),
791 }
792 }
793
794 fn to_query(&self) -> Vec<(String, String)> {
795 let q: Vec<(String, String)> = vec![
796 ("locationId".into(), self.location_id.clone()),
797 ("listType".into(), self.list_type.clone()),
798 ("startDate".into(), self.start_date.clone()),
799 ("endDate".into(), self.end_date.clone()),
800 ("campaignId".into(), self.campaign_id.clone()),
801 ("type".into(), self.type_.clone()),
802 ];
803 q
804 }
805}
806
807#[derive(Debug, Clone, Default)]
809pub struct SearchTargetingOptionsParams {
810 pub type_: String,
813 pub query: String,
816 pub search_type: Option<String>,
818}
819
820impl SearchTargetingOptionsParams {
821 pub fn new(type_: impl Into<String>, query: impl Into<String>) -> Self {
823 Self {
824 type_: type_.into(),
825 query: query.into(),
826 ..Default::default()
827 }
828 }
829
830 pub fn search_type(mut self, v: impl Into<String>) -> Self {
832 self.search_type = Some(v.into());
833 self
834 }
835
836 fn to_query(&self) -> Vec<(String, String)> {
837 let mut q: Vec<(String, String)> = vec![
838 ("type".into(), self.type_.clone()),
839 ("query".into(), self.query.clone()),
840 ];
841 if let Some(v) = &self.search_type {
842 q.push(("searchType".into(), v.to_string()));
843 }
844 q
845 }
846}
847
848#[derive(Debug, Clone, Default)]
850pub struct GetGoogleAdAccountsParams {
851 pub location_id: String,
854 pub type_: Option<String>,
857}
858
859impl GetGoogleAdAccountsParams {
860 pub fn new(location_id: impl Into<String>) -> Self {
862 Self {
863 location_id: location_id.into(),
864 ..Default::default()
865 }
866 }
867
868 pub fn type_(mut self, v: impl Into<String>) -> Self {
870 self.type_ = Some(v.into());
871 self
872 }
873
874 fn to_query(&self) -> Vec<(String, String)> {
875 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
876 if let Some(v) = &self.type_ {
877 q.push(("type".into(), v.to_string()));
878 }
879 q
880 }
881}
882
883#[derive(Debug, Clone, Default)]
885pub struct GetAdAccountDetailsOpParams {
886 pub location_id: String,
889}
890
891impl GetAdAccountDetailsOpParams {
892 pub fn new(location_id: impl Into<String>) -> Self {
894 Self {
895 location_id: location_id.into(),
896 }
897 }
898
899 fn to_query(&self) -> Vec<(String, String)> {
900 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
901 q
902 }
903}
904
905#[derive(Debug, Clone, Default)]
907pub struct GetGoogleCampaignByIdParams {
908 pub location_id: String,
911}
912
913impl GetGoogleCampaignByIdParams {
914 pub fn new(location_id: impl Into<String>) -> Self {
916 Self {
917 location_id: location_id.into(),
918 }
919 }
920
921 fn to_query(&self) -> Vec<(String, String)> {
922 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
923 q
924 }
925}
926
927#[derive(Debug, Clone, Default)]
929pub struct GetAssetsParams {
930 pub location_id: String,
933 pub type_: String,
937 pub id: Option<String>,
939 pub advertiser_only: Option<String>,
941}
942
943impl GetAssetsParams {
944 pub fn new(location_id: impl Into<String>, type_: impl Into<String>) -> Self {
946 Self {
947 location_id: location_id.into(),
948 type_: type_.into(),
949 ..Default::default()
950 }
951 }
952
953 pub fn id(mut self, v: impl Into<String>) -> Self {
955 self.id = Some(v.into());
956 self
957 }
958
959 pub fn advertiser_only(mut self, v: impl Into<String>) -> Self {
961 self.advertiser_only = Some(v.into());
962 self
963 }
964
965 fn to_query(&self) -> Vec<(String, String)> {
966 let mut q: Vec<(String, String)> = vec![
967 ("locationId".into(), self.location_id.clone()),
968 ("type".into(), self.type_.clone()),
969 ];
970 if let Some(v) = &self.id {
971 q.push(("id".into(), v.to_string()));
972 }
973 if let Some(v) = &self.advertiser_only {
974 q.push(("advertiserOnly".into(), v.to_string()));
975 }
976 q
977 }
978}
979
980#[derive(Debug, Clone, Default)]
982pub struct GetAudiencesParams {
983 pub location_id: String,
986}
987
988impl GetAudiencesParams {
989 pub fn new(location_id: impl Into<String>) -> Self {
991 Self {
992 location_id: location_id.into(),
993 }
994 }
995
996 fn to_query(&self) -> Vec<(String, String)> {
997 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
998 q
999 }
1000}
1001
1002#[derive(Debug, Clone, Default)]
1004pub struct GetAudienceByIdParams {
1005 pub location_id: String,
1008}
1009
1010impl GetAudienceByIdParams {
1011 pub fn new(location_id: impl Into<String>) -> Self {
1013 Self {
1014 location_id: location_id.into(),
1015 }
1016 }
1017
1018 fn to_query(&self) -> Vec<(String, String)> {
1019 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1020 q
1021 }
1022}
1023
1024#[derive(Debug, Clone, Default)]
1026pub struct GetConversionGoalsParams {
1027 pub location_id: String,
1030}
1031
1032impl GetConversionGoalsParams {
1033 pub fn new(location_id: impl Into<String>) -> Self {
1035 Self {
1036 location_id: location_id.into(),
1037 }
1038 }
1039
1040 fn to_query(&self) -> Vec<(String, String)> {
1041 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1042 q
1043 }
1044}
1045
1046#[derive(Debug, Clone, Default)]
1048pub struct GetConversionsParams {
1049 pub location_id: String,
1052 pub type_: Option<String>,
1055 pub conversion_type: Option<String>,
1057 pub category: Option<String>,
1059 pub start_date: Option<String>,
1061 pub end_date: Option<String>,
1063}
1064
1065impl GetConversionsParams {
1066 pub fn new(location_id: impl Into<String>) -> Self {
1068 Self {
1069 location_id: location_id.into(),
1070 ..Default::default()
1071 }
1072 }
1073
1074 pub fn type_(mut self, v: impl Into<String>) -> Self {
1076 self.type_ = Some(v.into());
1077 self
1078 }
1079
1080 pub fn conversion_type(mut self, v: impl Into<String>) -> Self {
1082 self.conversion_type = Some(v.into());
1083 self
1084 }
1085
1086 pub fn category(mut self, v: impl Into<String>) -> Self {
1088 self.category = Some(v.into());
1089 self
1090 }
1091
1092 pub fn start_date(mut self, v: impl Into<String>) -> Self {
1094 self.start_date = Some(v.into());
1095 self
1096 }
1097
1098 pub fn end_date(mut self, v: impl Into<String>) -> Self {
1100 self.end_date = Some(v.into());
1101 self
1102 }
1103
1104 fn to_query(&self) -> Vec<(String, String)> {
1105 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1106 if let Some(v) = &self.type_ {
1107 q.push(("type".into(), v.to_string()));
1108 }
1109 if let Some(v) = &self.conversion_type {
1110 q.push(("conversionType".into(), v.to_string()));
1111 }
1112 if let Some(v) = &self.category {
1113 q.push(("category".into(), v.to_string()));
1114 }
1115 if let Some(v) = &self.start_date {
1116 q.push(("startDate".into(), v.to_string()));
1117 }
1118 if let Some(v) = &self.end_date {
1119 q.push(("endDate".into(), v.to_string()));
1120 }
1121 q
1122 }
1123}
1124
1125#[derive(Debug, Clone, Default)]
1127pub struct DeleteConversionParams {
1128 pub location_id: String,
1131}
1132
1133impl DeleteConversionParams {
1134 pub fn new(location_id: impl Into<String>) -> Self {
1136 Self {
1137 location_id: location_id.into(),
1138 }
1139 }
1140
1141 fn to_query(&self) -> Vec<(String, String)> {
1142 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1143 q
1144 }
1145}
1146
1147#[derive(Debug, Clone, Default)]
1149pub struct GetConversionByIdParams {
1150 pub location_id: String,
1153}
1154
1155impl GetConversionByIdParams {
1156 pub fn new(location_id: impl Into<String>) -> Self {
1158 Self {
1159 location_id: location_id.into(),
1160 }
1161 }
1162
1163 fn to_query(&self) -> Vec<(String, String)> {
1164 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1165 q
1166 }
1167}
1168
1169#[derive(Debug, Clone, Default)]
1171pub struct GetEntitiesOpParams {
1172 pub location_id: String,
1175 pub type_: String,
1179 pub campaign_id: Option<String>,
1181 pub ad_group_id: Option<String>,
1183 pub entity_type: String,
1187 pub search_id: Option<String>,
1189 pub start_date: Option<String>,
1191 pub end_date: Option<String>,
1193 pub selected_ad_account_id: Option<String>,
1195}
1196
1197impl GetEntitiesOpParams {
1198 pub fn new(
1200 location_id: impl Into<String>,
1201 type_: impl Into<String>,
1202 entity_type: impl Into<String>,
1203 ) -> Self {
1204 Self {
1205 location_id: location_id.into(),
1206 type_: type_.into(),
1207 entity_type: entity_type.into(),
1208 ..Default::default()
1209 }
1210 }
1211
1212 pub fn campaign_id(mut self, v: impl Into<String>) -> Self {
1214 self.campaign_id = Some(v.into());
1215 self
1216 }
1217
1218 pub fn ad_group_id(mut self, v: impl Into<String>) -> Self {
1220 self.ad_group_id = Some(v.into());
1221 self
1222 }
1223
1224 pub fn search_id(mut self, v: impl Into<String>) -> Self {
1226 self.search_id = Some(v.into());
1227 self
1228 }
1229
1230 pub fn start_date(mut self, v: impl Into<String>) -> Self {
1232 self.start_date = Some(v.into());
1233 self
1234 }
1235
1236 pub fn end_date(mut self, v: impl Into<String>) -> Self {
1238 self.end_date = Some(v.into());
1239 self
1240 }
1241
1242 pub fn selected_ad_account_id(mut self, v: impl Into<String>) -> Self {
1244 self.selected_ad_account_id = Some(v.into());
1245 self
1246 }
1247
1248 fn to_query(&self) -> Vec<(String, String)> {
1249 let mut q: Vec<(String, String)> = vec![
1250 ("locationId".into(), self.location_id.clone()),
1251 ("type".into(), self.type_.clone()),
1252 ("entityType".into(), self.entity_type.clone()),
1253 ];
1254 if let Some(v) = &self.campaign_id {
1255 q.push(("campaignId".into(), v.to_string()));
1256 }
1257 if let Some(v) = &self.ad_group_id {
1258 q.push(("adGroupId".into(), v.to_string()));
1259 }
1260 if let Some(v) = &self.search_id {
1261 q.push(("searchId".into(), v.to_string()));
1262 }
1263 if let Some(v) = &self.start_date {
1264 q.push(("startDate".into(), v.to_string()));
1265 }
1266 if let Some(v) = &self.end_date {
1267 q.push(("endDate".into(), v.to_string()));
1268 }
1269 if let Some(v) = &self.selected_ad_account_id {
1270 q.push(("selectedAdAccountId".into(), v.to_string()));
1271 }
1272 q
1273 }
1274}
1275
1276#[derive(Debug, Clone, Default)]
1278pub struct GetGoogleIntegrationParams {
1279 pub location_id: String,
1282}
1283
1284impl GetGoogleIntegrationParams {
1285 pub fn new(location_id: impl Into<String>) -> Self {
1287 Self {
1288 location_id: location_id.into(),
1289 }
1290 }
1291
1292 fn to_query(&self) -> Vec<(String, String)> {
1293 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1294 q
1295 }
1296}
1297
1298#[derive(Debug, Clone, Default)]
1300pub struct GetKeywordIdeasParams {
1301 pub location_id: String,
1304}
1305
1306impl GetKeywordIdeasParams {
1307 pub fn new(location_id: impl Into<String>) -> Self {
1309 Self {
1310 location_id: location_id.into(),
1311 }
1312 }
1313
1314 fn to_query(&self) -> Vec<(String, String)> {
1315 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1316 q
1317 }
1318}
1319
1320#[derive(Debug, Clone, Default)]
1322pub struct GetCurrentGoogleUserParams {
1323 pub location_id: String,
1326}
1327
1328impl GetCurrentGoogleUserParams {
1329 pub fn new(location_id: impl Into<String>) -> Self {
1331 Self {
1332 location_id: location_id.into(),
1333 }
1334 }
1335
1336 fn to_query(&self) -> Vec<(String, String)> {
1337 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1338 q
1339 }
1340}
1341
1342#[derive(Debug, Clone, Default)]
1344pub struct GetReportingDataOpParams {
1345 pub location_id: String,
1348 pub group_by: Option<String>,
1351 pub start_date: String,
1354 pub end_date: String,
1357 pub type_: String,
1361 pub fields: String,
1364}
1365
1366impl GetReportingDataOpParams {
1367 pub fn new(
1369 location_id: impl Into<String>,
1370 start_date: impl Into<String>,
1371 end_date: impl Into<String>,
1372 type_: impl Into<String>,
1373 fields: impl Into<String>,
1374 ) -> Self {
1375 Self {
1376 location_id: location_id.into(),
1377 start_date: start_date.into(),
1378 end_date: end_date.into(),
1379 type_: type_.into(),
1380 fields: fields.into(),
1381 ..Default::default()
1382 }
1383 }
1384
1385 pub fn group_by(mut self, v: impl Into<String>) -> Self {
1387 self.group_by = Some(v.into());
1388 self
1389 }
1390
1391 fn to_query(&self) -> Vec<(String, String)> {
1392 let mut q: Vec<(String, String)> = vec![
1393 ("locationId".into(), self.location_id.clone()),
1394 ("startDate".into(), self.start_date.clone()),
1395 ("endDate".into(), self.end_date.clone()),
1396 ("type".into(), self.type_.clone()),
1397 ("fields".into(), self.fields.clone()),
1398 ];
1399 if let Some(v) = &self.group_by {
1400 q.push(("groupBy".into(), v.to_string()));
1401 }
1402 q
1403 }
1404}
1405
1406#[derive(Debug, Clone, Default)]
1408pub struct GetCampaignReportingOpParams {
1409 pub location_id: String,
1412 pub start_date: String,
1415 pub end_date: String,
1418}
1419
1420impl GetCampaignReportingOpParams {
1421 pub fn new(
1423 location_id: impl Into<String>,
1424 start_date: impl Into<String>,
1425 end_date: impl Into<String>,
1426 ) -> Self {
1427 Self {
1428 location_id: location_id.into(),
1429 start_date: start_date.into(),
1430 end_date: end_date.into(),
1431 }
1432 }
1433
1434 fn to_query(&self) -> Vec<(String, String)> {
1435 let q: Vec<(String, String)> = vec![
1436 ("locationId".into(), self.location_id.clone()),
1437 ("startDate".into(), self.start_date.clone()),
1438 ("endDate".into(), self.end_date.clone()),
1439 ];
1440 q
1441 }
1442}
1443
1444#[derive(Debug, Clone, Default)]
1446pub struct GetReportingListOpParams {
1447 pub location_id: String,
1450 pub list_type: String,
1453 pub start_date: String,
1456 pub end_date: String,
1459 pub campaign_id: Option<String>,
1461 pub type_: String,
1465}
1466
1467impl GetReportingListOpParams {
1468 pub fn new(
1470 location_id: impl Into<String>,
1471 list_type: impl Into<String>,
1472 start_date: impl Into<String>,
1473 end_date: impl Into<String>,
1474 type_: impl Into<String>,
1475 ) -> Self {
1476 Self {
1477 location_id: location_id.into(),
1478 list_type: list_type.into(),
1479 start_date: start_date.into(),
1480 end_date: end_date.into(),
1481 type_: type_.into(),
1482 ..Default::default()
1483 }
1484 }
1485
1486 pub fn campaign_id(mut self, v: impl Into<String>) -> Self {
1488 self.campaign_id = Some(v.into());
1489 self
1490 }
1491
1492 fn to_query(&self) -> Vec<(String, String)> {
1493 let mut q: Vec<(String, String)> = vec![
1494 ("locationId".into(), self.location_id.clone()),
1495 ("listType".into(), self.list_type.clone()),
1496 ("startDate".into(), self.start_date.clone()),
1497 ("endDate".into(), self.end_date.clone()),
1498 ("type".into(), self.type_.clone()),
1499 ];
1500 if let Some(v) = &self.campaign_id {
1501 q.push(("campaignId".into(), v.to_string()));
1502 }
1503 q
1504 }
1505}
1506
1507#[derive(Debug, Clone, Default)]
1509pub struct GetSegmentsParams {
1510 pub location_id: String,
1513 pub type_: Option<String>,
1515}
1516
1517impl GetSegmentsParams {
1518 pub fn new(location_id: impl Into<String>) -> Self {
1520 Self {
1521 location_id: location_id.into(),
1522 ..Default::default()
1523 }
1524 }
1525
1526 pub fn type_(mut self, v: impl Into<String>) -> Self {
1528 self.type_ = Some(v.into());
1529 self
1530 }
1531
1532 fn to_query(&self) -> Vec<(String, String)> {
1533 let mut q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1534 if let Some(v) = &self.type_ {
1535 q.push(("type".into(), v.to_string()));
1536 }
1537 q
1538 }
1539}
1540
1541#[derive(Debug, Clone, Default)]
1543pub struct UpsertSegmentParams {
1544 pub location_id: String,
1547 pub type_: String,
1551}
1552
1553impl UpsertSegmentParams {
1554 pub fn new(location_id: impl Into<String>, type_: impl Into<String>) -> Self {
1556 Self {
1557 location_id: location_id.into(),
1558 type_: type_.into(),
1559 }
1560 }
1561
1562 fn to_query(&self) -> Vec<(String, String)> {
1563 let q: Vec<(String, String)> = vec![
1564 ("locationId".into(), self.location_id.clone()),
1565 ("type".into(), self.type_.clone()),
1566 ];
1567 q
1568 }
1569}
1570
1571#[derive(Debug, Clone, Default)]
1573pub struct DeleteSegmentParams {
1574 pub location_id: String,
1577 pub type_: String,
1581}
1582
1583impl DeleteSegmentParams {
1584 pub fn new(location_id: impl Into<String>, type_: impl Into<String>) -> Self {
1586 Self {
1587 location_id: location_id.into(),
1588 type_: type_.into(),
1589 }
1590 }
1591
1592 fn to_query(&self) -> Vec<(String, String)> {
1593 let q: Vec<(String, String)> = vec![
1594 ("locationId".into(), self.location_id.clone()),
1595 ("type".into(), self.type_.clone()),
1596 ];
1597 q
1598 }
1599}
1600
1601#[derive(Debug, Clone, Default)]
1603pub struct GetSegmentByIdParams {
1604 pub location_id: String,
1607 pub type_: String,
1611}
1612
1613impl GetSegmentByIdParams {
1614 pub fn new(location_id: impl Into<String>, type_: impl Into<String>) -> Self {
1616 Self {
1617 location_id: location_id.into(),
1618 type_: type_.into(),
1619 }
1620 }
1621
1622 fn to_query(&self) -> Vec<(String, String)> {
1623 let q: Vec<(String, String)> = vec![
1624 ("locationId".into(), self.location_id.clone()),
1625 ("type".into(), self.type_.clone()),
1626 ];
1627 q
1628 }
1629}
1630
1631#[derive(Debug, Clone, Default)]
1633pub struct GetTargetInterestsParams {
1634 pub location_id: String,
1637 pub type_: String,
1641 pub advertising_channel_type: String,
1644}
1645
1646impl GetTargetInterestsParams {
1647 pub fn new(
1649 location_id: impl Into<String>,
1650 type_: impl Into<String>,
1651 advertising_channel_type: impl Into<String>,
1652 ) -> Self {
1653 Self {
1654 location_id: location_id.into(),
1655 type_: type_.into(),
1656 advertising_channel_type: advertising_channel_type.into(),
1657 }
1658 }
1659
1660 fn to_query(&self) -> Vec<(String, String)> {
1661 let q: Vec<(String, String)> = vec![
1662 ("locationId".into(), self.location_id.clone()),
1663 ("type".into(), self.type_.clone()),
1664 (
1665 "advertisingChannelType".into(),
1666 self.advertising_channel_type.clone(),
1667 ),
1668 ];
1669 q
1670 }
1671}
1672
1673#[derive(Debug, Clone, Default)]
1675pub struct SearchTargetingOptionsOpParams {
1676 pub type_: String,
1679 pub query: Option<String>,
1681 pub location_id: String,
1684}
1685
1686impl SearchTargetingOptionsOpParams {
1687 pub fn new(type_: impl Into<String>, location_id: impl Into<String>) -> Self {
1689 Self {
1690 type_: type_.into(),
1691 location_id: location_id.into(),
1692 ..Default::default()
1693 }
1694 }
1695
1696 pub fn query(mut self, v: impl Into<String>) -> Self {
1698 self.query = Some(v.into());
1699 self
1700 }
1701
1702 fn to_query(&self) -> Vec<(String, String)> {
1703 let mut q: Vec<(String, String)> = vec![
1704 ("type".into(), self.type_.clone()),
1705 ("locationId".into(), self.location_id.clone()),
1706 ];
1707 if let Some(v) = &self.query {
1708 q.push(("query".into(), v.to_string()));
1709 }
1710 q
1711 }
1712}
1713
1714#[derive(Debug, Clone, Default)]
1716pub struct DeleteAdAccountOp2Params {
1717 pub location_id: String,
1720 pub ad_account_id: String,
1723}
1724
1725impl DeleteAdAccountOp2Params {
1726 pub fn new(location_id: impl Into<String>, ad_account_id: impl Into<String>) -> Self {
1728 Self {
1729 location_id: location_id.into(),
1730 ad_account_id: ad_account_id.into(),
1731 }
1732 }
1733
1734 fn to_query(&self) -> Vec<(String, String)> {
1735 let q: Vec<(String, String)> = vec![
1736 ("locationId".into(), self.location_id.clone()),
1737 ("adAccountId".into(), self.ad_account_id.clone()),
1738 ];
1739 q
1740 }
1741}
1742
1743#[derive(Debug, Clone, Default)]
1745pub struct GetAdAccountDetailsOp2Params {
1746 pub location_id: String,
1749 pub ad_account_id: String,
1752}
1753
1754impl GetAdAccountDetailsOp2Params {
1755 pub fn new(location_id: impl Into<String>, ad_account_id: impl Into<String>) -> Self {
1757 Self {
1758 location_id: location_id.into(),
1759 ad_account_id: ad_account_id.into(),
1760 }
1761 }
1762
1763 fn to_query(&self) -> Vec<(String, String)> {
1764 let q: Vec<(String, String)> = vec![
1765 ("locationId".into(), self.location_id.clone()),
1766 ("adAccountId".into(), self.ad_account_id.clone()),
1767 ];
1768 q
1769 }
1770}
1771
1772#[derive(Debug, Clone, Default)]
1774pub struct GetLinkedInAdAccountsParams {
1775 pub location_id: String,
1778}
1779
1780impl GetLinkedInAdAccountsParams {
1781 pub fn new(location_id: impl Into<String>) -> Self {
1783 Self {
1784 location_id: location_id.into(),
1785 }
1786 }
1787
1788 fn to_query(&self) -> Vec<(String, String)> {
1789 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1790 q
1791 }
1792}
1793
1794#[derive(Debug, Clone, Default)]
1796pub struct GetAdCampaignGroupParams {
1797 pub location_id: String,
1800}
1801
1802impl GetAdCampaignGroupParams {
1803 pub fn new(location_id: impl Into<String>) -> Self {
1805 Self {
1806 location_id: location_id.into(),
1807 }
1808 }
1809
1810 fn to_query(&self) -> Vec<(String, String)> {
1811 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1812 q
1813 }
1814}
1815
1816#[derive(Debug, Clone, Default)]
1818pub struct GetLinkedInIntegrationParams {
1819 pub location_id: String,
1822}
1823
1824impl GetLinkedInIntegrationParams {
1825 pub fn new(location_id: impl Into<String>) -> Self {
1827 Self {
1828 location_id: location_id.into(),
1829 }
1830 }
1831
1832 fn to_query(&self) -> Vec<(String, String)> {
1833 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1834 q
1835 }
1836}
1837
1838#[derive(Debug, Clone, Default)]
1840pub struct GetCurrentLinkedInUserParams {
1841 pub location_id: String,
1844}
1845
1846impl GetCurrentLinkedInUserParams {
1847 pub fn new(location_id: impl Into<String>) -> Self {
1849 Self {
1850 location_id: location_id.into(),
1851 }
1852 }
1853
1854 fn to_query(&self) -> Vec<(String, String)> {
1855 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
1856 q
1857 }
1858}
1859
1860#[derive(Debug, Clone, Default)]
1862pub struct GetAdAnalyticsParams {
1863 pub location_id: String,
1866 pub pivot: Option<String>,
1869 pub group_by: Option<String>,
1872 pub start_date: String,
1875 pub end_date: String,
1878 pub entity_urns: Option<String>,
1880 pub fields: Option<String>,
1882}
1883
1884impl GetAdAnalyticsParams {
1885 pub fn new(
1887 location_id: impl Into<String>,
1888 start_date: impl Into<String>,
1889 end_date: impl Into<String>,
1890 ) -> Self {
1891 Self {
1892 location_id: location_id.into(),
1893 start_date: start_date.into(),
1894 end_date: end_date.into(),
1895 ..Default::default()
1896 }
1897 }
1898
1899 pub fn pivot(mut self, v: impl Into<String>) -> Self {
1901 self.pivot = Some(v.into());
1902 self
1903 }
1904
1905 pub fn group_by(mut self, v: impl Into<String>) -> Self {
1907 self.group_by = Some(v.into());
1908 self
1909 }
1910
1911 pub fn entity_urns(mut self, v: impl Into<String>) -> Self {
1913 self.entity_urns = Some(v.into());
1914 self
1915 }
1916
1917 pub fn fields(mut self, v: impl Into<String>) -> Self {
1919 self.fields = Some(v.into());
1920 self
1921 }
1922
1923 fn to_query(&self) -> Vec<(String, String)> {
1924 let mut q: Vec<(String, String)> = vec![
1925 ("locationId".into(), self.location_id.clone()),
1926 ("startDate".into(), self.start_date.clone()),
1927 ("endDate".into(), self.end_date.clone()),
1928 ];
1929 if let Some(v) = &self.pivot {
1930 q.push(("pivot".into(), v.to_string()));
1931 }
1932 if let Some(v) = &self.group_by {
1933 q.push(("groupBy".into(), v.to_string()));
1934 }
1935 if let Some(v) = &self.entity_urns {
1936 q.push(("entityUrns".into(), v.to_string()));
1937 }
1938 if let Some(v) = &self.fields {
1939 q.push(("fields".into(), v.to_string()));
1940 }
1941 q
1942 }
1943}
1944
1945#[derive(Debug, Clone, Default)]
1947pub struct GetCampaignGroupReportingParams {
1948 pub location_id: String,
1951 pub start_date: String,
1954 pub end_date: String,
1957 pub fields: Option<String>,
1959 pub campaign_group_id: Option<String>,
1961}
1962
1963impl GetCampaignGroupReportingParams {
1964 pub fn new(
1966 location_id: impl Into<String>,
1967 start_date: impl Into<String>,
1968 end_date: impl Into<String>,
1969 ) -> Self {
1970 Self {
1971 location_id: location_id.into(),
1972 start_date: start_date.into(),
1973 end_date: end_date.into(),
1974 ..Default::default()
1975 }
1976 }
1977
1978 pub fn fields(mut self, v: impl Into<String>) -> Self {
1980 self.fields = Some(v.into());
1981 self
1982 }
1983
1984 pub fn campaign_group_id(mut self, v: impl Into<String>) -> Self {
1986 self.campaign_group_id = Some(v.into());
1987 self
1988 }
1989
1990 fn to_query(&self) -> Vec<(String, String)> {
1991 let mut q: Vec<(String, String)> = vec![
1992 ("locationId".into(), self.location_id.clone()),
1993 ("startDate".into(), self.start_date.clone()),
1994 ("endDate".into(), self.end_date.clone()),
1995 ];
1996 if let Some(v) = &self.fields {
1997 q.push(("fields".into(), v.to_string()));
1998 }
1999 if let Some(v) = &self.campaign_group_id {
2000 q.push(("campaignGroupId".into(), v.to_string()));
2001 }
2002 q
2003 }
2004}
2005
2006#[derive(Debug, Clone, Default)]
2008pub struct GetReportingListOp2Params {
2009 pub location_id: String,
2012 pub list_type: String,
2015 pub campaign_id: String,
2018 pub campaign_group_id: String,
2021 pub start_date: String,
2024 pub end_date: String,
2027 pub fields: Option<String>,
2029}
2030
2031impl GetReportingListOp2Params {
2032 pub fn new(
2034 location_id: impl Into<String>,
2035 list_type: impl Into<String>,
2036 campaign_id: impl Into<String>,
2037 campaign_group_id: impl Into<String>,
2038 start_date: impl Into<String>,
2039 end_date: impl Into<String>,
2040 ) -> Self {
2041 Self {
2042 location_id: location_id.into(),
2043 list_type: list_type.into(),
2044 campaign_id: campaign_id.into(),
2045 campaign_group_id: campaign_group_id.into(),
2046 start_date: start_date.into(),
2047 end_date: end_date.into(),
2048 ..Default::default()
2049 }
2050 }
2051
2052 pub fn fields(mut self, v: impl Into<String>) -> Self {
2054 self.fields = Some(v.into());
2055 self
2056 }
2057
2058 fn to_query(&self) -> Vec<(String, String)> {
2059 let mut q: Vec<(String, String)> = vec![
2060 ("locationId".into(), self.location_id.clone()),
2061 ("listType".into(), self.list_type.clone()),
2062 ("campaignId".into(), self.campaign_id.clone()),
2063 ("campaignGroupId".into(), self.campaign_group_id.clone()),
2064 ("startDate".into(), self.start_date.clone()),
2065 ("endDate".into(), self.end_date.clone()),
2066 ];
2067 if let Some(v) = &self.fields {
2068 q.push(("fields".into(), v.to_string()));
2069 }
2070 q
2071 }
2072}
2073
2074#[derive(Debug, Clone, Default)]
2076pub struct SearchTargetingOptionsOp2Params {
2077 pub location_id: String,
2080 pub facet: String,
2083 pub query: Option<String>,
2085 pub q: Option<String>,
2087}
2088
2089impl SearchTargetingOptionsOp2Params {
2090 pub fn new(location_id: impl Into<String>, facet: impl Into<String>) -> Self {
2092 Self {
2093 location_id: location_id.into(),
2094 facet: facet.into(),
2095 ..Default::default()
2096 }
2097 }
2098
2099 pub fn query(mut self, v: impl Into<String>) -> Self {
2101 self.query = Some(v.into());
2102 self
2103 }
2104
2105 pub fn q(mut self, v: impl Into<String>) -> Self {
2107 self.q = Some(v.into());
2108 self
2109 }
2110
2111 fn to_query(&self) -> Vec<(String, String)> {
2112 let mut q: Vec<(String, String)> = vec![
2113 ("locationId".into(), self.location_id.clone()),
2114 ("facet".into(), self.facet.clone()),
2115 ];
2116 if let Some(v) = &self.query {
2117 q.push(("query".into(), v.to_string()));
2118 }
2119 if let Some(v) = &self.q {
2120 q.push(("q".into(), v.to_string()));
2121 }
2122 q
2123 }
2124}
2125
2126#[derive(Debug, Clone, Default)]
2128pub struct CreateLeadFormParams {
2129 pub location_id: String,
2132}
2133
2134impl CreateLeadFormParams {
2135 pub fn new(location_id: impl Into<String>) -> Self {
2137 Self {
2138 location_id: location_id.into(),
2139 }
2140 }
2141
2142 fn to_query(&self) -> Vec<(String, String)> {
2143 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
2144 q
2145 }
2146}
2147
2148#[derive(Debug, Clone, Default)]
2150pub struct GetLeadFormsParams {
2151 pub location_id: String,
2154}
2155
2156impl GetLeadFormsParams {
2157 pub fn new(location_id: impl Into<String>) -> Self {
2159 Self {
2160 location_id: location_id.into(),
2161 }
2162 }
2163
2164 fn to_query(&self) -> Vec<(String, String)> {
2165 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
2166 q
2167 }
2168}
2169
2170#[derive(Debug, Clone, Default)]
2172pub struct UpdateAdStatusParams {
2173 pub location_id: String,
2176}
2177
2178impl UpdateAdStatusParams {
2179 pub fn new(location_id: impl Into<String>) -> Self {
2181 Self {
2182 location_id: location_id.into(),
2183 }
2184 }
2185
2186 fn to_query(&self) -> Vec<(String, String)> {
2187 let q: Vec<(String, String)> = vec![("locationId".into(), self.location_id.clone())];
2188 q
2189 }
2190}
2191
2192impl AdManagerService {
2193 pub async fn get_ad_accounts(&self, params: &GetAdAccountsParams) -> Result<serde_json::Value> {
2201 let query = params.to_query();
2202 self.client
2203 .send_versioned(
2204 reqwest::Method::GET,
2205 "/ad-publishing/facebook/ad-accounts",
2206 &query,
2207 None::<&()>,
2208 Some("2021-07-28"),
2209 )
2210 .await
2211 }
2212
2213 pub async fn delete_ad_account(
2221 &self,
2222 ad_account_id: &str,
2223 body: &models::LocationIdBodyDTO,
2224 ) -> Result<serde_json::Value> {
2225 let path = format!(
2226 "/ad-publishing/facebook/ad-accounts/{}",
2227 crate::services::encode(ad_account_id)
2228 );
2229 let query = Vec::new();
2230 self.client
2231 .send_versioned(
2232 reqwest::Method::DELETE,
2233 &path,
2234 &query,
2235 Some(body),
2236 Some("2021-07-28"),
2237 )
2238 .await
2239 }
2240
2241 pub async fn get_ad_account_details(
2249 &self,
2250 ad_account_id: &str,
2251 params: &GetAdAccountDetailsParams,
2252 ) -> Result<serde_json::Value> {
2253 let path = format!(
2254 "/ad-publishing/facebook/ad-accounts/{}",
2255 crate::services::encode(ad_account_id)
2256 );
2257 let query = params.to_query();
2258 self.client
2259 .send_versioned(
2260 reqwest::Method::GET,
2261 &path,
2262 &query,
2263 None::<&()>,
2264 Some("2021-07-28"),
2265 )
2266 .await
2267 }
2268
2269 pub async fn upsert_ad(&self, body: &models::UpsertAdDTO) -> Result<serde_json::Value> {
2277 let query = Vec::new();
2278 self.client
2279 .send_versioned(
2280 reqwest::Method::PUT,
2281 "/ad-publishing/facebook/ads-v2",
2282 &query,
2283 Some(body),
2284 Some("2021-07-28"),
2285 )
2286 .await
2287 }
2288
2289 pub async fn delete_ad(
2297 &self,
2298 ad_id: &str,
2299 body: &models::LocationIdBodyDTO,
2300 ) -> Result<serde_json::Value> {
2301 let path = format!(
2302 "/ad-publishing/facebook/ads/{}",
2303 crate::services::encode(ad_id)
2304 );
2305 let query = Vec::new();
2306 self.client
2307 .send_versioned(
2308 reqwest::Method::DELETE,
2309 &path,
2310 &query,
2311 Some(body),
2312 Some("2021-07-28"),
2313 )
2314 .await
2315 }
2316
2317 pub async fn duplicate_ad(&self, ad_id: &str) -> Result<serde_json::Value> {
2325 let path = format!(
2326 "/ad-publishing/facebook/ads/{}/duplicate",
2327 crate::services::encode(ad_id)
2328 );
2329 let query = Vec::new();
2330 self.client
2331 .send_versioned(
2332 reqwest::Method::POST,
2333 &path,
2334 &query,
2335 None::<&()>,
2336 Some("2021-07-28"),
2337 )
2338 .await
2339 }
2340
2341 pub async fn pause_ad(
2349 &self,
2350 ad_id: &str,
2351 body: &models::LocationIdBodyDTO,
2352 ) -> Result<serde_json::Value> {
2353 let path = format!(
2354 "/ad-publishing/facebook/ads/{}/pause",
2355 crate::services::encode(ad_id)
2356 );
2357 let query = Vec::new();
2358 self.client
2359 .send_versioned(
2360 reqwest::Method::POST,
2361 &path,
2362 &query,
2363 Some(body),
2364 Some("2021-07-28"),
2365 )
2366 .await
2367 }
2368
2369 pub async fn resume_ad(
2377 &self,
2378 ad_id: &str,
2379 body: &models::LocationIdBodyDTO,
2380 ) -> Result<serde_json::Value> {
2381 let path = format!(
2382 "/ad-publishing/facebook/ads/{}/resume",
2383 crate::services::encode(ad_id)
2384 );
2385 let query = Vec::new();
2386 self.client
2387 .send_versioned(
2388 reqwest::Method::POST,
2389 &path,
2390 &query,
2391 Some(body),
2392 Some("2021-07-28"),
2393 )
2394 .await
2395 }
2396
2397 pub async fn upsert_adset(&self, body: &models::UpsertAdsetDTO) -> Result<serde_json::Value> {
2405 let query = Vec::new();
2406 self.client
2407 .send_versioned(
2408 reqwest::Method::PUT,
2409 "/ad-publishing/facebook/adsets",
2410 &query,
2411 Some(body),
2412 Some("2021-07-28"),
2413 )
2414 .await
2415 }
2416
2417 pub async fn delete_ad_set(
2425 &self,
2426 adset_id: &str,
2427 body: &models::LocationIdBodyDTO,
2428 ) -> Result<serde_json::Value> {
2429 let path = format!(
2430 "/ad-publishing/facebook/adsets/{}",
2431 crate::services::encode(adset_id)
2432 );
2433 let query = Vec::new();
2434 self.client
2435 .send_versioned(
2436 reqwest::Method::DELETE,
2437 &path,
2438 &query,
2439 Some(body),
2440 Some("2021-07-28"),
2441 )
2442 .await
2443 }
2444
2445 pub async fn duplicate_ad_set(&self, adset_id: &str) -> Result<serde_json::Value> {
2453 let path = format!(
2454 "/ad-publishing/facebook/adsets/{}/duplicate",
2455 crate::services::encode(adset_id)
2456 );
2457 let query = Vec::new();
2458 self.client
2459 .send_versioned(
2460 reqwest::Method::POST,
2461 &path,
2462 &query,
2463 None::<&()>,
2464 Some("2021-07-28"),
2465 )
2466 .await
2467 }
2468
2469 pub async fn pause_ad_set(
2477 &self,
2478 adset_id: &str,
2479 body: &models::LocationIdBodyDTO,
2480 ) -> Result<serde_json::Value> {
2481 let path = format!(
2482 "/ad-publishing/facebook/adsets/{}/pause",
2483 crate::services::encode(adset_id)
2484 );
2485 let query = Vec::new();
2486 self.client
2487 .send_versioned(
2488 reqwest::Method::POST,
2489 &path,
2490 &query,
2491 Some(body),
2492 Some("2021-07-28"),
2493 )
2494 .await
2495 }
2496
2497 pub async fn resume_ad_set(
2505 &self,
2506 adset_id: &str,
2507 body: &models::LocationIdBodyDTO,
2508 ) -> Result<serde_json::Value> {
2509 let path = format!(
2510 "/ad-publishing/facebook/adsets/{}/resume",
2511 crate::services::encode(adset_id)
2512 );
2513 let query = Vec::new();
2514 self.client
2515 .send_versioned(
2516 reqwest::Method::POST,
2517 &path,
2518 &query,
2519 Some(body),
2520 Some("2021-07-28"),
2521 )
2522 .await
2523 }
2524
2525 pub async fn get_campaign_with_linked_entities(
2533 &self,
2534 campaign_id: &str,
2535 params: &GetCampaignWithLinkedEntitiesParams,
2536 ) -> Result<serde_json::Value> {
2537 let path = format!(
2538 "/ad-publishing/facebook/campaign/{}",
2539 crate::services::encode(campaign_id)
2540 );
2541 let query = params.to_query();
2542 self.client
2543 .send_versioned(
2544 reqwest::Method::GET,
2545 &path,
2546 &query,
2547 None::<&()>,
2548 Some("2021-07-28"),
2549 )
2550 .await
2551 }
2552
2553 pub async fn upsert_campaign(
2561 &self,
2562 body: &models::UpsertCampaignDTO,
2563 ) -> Result<serde_json::Value> {
2564 let query = Vec::new();
2565 self.client
2566 .send_versioned(
2567 reqwest::Method::PUT,
2568 "/ad-publishing/facebook/campaigns",
2569 &query,
2570 Some(body),
2571 Some("2021-07-28"),
2572 )
2573 .await
2574 }
2575
2576 pub async fn delete_campaign(
2584 &self,
2585 campaign_id: &str,
2586 body: &models::LocationIdBodyDTO,
2587 ) -> Result<serde_json::Value> {
2588 let path = format!(
2589 "/ad-publishing/facebook/campaigns/{}",
2590 crate::services::encode(campaign_id)
2591 );
2592 let query = Vec::new();
2593 self.client
2594 .send_versioned(
2595 reqwest::Method::DELETE,
2596 &path,
2597 &query,
2598 Some(body),
2599 Some("2021-07-28"),
2600 )
2601 .await
2602 }
2603
2604 pub async fn duplicate_campaign(
2612 &self,
2613 campaign_id: &str,
2614 body: &models::LocationIdBodyDTO,
2615 ) -> Result<serde_json::Value> {
2616 let path = format!(
2617 "/ad-publishing/facebook/campaigns/{}/duplicate",
2618 crate::services::encode(campaign_id)
2619 );
2620 let query = Vec::new();
2621 self.client
2622 .send_versioned(
2623 reqwest::Method::POST,
2624 &path,
2625 &query,
2626 Some(body),
2627 Some("2021-07-28"),
2628 )
2629 .await
2630 }
2631
2632 pub async fn pause_campaign(
2640 &self,
2641 campaign_id: &str,
2642 body: &models::LocationIdBodyDTO,
2643 ) -> Result<serde_json::Value> {
2644 let path = format!(
2645 "/ad-publishing/facebook/campaigns/{}/pause",
2646 crate::services::encode(campaign_id)
2647 );
2648 let query = Vec::new();
2649 self.client
2650 .send_versioned(
2651 reqwest::Method::POST,
2652 &path,
2653 &query,
2654 Some(body),
2655 Some("2021-07-28"),
2656 )
2657 .await
2658 }
2659
2660 pub async fn publish_campaign(
2668 &self,
2669 campaign_id: &str,
2670 body: &models::PublishAdDTO,
2671 ) -> Result<serde_json::Value> {
2672 let path = format!(
2673 "/ad-publishing/facebook/campaigns/{}/publish",
2674 crate::services::encode(campaign_id)
2675 );
2676 let query = Vec::new();
2677 self.client
2678 .send_versioned(
2679 reqwest::Method::POST,
2680 &path,
2681 &query,
2682 Some(body),
2683 Some("2021-07-28"),
2684 )
2685 .await
2686 }
2687
2688 pub async fn resume_campaign(
2696 &self,
2697 campaign_id: &str,
2698 body: &models::LocationIdBodyDTO,
2699 ) -> Result<serde_json::Value> {
2700 let path = format!(
2701 "/ad-publishing/facebook/campaigns/{}/resume",
2702 crate::services::encode(campaign_id)
2703 );
2704 let query = Vec::new();
2705 self.client
2706 .send_versioned(
2707 reqwest::Method::POST,
2708 &path,
2709 &query,
2710 Some(body),
2711 Some("2021-07-28"),
2712 )
2713 .await
2714 }
2715
2716 pub async fn get_conversation_forms(
2724 &self,
2725 params: &GetConversationFormsParams,
2726 ) -> Result<serde_json::Value> {
2727 let query = params.to_query();
2728 self.client
2729 .send_versioned(
2730 reqwest::Method::GET,
2731 "/ad-publishing/facebook/conversation-forms",
2732 &query,
2733 None::<&()>,
2734 Some("2021-07-28"),
2735 )
2736 .await
2737 }
2738
2739 pub async fn create_conversation_form(
2747 &self,
2748 body: &models::CreateConversationFormDTO,
2749 ) -> Result<serde_json::Value> {
2750 let query = Vec::new();
2751 self.client
2752 .send_versioned(
2753 reqwest::Method::POST,
2754 "/ad-publishing/facebook/conversation-forms",
2755 &query,
2756 Some(body),
2757 Some("2021-07-28"),
2758 )
2759 .await
2760 }
2761
2762 pub async fn get_custom_audiences(
2770 &self,
2771 params: &GetCustomAudiencesParams,
2772 ) -> Result<serde_json::Value> {
2773 let query = params.to_query();
2774 self.client
2775 .send_versioned(
2776 reqwest::Method::GET,
2777 "/ad-publishing/facebook/custom-audience",
2778 &query,
2779 None::<&()>,
2780 Some("2021-07-28"),
2781 )
2782 .await
2783 }
2784
2785 pub async fn delete_custom_audience(
2793 &self,
2794 audience_id: &str,
2795 params: &DeleteCustomAudienceParams,
2796 ) -> Result<serde_json::Value> {
2797 let path = format!(
2798 "/ad-publishing/facebook/custom-audience/{}",
2799 crate::services::encode(audience_id)
2800 );
2801 let query = params.to_query();
2802 self.client
2803 .send_versioned(
2804 reqwest::Method::DELETE,
2805 &path,
2806 &query,
2807 None::<&()>,
2808 Some("2021-07-28"),
2809 )
2810 .await
2811 }
2812
2813 pub async fn get_custom_audience_by_id(
2821 &self,
2822 audience_id: &str,
2823 params: &GetCustomAudienceByIdParams,
2824 ) -> Result<serde_json::Value> {
2825 let path = format!(
2826 "/ad-publishing/facebook/custom-audience/{}",
2827 crate::services::encode(audience_id)
2828 );
2829 let query = params.to_query();
2830 self.client
2831 .send_versioned(
2832 reqwest::Method::GET,
2833 &path,
2834 &query,
2835 None::<&()>,
2836 Some("2021-07-28"),
2837 )
2838 .await
2839 }
2840
2841 pub async fn update_custom_audience(
2849 &self,
2850 audience_id: &str,
2851 body: &models::FbUpdateAudienceBodyDTO,
2852 ) -> Result<serde_json::Value> {
2853 let path = format!(
2854 "/ad-publishing/facebook/custom-audience/{}",
2855 crate::services::encode(audience_id)
2856 );
2857 let query = Vec::new();
2858 self.client
2859 .send_versioned(
2860 reqwest::Method::PUT,
2861 &path,
2862 &query,
2863 Some(body),
2864 Some("2021-07-28"),
2865 )
2866 .await
2867 }
2868
2869 pub async fn remove_custom_audience_member(
2877 &self,
2878 audience_id: &str,
2879 body: &models::UpdateCustomAudienceDTO,
2880 ) -> Result<serde_json::Value> {
2881 let path = format!(
2882 "/ad-publishing/facebook/custom-audience/{}/member",
2883 crate::services::encode(audience_id)
2884 );
2885 let query = Vec::new();
2886 self.client
2887 .send_versioned(
2888 reqwest::Method::DELETE,
2889 &path,
2890 &query,
2891 Some(body),
2892 Some("2021-07-28"),
2893 )
2894 .await
2895 }
2896
2897 pub async fn add_custom_audience_member(
2905 &self,
2906 audience_id: &str,
2907 body: &models::UpdateCustomAudienceDTO,
2908 ) -> Result<serde_json::Value> {
2909 let path = format!(
2910 "/ad-publishing/facebook/custom-audience/{}/member",
2911 crate::services::encode(audience_id)
2912 );
2913 let query = Vec::new();
2914 self.client
2915 .send_versioned(
2916 reqwest::Method::PUT,
2917 &path,
2918 &query,
2919 Some(body),
2920 Some("2021-07-28"),
2921 )
2922 .await
2923 }
2924
2925 pub async fn batch_update_audience_members(
2933 &self,
2934 audience_id: &str,
2935 body: &models::UpdateCustomAudienceBatchDTO,
2936 ) -> Result<serde_json::Value> {
2937 let path = format!(
2938 "/ad-publishing/facebook/custom-audience/{}/member/batch",
2939 crate::services::encode(audience_id)
2940 );
2941 let query = Vec::new();
2942 self.client
2943 .send_versioned(
2944 reqwest::Method::PUT,
2945 &path,
2946 &query,
2947 Some(body),
2948 Some("2021-07-28"),
2949 )
2950 .await
2951 }
2952
2953 pub async fn get_entities(&self, params: &GetEntitiesParams) -> Result<serde_json::Value> {
2961 let query = params.to_query();
2962 self.client
2963 .send_versioned(
2964 reqwest::Method::GET,
2965 "/ad-publishing/facebook/entity",
2966 &query,
2967 None::<&()>,
2968 Some("2021-07-28"),
2969 )
2970 .await
2971 }
2972
2973 pub async fn delete_facebook_integration(
2981 &self,
2982 body: &models::LocationIdBodyDTO,
2983 ) -> Result<serde_json::Value> {
2984 let query = Vec::new();
2985 self.client
2986 .send_versioned(
2987 reqwest::Method::DELETE,
2988 "/ad-publishing/facebook/integration",
2989 &query,
2990 Some(body),
2991 Some("2021-07-28"),
2992 )
2993 .await
2994 }
2995
2996 pub async fn get_facebook_integration(
3004 &self,
3005 params: &GetFacebookIntegrationParams,
3006 ) -> Result<serde_json::Value> {
3007 let query = params.to_query();
3008 self.client
3009 .send_versioned(
3010 reqwest::Method::GET,
3011 "/ad-publishing/facebook/integration",
3012 &query,
3013 None::<&()>,
3014 Some("2021-07-28"),
3015 )
3016 .await
3017 }
3018
3019 pub async fn create_facebook_integration(
3027 &self,
3028 body: &models::CreateIntegrationDTO,
3029 ) -> Result<serde_json::Value> {
3030 let query = Vec::new();
3031 self.client
3032 .send_versioned(
3033 reqwest::Method::POST,
3034 "/ad-publishing/facebook/integration",
3035 &query,
3036 Some(body),
3037 Some("2021-07-28"),
3038 )
3039 .await
3040 }
3041
3042 pub async fn get_lead_form_by_id(
3050 &self,
3051 lead_form_id: &str,
3052 params: &GetLeadFormByIdParams,
3053 ) -> Result<serde_json::Value> {
3054 let path = format!(
3055 "/ad-publishing/facebook/lead-form/{}",
3056 crate::services::encode(lead_form_id)
3057 );
3058 let query = params.to_query();
3059 self.client
3060 .send_versioned(
3061 reqwest::Method::GET,
3062 &path,
3063 &query,
3064 None::<&()>,
3065 Some("2021-07-28"),
3066 )
3067 .await
3068 }
3069
3070 pub async fn get_current_facebook_user(
3078 &self,
3079 params: &GetCurrentFacebookUserParams,
3080 ) -> Result<serde_json::Value> {
3081 let query = params.to_query();
3082 self.client
3083 .send_versioned(
3084 reqwest::Method::GET,
3085 "/ad-publishing/facebook/me",
3086 &query,
3087 None::<&()>,
3088 Some("2021-07-28"),
3089 )
3090 .await
3091 }
3092
3093 pub async fn delete_page_connection(
3101 &self,
3102 params: &DeletePageConnectionParams,
3103 ) -> Result<serde_json::Value> {
3104 let query = params.to_query();
3105 self.client
3106 .send_versioned(
3107 reqwest::Method::DELETE,
3108 "/ad-publishing/facebook/page",
3109 &query,
3110 None::<&()>,
3111 Some("2021-07-28"),
3112 )
3113 .await
3114 }
3115
3116 pub async fn set_default_page(
3124 &self,
3125 params: &SetDefaultPageParams,
3126 body: &models::FbSetDefaultPageBodyDTO,
3127 ) -> Result<serde_json::Value> {
3128 let query = params.to_query();
3129 self.client
3130 .send_versioned(
3131 reqwest::Method::PUT,
3132 "/ad-publishing/facebook/page/default",
3133 &query,
3134 Some(body),
3135 Some("2021-07-28"),
3136 )
3137 .await
3138 }
3139
3140 pub async fn get_page_lead_forms(
3148 &self,
3149 page_id: &str,
3150 params: &GetPageLeadFormsParams,
3151 ) -> Result<serde_json::Value> {
3152 let path = format!(
3153 "/ad-publishing/facebook/page/{}/forms",
3154 crate::services::encode(page_id)
3155 );
3156 let query = params.to_query();
3157 self.client
3158 .send_versioned(
3159 reqwest::Method::GET,
3160 &path,
3161 &query,
3162 None::<&()>,
3163 Some("2021-07-28"),
3164 )
3165 .await
3166 }
3167
3168 pub async fn create_page_lead_form(
3176 &self,
3177 page_id: &str,
3178 body: &models::CreateLeadFormDTO,
3179 ) -> Result<serde_json::Value> {
3180 let path = format!(
3181 "/ad-publishing/facebook/page/{}/forms",
3182 crate::services::encode(page_id)
3183 );
3184 let query = Vec::new();
3185 self.client
3186 .send_versioned(
3187 reqwest::Method::POST,
3188 &path,
3189 &query,
3190 Some(body),
3191 Some("2021-07-28"),
3192 )
3193 .await
3194 }
3195
3196 pub async fn get_instagram_accounts_for_page(
3204 &self,
3205 page_id: &str,
3206 params: &GetInstagramAccountsForPageParams,
3207 ) -> Result<serde_json::Value> {
3208 let path = format!(
3209 "/ad-publishing/facebook/page/{}/instagram",
3210 crate::services::encode(page_id)
3211 );
3212 let query = params.to_query();
3213 self.client
3214 .send_versioned(
3215 reqwest::Method::GET,
3216 &path,
3217 &query,
3218 None::<&()>,
3219 Some("2021-07-28"),
3220 )
3221 .await
3222 }
3223
3224 pub async fn get_facebook_pages(
3232 &self,
3233 params: &GetFacebookPagesParams,
3234 ) -> Result<serde_json::Value> {
3235 let query = params.to_query();
3236 self.client
3237 .send_versioned(
3238 reqwest::Method::GET,
3239 "/ad-publishing/facebook/pages",
3240 &query,
3241 None::<&()>,
3242 Some("2021-07-28"),
3243 )
3244 .await
3245 }
3246
3247 pub async fn get_conversion_pixels(
3255 &self,
3256 params: &GetConversionPixelsParams,
3257 ) -> Result<serde_json::Value> {
3258 let query = params.to_query();
3259 self.client
3260 .send_versioned(
3261 reqwest::Method::GET,
3262 "/ad-publishing/facebook/pixels",
3263 &query,
3264 None::<&()>,
3265 Some("2021-07-28"),
3266 )
3267 .await
3268 }
3269
3270 pub async fn upsert_conversion_pixel(
3278 &self,
3279 body: &models::UpsertConversionPixelDTO,
3280 ) -> Result<serde_json::Value> {
3281 let query = Vec::new();
3282 self.client
3283 .send_versioned(
3284 reqwest::Method::PUT,
3285 "/ad-publishing/facebook/pixels",
3286 &query,
3287 Some(body),
3288 Some("2021-07-28"),
3289 )
3290 .await
3291 }
3292
3293 pub async fn get_reporting_data(
3301 &self,
3302 params: &GetReportingDataParams,
3303 ) -> Result<serde_json::Value> {
3304 let query = params.to_query();
3305 self.client
3306 .send_versioned(
3307 reqwest::Method::GET,
3308 "/ad-publishing/facebook/reporting",
3309 &query,
3310 None::<&()>,
3311 Some("2021-07-28"),
3312 )
3313 .await
3314 }
3315
3316 pub async fn get_campaign_reporting(
3324 &self,
3325 campaign_id: &str,
3326 params: &GetCampaignReportingParams,
3327 ) -> Result<serde_json::Value> {
3328 let path = format!(
3329 "/ad-publishing/facebook/reporting/campaign/{}",
3330 crate::services::encode(campaign_id)
3331 );
3332 let query = params.to_query();
3333 self.client
3334 .send_versioned(
3335 reqwest::Method::GET,
3336 &path,
3337 &query,
3338 None::<&()>,
3339 Some("2021-07-28"),
3340 )
3341 .await
3342 }
3343
3344 pub async fn get_reporting_list(
3352 &self,
3353 params: &GetReportingListParams,
3354 ) -> Result<serde_json::Value> {
3355 let query = params.to_query();
3356 self.client
3357 .send_versioned(
3358 reqwest::Method::GET,
3359 "/ad-publishing/facebook/reporting/list",
3360 &query,
3361 None::<&()>,
3362 Some("2021-07-28"),
3363 )
3364 .await
3365 }
3366
3367 pub async fn search_targeting_options(
3373 &self,
3374 params: &SearchTargetingOptionsParams,
3375 ) -> Result<serde_json::Value> {
3376 let query = params.to_query();
3377 self.client
3378 .send_versioned(
3379 reqwest::Method::GET,
3380 "/ad-publishing/facebook/targeting/search",
3381 &query,
3382 None::<&()>,
3383 Some("2021-07-28"),
3384 )
3385 .await
3386 }
3387
3388 pub async fn get_google_ad_accounts(
3396 &self,
3397 params: &GetGoogleAdAccountsParams,
3398 ) -> Result<serde_json::Value> {
3399 let query = params.to_query();
3400 self.client
3401 .send_versioned(
3402 reqwest::Method::GET,
3403 "/ad-publishing/google/ad-accounts",
3404 &query,
3405 None::<&()>,
3406 Some("2021-07-28"),
3407 )
3408 .await
3409 }
3410
3411 pub async fn delete_ad_account_op(
3419 &self,
3420 ad_account_id: &str,
3421 body: &models::LocationIdBodyDTO,
3422 ) -> Result<serde_json::Value> {
3423 let path = format!(
3424 "/ad-publishing/google/ad-accounts/{}",
3425 crate::services::encode(ad_account_id)
3426 );
3427 let query = Vec::new();
3428 self.client
3429 .send_versioned(
3430 reqwest::Method::DELETE,
3431 &path,
3432 &query,
3433 Some(body),
3434 Some("2021-07-28"),
3435 )
3436 .await
3437 }
3438
3439 pub async fn get_ad_account_details_op(
3447 &self,
3448 ad_account_id: &str,
3449 params: &GetAdAccountDetailsOpParams,
3450 ) -> Result<serde_json::Value> {
3451 let path = format!(
3452 "/ad-publishing/google/ad-accounts/{}",
3453 crate::services::encode(ad_account_id)
3454 );
3455 let query = params.to_query();
3456 self.client
3457 .send_versioned(
3458 reqwest::Method::GET,
3459 &path,
3460 &query,
3461 None::<&()>,
3462 Some("2021-07-28"),
3463 )
3464 .await
3465 }
3466
3467 pub async fn upsert_google_campaign(
3475 &self,
3476 body: &models::CampaignDTO,
3477 ) -> Result<serde_json::Value> {
3478 let query = Vec::new();
3479 self.client
3480 .send_versioned(
3481 reqwest::Method::PUT,
3482 "/ad-publishing/google/ads",
3483 &query,
3484 Some(body),
3485 Some("2021-07-28"),
3486 )
3487 .await
3488 }
3489
3490 pub async fn get_google_campaign_by_id(
3498 &self,
3499 ad_id: &str,
3500 params: &GetGoogleCampaignByIdParams,
3501 ) -> Result<serde_json::Value> {
3502 let path = format!(
3503 "/ad-publishing/google/ads/{}",
3504 crate::services::encode(ad_id)
3505 );
3506 let query = params.to_query();
3507 self.client
3508 .send_versioned(
3509 reqwest::Method::GET,
3510 &path,
3511 &query,
3512 None::<&()>,
3513 Some("2021-07-28"),
3514 )
3515 .await
3516 }
3517
3518 pub async fn publish_ad(&self, ad_id: &str) -> Result<serde_json::Value> {
3526 let path = format!(
3527 "/ad-publishing/google/ads/{}/publish",
3528 crate::services::encode(ad_id)
3529 );
3530 let query = Vec::new();
3531 self.client
3532 .send_versioned(
3533 reqwest::Method::POST,
3534 &path,
3535 &query,
3536 None::<&()>,
3537 Some("2021-07-28"),
3538 )
3539 .await
3540 }
3541
3542 pub async fn get_assets(&self, params: &GetAssetsParams) -> Result<serde_json::Value> {
3550 let query = params.to_query();
3551 self.client
3552 .send_versioned(
3553 reqwest::Method::GET,
3554 "/ad-publishing/google/assets",
3555 &query,
3556 None::<&()>,
3557 Some("2021-07-28"),
3558 )
3559 .await
3560 }
3561
3562 pub async fn upsert_assets(&self, body: &models::UpsertAssetsDTO) -> Result<serde_json::Value> {
3570 let query = Vec::new();
3571 self.client
3572 .send_versioned(
3573 reqwest::Method::POST,
3574 "/ad-publishing/google/assets",
3575 &query,
3576 Some(body),
3577 Some("2021-07-28"),
3578 )
3579 .await
3580 }
3581
3582 pub async fn get_audiences(&self, params: &GetAudiencesParams) -> Result<serde_json::Value> {
3590 let query = params.to_query();
3591 self.client
3592 .send_versioned(
3593 reqwest::Method::GET,
3594 "/ad-publishing/google/audiences",
3595 &query,
3596 None::<&()>,
3597 Some("2021-07-28"),
3598 )
3599 .await
3600 }
3601
3602 pub async fn upsert_audience(
3610 &self,
3611 body: &models::UpsertAudienceDTO,
3612 ) -> Result<serde_json::Value> {
3613 let query = Vec::new();
3614 self.client
3615 .send_versioned(
3616 reqwest::Method::PUT,
3617 "/ad-publishing/google/audiences",
3618 &query,
3619 Some(body),
3620 Some("2021-07-28"),
3621 )
3622 .await
3623 }
3624
3625 pub async fn get_audience_by_id(
3633 &self,
3634 audience_id: &str,
3635 params: &GetAudienceByIdParams,
3636 ) -> Result<serde_json::Value> {
3637 let path = format!(
3638 "/ad-publishing/google/audiences/{}",
3639 crate::services::encode(audience_id)
3640 );
3641 let query = params.to_query();
3642 self.client
3643 .send_versioned(
3644 reqwest::Method::GET,
3645 &path,
3646 &query,
3647 None::<&()>,
3648 Some("2021-07-28"),
3649 )
3650 .await
3651 }
3652
3653 pub async fn get_conversion_goals(
3661 &self,
3662 params: &GetConversionGoalsParams,
3663 ) -> Result<serde_json::Value> {
3664 let query = params.to_query();
3665 self.client
3666 .send_versioned(
3667 reqwest::Method::GET,
3668 "/ad-publishing/google/conversion-goals",
3669 &query,
3670 None::<&()>,
3671 Some("2021-07-28"),
3672 )
3673 .await
3674 }
3675
3676 pub async fn get_conversions(
3684 &self,
3685 params: &GetConversionsParams,
3686 ) -> Result<serde_json::Value> {
3687 let query = params.to_query();
3688 self.client
3689 .send_versioned(
3690 reqwest::Method::GET,
3691 "/ad-publishing/google/conversions",
3692 &query,
3693 None::<&()>,
3694 Some("2021-07-28"),
3695 )
3696 .await
3697 }
3698
3699 pub async fn upsert_conversion(
3707 &self,
3708 body: &models::UpsertConversionDTO,
3709 ) -> Result<serde_json::Value> {
3710 let query = Vec::new();
3711 self.client
3712 .send_versioned(
3713 reqwest::Method::PUT,
3714 "/ad-publishing/google/conversions",
3715 &query,
3716 Some(body),
3717 Some("2021-07-28"),
3718 )
3719 .await
3720 }
3721
3722 pub async fn delete_conversion(
3730 &self,
3731 conversion_id: &str,
3732 params: &DeleteConversionParams,
3733 ) -> Result<serde_json::Value> {
3734 let path = format!(
3735 "/ad-publishing/google/conversions/{}",
3736 crate::services::encode(conversion_id)
3737 );
3738 let query = params.to_query();
3739 self.client
3740 .send_versioned(
3741 reqwest::Method::DELETE,
3742 &path,
3743 &query,
3744 None::<&()>,
3745 Some("2021-07-28"),
3746 )
3747 .await
3748 }
3749
3750 pub async fn get_conversion_by_id(
3758 &self,
3759 conversion_id: &str,
3760 params: &GetConversionByIdParams,
3761 ) -> Result<serde_json::Value> {
3762 let path = format!(
3763 "/ad-publishing/google/conversions/{}",
3764 crate::services::encode(conversion_id)
3765 );
3766 let query = params.to_query();
3767 self.client
3768 .send_versioned(
3769 reqwest::Method::GET,
3770 &path,
3771 &query,
3772 None::<&()>,
3773 Some("2021-07-28"),
3774 )
3775 .await
3776 }
3777
3778 pub async fn get_entities_op(&self, params: &GetEntitiesOpParams) -> Result<serde_json::Value> {
3786 let query = params.to_query();
3787 self.client
3788 .send_versioned(
3789 reqwest::Method::GET,
3790 "/ad-publishing/google/entity",
3791 &query,
3792 None::<&()>,
3793 Some("2021-07-28"),
3794 )
3795 .await
3796 }
3797
3798 pub async fn get_google_integration(
3806 &self,
3807 params: &GetGoogleIntegrationParams,
3808 ) -> Result<serde_json::Value> {
3809 let query = params.to_query();
3810 self.client
3811 .send_versioned(
3812 reqwest::Method::GET,
3813 "/ad-publishing/google/integration",
3814 &query,
3815 None::<&()>,
3816 Some("2021-07-28"),
3817 )
3818 .await
3819 }
3820
3821 pub async fn create_google_integration(
3829 &self,
3830 body: &models::CreateGoogleIntegrationDTO,
3831 ) -> Result<serde_json::Value> {
3832 let query = Vec::new();
3833 self.client
3834 .send_versioned(
3835 reqwest::Method::POST,
3836 "/ad-publishing/google/integration",
3837 &query,
3838 Some(body),
3839 Some("2021-07-28"),
3840 )
3841 .await
3842 }
3843
3844 pub async fn get_keyword_ideas(
3852 &self,
3853 params: &GetKeywordIdeasParams,
3854 body: &models::KeywordSuggestionDTO,
3855 ) -> Result<serde_json::Value> {
3856 let query = params.to_query();
3857 self.client
3858 .send_versioned(
3859 reqwest::Method::POST,
3860 "/ad-publishing/google/keyword-ideas",
3861 &query,
3862 Some(body),
3863 Some("2021-07-28"),
3864 )
3865 .await
3866 }
3867
3868 pub async fn get_current_google_user(
3876 &self,
3877 params: &GetCurrentGoogleUserParams,
3878 ) -> Result<serde_json::Value> {
3879 let query = params.to_query();
3880 self.client
3881 .send_versioned(
3882 reqwest::Method::GET,
3883 "/ad-publishing/google/me",
3884 &query,
3885 None::<&()>,
3886 Some("2021-07-28"),
3887 )
3888 .await
3889 }
3890
3891 pub async fn get_reporting_data_op(
3899 &self,
3900 params: &GetReportingDataOpParams,
3901 ) -> Result<serde_json::Value> {
3902 let query = params.to_query();
3903 self.client
3904 .send_versioned(
3905 reqwest::Method::GET,
3906 "/ad-publishing/google/reporting",
3907 &query,
3908 None::<&()>,
3909 Some("2021-07-28"),
3910 )
3911 .await
3912 }
3913
3914 pub async fn get_campaign_reporting_op(
3922 &self,
3923 campaign_id: &str,
3924 params: &GetCampaignReportingOpParams,
3925 ) -> Result<serde_json::Value> {
3926 let path = format!(
3927 "/ad-publishing/google/reporting/campaign/{}",
3928 crate::services::encode(campaign_id)
3929 );
3930 let query = params.to_query();
3931 self.client
3932 .send_versioned(
3933 reqwest::Method::GET,
3934 &path,
3935 &query,
3936 None::<&()>,
3937 Some("2021-07-28"),
3938 )
3939 .await
3940 }
3941
3942 pub async fn get_reporting_list_op(
3950 &self,
3951 params: &GetReportingListOpParams,
3952 ) -> Result<serde_json::Value> {
3953 let query = params.to_query();
3954 self.client
3955 .send_versioned(
3956 reqwest::Method::GET,
3957 "/ad-publishing/google/reporting/list",
3958 &query,
3959 None::<&()>,
3960 Some("2021-07-28"),
3961 )
3962 .await
3963 }
3964
3965 pub async fn get_segments(&self, params: &GetSegmentsParams) -> Result<serde_json::Value> {
3973 let query = params.to_query();
3974 self.client
3975 .send_versioned(
3976 reqwest::Method::GET,
3977 "/ad-publishing/google/segments",
3978 &query,
3979 None::<&()>,
3980 Some("2021-07-28"),
3981 )
3982 .await
3983 }
3984
3985 pub async fn upsert_segment(
3993 &self,
3994 params: &UpsertSegmentParams,
3995 body: &models::UpsertSegmentDTO,
3996 ) -> Result<serde_json::Value> {
3997 let query = params.to_query();
3998 self.client
3999 .send_versioned(
4000 reqwest::Method::PUT,
4001 "/ad-publishing/google/segments",
4002 &query,
4003 Some(body),
4004 Some("2021-07-28"),
4005 )
4006 .await
4007 }
4008
4009 pub async fn create_offline_user_list_job(
4017 &self,
4018 body: &models::CreateOfflineUserListJobDTO,
4019 ) -> Result<serde_json::Value> {
4020 let query = Vec::new();
4021 self.client
4022 .send_versioned(
4023 reqwest::Method::POST,
4024 "/ad-publishing/google/segments/offline-user-list-job",
4025 &query,
4026 Some(body),
4027 Some("2021-07-28"),
4028 )
4029 .await
4030 }
4031
4032 pub async fn delete_segment(
4040 &self,
4041 segment_id: &str,
4042 params: &DeleteSegmentParams,
4043 ) -> Result<serde_json::Value> {
4044 let path = format!(
4045 "/ad-publishing/google/segments/{}",
4046 crate::services::encode(segment_id)
4047 );
4048 let query = params.to_query();
4049 self.client
4050 .send_versioned(
4051 reqwest::Method::DELETE,
4052 &path,
4053 &query,
4054 None::<&()>,
4055 Some("2021-07-28"),
4056 )
4057 .await
4058 }
4059
4060 pub async fn get_segment_by_id(
4068 &self,
4069 segment_id: &str,
4070 params: &GetSegmentByIdParams,
4071 ) -> Result<serde_json::Value> {
4072 let path = format!(
4073 "/ad-publishing/google/segments/{}",
4074 crate::services::encode(segment_id)
4075 );
4076 let query = params.to_query();
4077 self.client
4078 .send_versioned(
4079 reqwest::Method::GET,
4080 &path,
4081 &query,
4082 None::<&()>,
4083 Some("2021-07-28"),
4084 )
4085 .await
4086 }
4087
4088 pub async fn get_target_interests(
4096 &self,
4097 params: &GetTargetInterestsParams,
4098 ) -> Result<serde_json::Value> {
4099 let query = params.to_query();
4100 self.client
4101 .send_versioned(
4102 reqwest::Method::GET,
4103 "/ad-publishing/google/target-interests",
4104 &query,
4105 None::<&()>,
4106 Some("2021-07-28"),
4107 )
4108 .await
4109 }
4110
4111 pub async fn search_targeting_options_op(
4119 &self,
4120 params: &SearchTargetingOptionsOpParams,
4121 ) -> Result<serde_json::Value> {
4122 let query = params.to_query();
4123 self.client
4124 .send_versioned(
4125 reqwest::Method::GET,
4126 "/ad-publishing/google/targeting/search",
4127 &query,
4128 None::<&()>,
4129 Some("2021-07-28"),
4130 )
4131 .await
4132 }
4133
4134 pub async fn delete_ad_account_op2(
4142 &self,
4143 params: &DeleteAdAccountOp2Params,
4144 ) -> Result<serde_json::Value> {
4145 let query = params.to_query();
4146 self.client
4147 .send_versioned(
4148 reqwest::Method::DELETE,
4149 "/ad-publishing/linkedin/ad-account",
4150 &query,
4151 None::<&()>,
4152 Some("2021-07-28"),
4153 )
4154 .await
4155 }
4156
4157 pub async fn get_ad_account_details_op2(
4165 &self,
4166 params: &GetAdAccountDetailsOp2Params,
4167 ) -> Result<serde_json::Value> {
4168 let query = params.to_query();
4169 self.client
4170 .send_versioned(
4171 reqwest::Method::GET,
4172 "/ad-publishing/linkedin/ad-account",
4173 &query,
4174 None::<&()>,
4175 Some("2021-07-28"),
4176 )
4177 .await
4178 }
4179
4180 pub async fn get_linked_in_ad_accounts(
4188 &self,
4189 params: &GetLinkedInAdAccountsParams,
4190 ) -> Result<serde_json::Value> {
4191 let query = params.to_query();
4192 self.client
4193 .send_versioned(
4194 reqwest::Method::GET,
4195 "/ad-publishing/linkedin/ad-accounts",
4196 &query,
4197 None::<&()>,
4198 Some("2021-07-28"),
4199 )
4200 .await
4201 }
4202
4203 pub async fn upsert_ad_campaign_group(
4211 &self,
4212 body: &models::AdCampaignGroupDataDTO,
4213 ) -> Result<serde_json::Value> {
4214 let query = Vec::new();
4215 self.client
4216 .send_versioned(
4217 reqwest::Method::PUT,
4218 "/ad-publishing/linkedin/ads",
4219 &query,
4220 Some(body),
4221 Some("2021-07-28"),
4222 )
4223 .await
4224 }
4225
4226 pub async fn get_ad_campaign_group(
4234 &self,
4235 ad_id: &str,
4236 params: &GetAdCampaignGroupParams,
4237 ) -> Result<serde_json::Value> {
4238 let path = format!(
4239 "/ad-publishing/linkedin/ads/{}",
4240 crate::services::encode(ad_id)
4241 );
4242 let query = params.to_query();
4243 self.client
4244 .send_versioned(
4245 reqwest::Method::GET,
4246 &path,
4247 &query,
4248 None::<&()>,
4249 Some("2021-07-28"),
4250 )
4251 .await
4252 }
4253
4254 pub async fn publish_ad_campaign_group(
4262 &self,
4263 ad_id: &str,
4264 body: &models::LocationIdBodyDTO,
4265 ) -> Result<serde_json::Value> {
4266 let path = format!(
4267 "/ad-publishing/linkedin/ads/{}/publish",
4268 crate::services::encode(ad_id)
4269 );
4270 let query = Vec::new();
4271 self.client
4272 .send_versioned(
4273 reqwest::Method::POST,
4274 &path,
4275 &query,
4276 Some(body),
4277 Some("2021-07-28"),
4278 )
4279 .await
4280 }
4281
4282 pub async fn get_linked_in_integration(
4290 &self,
4291 params: &GetLinkedInIntegrationParams,
4292 ) -> Result<serde_json::Value> {
4293 let query = params.to_query();
4294 self.client
4295 .send_versioned(
4296 reqwest::Method::GET,
4297 "/ad-publishing/linkedin/integration",
4298 &query,
4299 None::<&()>,
4300 Some("2021-07-28"),
4301 )
4302 .await
4303 }
4304
4305 pub async fn create_linked_in_integration(
4313 &self,
4314 body: &models::CreateLinkedinIntegrationDTO,
4315 ) -> Result<serde_json::Value> {
4316 let query = Vec::new();
4317 self.client
4318 .send_versioned(
4319 reqwest::Method::POST,
4320 "/ad-publishing/linkedin/integration",
4321 &query,
4322 Some(body),
4323 Some("2021-07-28"),
4324 )
4325 .await
4326 }
4327
4328 pub async fn get_current_linked_in_user(
4336 &self,
4337 params: &GetCurrentLinkedInUserParams,
4338 ) -> Result<serde_json::Value> {
4339 let query = params.to_query();
4340 self.client
4341 .send_versioned(
4342 reqwest::Method::GET,
4343 "/ad-publishing/linkedin/me",
4344 &query,
4345 None::<&()>,
4346 Some("2021-07-28"),
4347 )
4348 .await
4349 }
4350
4351 pub async fn get_ad_analytics(
4359 &self,
4360 params: &GetAdAnalyticsParams,
4361 ) -> Result<serde_json::Value> {
4362 let query = params.to_query();
4363 self.client
4364 .send_versioned(
4365 reqwest::Method::GET,
4366 "/ad-publishing/linkedin/reporting",
4367 &query,
4368 None::<&()>,
4369 Some("2021-07-28"),
4370 )
4371 .await
4372 }
4373
4374 pub async fn get_campaign_group_reporting(
4382 &self,
4383 campaign_group_id: &str,
4384 params: &GetCampaignGroupReportingParams,
4385 ) -> Result<serde_json::Value> {
4386 let path = format!(
4387 "/ad-publishing/linkedin/reporting/campaign-group/{}",
4388 crate::services::encode(campaign_group_id)
4389 );
4390 let query = params.to_query();
4391 self.client
4392 .send_versioned(
4393 reqwest::Method::GET,
4394 &path,
4395 &query,
4396 None::<&()>,
4397 Some("2021-07-28"),
4398 )
4399 .await
4400 }
4401
4402 pub async fn get_reporting_list_op2(
4410 &self,
4411 params: &GetReportingListOp2Params,
4412 ) -> Result<serde_json::Value> {
4413 let query = params.to_query();
4414 self.client
4415 .send_versioned(
4416 reqwest::Method::GET,
4417 "/ad-publishing/linkedin/reporting/list",
4418 &query,
4419 None::<&()>,
4420 Some("2021-07-28"),
4421 )
4422 .await
4423 }
4424
4425 pub async fn search_targeting_options_op2(
4433 &self,
4434 params: &SearchTargetingOptionsOp2Params,
4435 ) -> Result<serde_json::Value> {
4436 let query = params.to_query();
4437 self.client
4438 .send_versioned(
4439 reqwest::Method::GET,
4440 "/ad-publishing/linkedin/targeting/search",
4441 &query,
4442 None::<&()>,
4443 Some("2021-07-28"),
4444 )
4445 .await
4446 }
4447
4448 pub async fn create_lead_form(
4456 &self,
4457 account_id: &str,
4458 params: &CreateLeadFormParams,
4459 body: &models::LinkedInCreateLeadFormBodyDTO,
4460 ) -> Result<serde_json::Value> {
4461 let path = format!(
4462 "/ad-publishing/linkedin/{}/form",
4463 crate::services::encode(account_id)
4464 );
4465 let query = params.to_query();
4466 self.client
4467 .send_versioned(
4468 reqwest::Method::POST,
4469 &path,
4470 &query,
4471 Some(body),
4472 Some("2021-07-28"),
4473 )
4474 .await
4475 }
4476
4477 pub async fn get_lead_forms(
4485 &self,
4486 account_id: &str,
4487 params: &GetLeadFormsParams,
4488 ) -> Result<serde_json::Value> {
4489 let path = format!(
4490 "/ad-publishing/linkedin/{}/forms",
4491 crate::services::encode(account_id)
4492 );
4493 let query = params.to_query();
4494 self.client
4495 .send_versioned(
4496 reqwest::Method::GET,
4497 &path,
4498 &query,
4499 None::<&()>,
4500 Some("2021-07-28"),
4501 )
4502 .await
4503 }
4504
4505 pub async fn update_ad_status(
4513 &self,
4514 ad_id: &str,
4515 params: &UpdateAdStatusParams,
4516 body: &models::LinkedInUpdateAdStatusBodyDTO,
4517 ) -> Result<serde_json::Value> {
4518 let path = format!(
4519 "/ad-publishing/linkedin/{}/status",
4520 crate::services::encode(ad_id)
4521 );
4522 let query = params.to_query();
4523 self.client
4524 .send_versioned(
4525 reqwest::Method::PATCH,
4526 &path,
4527 &query,
4528 Some(body),
4529 Some("2021-07-28"),
4530 )
4531 .await
4532 }
4533}