/usr/share/perl5/Mail/Chimp3.pm is in libmail-chimp3-perl 0.04-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 | package Mail::Chimp3;
use 5.010001;
use Moo;
use strictures 2;
use namespace::autoclean 0.16;
use Types::Standard qw/ Num Str /;
with 'Web::API';
# ABSTRACT: An interface to mailchimp.com's RESTful Web API v3 using WEB::API
our $VERSION = '0.04'; # VERSION: generated by DZP::OurPkgVersion
has endpoints => (
is => 'rw',
default => sub {
{
root => { path => '/' },
# authorized apps
authorized_apps => { path => 'authorized-apps' },
authorized_app => { path => 'authorized-apps/:app_id' },
add_authorized_app => {
method => 'POST',
path => 'authorized-apps',
mandatory => [ 'client_id', 'client_secret', ],
},
# automations
automations => { path => 'automations' },
automation => { path => 'automations/:workflow_id' },
pause_automation => {
method => 'POST',
path => 'automations/:workflow_id/actions/pause-all-emails',
},
start_automation => {
method => 'POST',
path => 'automations/:workflow_id/actions/start-all-emails',
},
# automation emails
automation_emails => { path => 'automations/:workflow_id/emails' },
automation_email => { path => 'automations/:workflow_id/emails/:workflow_email_id' },
pause_automation_email => {
method => 'POST',
path => 'automations/:workflow_id/emails/:workflow_email_id/actions/pause',
},
start_automation_email => {
method => 'POST',
path => 'automations/:workflow_id/emails/:workflow_email_id/actions/start',
},
add_automation_subscriber => {
method => 'POST',
path => 'automations/:workflow_id/emails/:workflow_email_id/queue',
mandatory => ['email_address'],
},
automation_subscribers => {
path => 'automations/:workflow_id/emails/:workflow_email_id/queue',
},
automation_subscriber => {
path => 'automations/:workflow_id/emails/:workflow_email_id/queue/:subscriber_hash',
},
remove_automation_subscriber => {
method => 'POST',
path => 'automations/:workflow_id/removed-subscribers',
mandatory => ['email_address'],
},
removed_automation_subscribers => { path => 'automations/:workflow_id/removed-subscribers' },
# batch
batches => { path => 'batches' },
batch => { path => 'batches/:batch_id' },
add_batch => {
method => 'POST',
path => 'batches',
mandatory => ['operations'],
},
delete_batch => {
method => 'DELETE',
path => 'batches/:batch_id',
},
# campaign folders
campaign_folders => { path => 'campaign-folders' },
campaign_folder => { path => 'campaign-folders/:folder_id' },
add_campaign_folder => {
method => 'POST',
path => 'campaign-folders',
mandatory => ['name'],
},
update_campaign_folder => {
method => 'PATCH',
path => 'campaign-folders/:folder_id',
mandatory => ['name'],
},
delete_campaign_folder => {
method => 'DELETE',
path => 'campaign-folders/:folder_id',
},
# campaigns
campaigns => { path => 'campaigns' },
campaign => { path => 'campaigns/:campaign_id' },
add_campaign => {
method => 'POST',
path => 'campaigns',
mandatory => [ 'type', 'settings' ],
},
update_campaign => {
method => 'PATCH',
path => 'campaigns/:campaign_id',
mandatory => [ 'type', 'settings' ],
},
delete_campaign => {
method => 'DELETE',
path => 'campaigns/:campaign_id',
},
cancel_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/cancel-send',
},
pause_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/pause',
},
replicate_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/replicate',
},
resume_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/resume',
},
schedule_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/schedule',
mandatory => ['schedule_time'],
},
send_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/send',
},
test_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/test',
mandatory => [ 'test_emails', 'send_type' ],
},
unschedule_campaign => {
method => 'POST',
path => 'campaigns/:campaign_id/actions/unschedule',
},
campaign_content => { path => 'campaigns/:campaign_id/content' },
set_campaign_content => {
method => 'PUT',
path => 'campaigns/:campaign_id/content',
},
campaign_feedbacks => { path => 'campaigns/:campaign_id/feedback' },
campaign_feedback => { path => 'campaigns/:campaign_id/feedback/:feedback_id' },
add_campaign_feedback => {
method => 'POST',
path => 'campaigns/:campaign_id/feedback',
mandatory => ['message'],
},
update_campaign_feedback => {
method => 'PATCH',
path => 'campaigns/:campaign_id/feedback/:feedback_id',
mandatory => ['message'],
},
delete_campaign_feedback => {
method => 'DELETE',
path => 'campaigns/:campaign_id/feedback/:feedback_id',
},
campaign_send_checklist => { path => 'campaigns/:campaign_id/send-checklist' },
# conversations
conversations => { path => 'conversations' },
conversation => { path => 'conversations/:conversation_id' },
add_conversation_message => {
method => 'POST',
path => 'conversations/:conversation_id/messages',
mandatory => [ 'from_email', 'read' ],
},
conversation_messages => { path => 'conversation/:conversation_id/messages' },
conversation_message => { path => 'conversation/:conversation_id/messages/:message_id' },
# ecommerce stores
stores => { path => 'ecommerce/stores' },
store => { path => 'ecommerce/stores/:store_id' },
add_store => {
method => 'POST',
path => 'ecommerce/stores',
mandatory => [ 'id', 'list_id', 'name', 'currency_code', ],
},
update_store => {
method => 'PATCH',
path => 'ecommerce/stores/:store_id',
},
delete_store => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id',
},
# ecommerce carts
carts => { path => 'ecommerce/stores/:store_id/carts' },
cart => { path => 'ecommerce/stores/:store_id/carts/:cart_id' },
add_cart => {
method => 'POST',
path => 'ecommerce/stores/:store_id/carts',
mandatory => ['customer'],
},
update_cart => {
method => 'PATCH',
path => 'ecommerce/stores/:store_id/carts/:cart_id',
},
delete_cart => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id/carts/:cart_id',
},
# ecommerce cart lines
cart_lines => { path => 'ecommerce/stores/:store_id/carts/:cart_id/lines' },
cart_line => { path => 'ecommerce/stores/:store_id/carts/:cart_id/lines/:line_id' },
add_cart_line => {
method => 'POST',
path => 'ecommerce/stores/:store_id/carts/:cart_id/lines',
mandatory => [
qw/
id
product_id
product_variant_id
quantity
price
/
],
},
update_cart_line => {
method => 'PATCH',
path => 'ecommerce/stores/:store_id/carts/:cart_id/lines/:line_id',
},
delete_cart_line => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id/carts/:cart_id/lines/:line_id',
},
# ecommerce customers
customers => { path => 'ecommerce/stores/:store_id/customers' },
customer => { path => 'ecommerce/stores/:store_id/customers/:customer_id' },
add_customer => {
method => 'POST',
path => 'ecommerce/stores/:store_id/customers',
mandatory => [
qw/
id
email_address
opt_in_status
/
],
},
update_customer => {
method => 'PATCH',
path => 'ecommerce/stores/:store_id/customers/:customer_id',
},
upsert_customer => {
method => 'PUT',
path => 'ecommerce/stores/:store_id/customers/:customer_id',
mandatory => [
qw/
id
email_address
opt_in_status
/
],
},
delete_customer => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id/customers/:customer_id',
},
# ecommerce orders
orders => { path => 'ecommerce/stores/:store_id/orders' },
order => { path => 'ecommerce/stores/:store_id/orders/:order_id' },
add_order => {
method => 'POST',
path => 'ecommerce/stores/:store_id/orders',
mandatory => [
qw/
id
customer
currency_code
order_total
lines
/
],
},
update_order => {
method => 'PATCH',
path => 'ecommerce/stores/:store_id/orders/:order_id',
},
delete_order => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id/orders/:order_id',
},
# ecommerce order lines
order_lines => { path => 'ecommerce/stores/:store_id/orders/:order_id/lines' },
order_line => { path => 'ecommerce/stores/:store_id/orders/:order_id/lines/:line_id' },
add_order_line => {
method => 'POST',
path => 'ecommerce/stores/:store_id/orders/:order_id/lines',
mandatory => [
qw/
id
product_id
product_variant_id
quantity
price
/
],
},
update_order_line => {
method => 'PATCH',
path => 'ecommerce/stores/:store_id/orders/:order_id/lines/:line_id',
},
delete_order_line => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id/orders/:order_id/lines/:line_id',
},
# ecommerce products
products => { path => 'ecommerce/stores/:store_id/products' },
product => { path => 'ecommerce/stores/:store_id/products/:product_id' },
add_product => {
method => 'POST',
path => 'ecommerce/stores/:store_id/products',
mandatory => [ 'id', 'title', 'variants', ],
},
delete_product => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id/products/:product_id',
},
# ecommerce product variants
variants => { path => 'ecommerce/stores/:store_id/products/:product_id/variants' },
variant => { path => 'ecommerce/stores/:store_id/products/:product_id/variants/:variant_id' },
add_variant => {
method => 'POST',
path => 'ecommerce/stores/:store_id/products/:product_id/variants',
mandatory => [ 'id', 'title', ],
},
update_variant => {
method => 'PATCH',
path => 'ecommerce/stores/:store_id/products/:product_id/variants/:variant_id',
},
upsert_variant => {
method => 'PUT',
path => 'ecommerce/stores/:store_id/products/:product_id/variants/:variant_id',
mandatory => [ 'id', 'title', ],
},
delete_variant => {
method => 'DELETE',
path => 'ecommerce/stores/:store_id/products/:product_id/variants/:variant_id',
},
# file manager files
file_manager_files => { path => 'file-manager/files' },
file_manager_file => { path => 'file-manager/files/:file_id' },
add_file_manager_file => {
method => 'POST',
path => 'file-manager/files',
mandatory => [ 'name', 'file_data' ],
},
update_file_manager_file => {
method => 'PATCH',
path => 'file-manager/files/:file_id',
mandatory => [ 'name', 'file_data' ],
},
delete_file_manager_file => {
method => 'DELETE',
path => 'file-manager/files/:file_id',
},
# file manager folders
file_manager_folders => { path => 'file-manager/folders' },
file_manager_folder => { path => 'file-manager/folders/:folder_id' },
add_file_manager_folder => {
method => 'POST',
path => 'file-manager/folders',
mandatory => ['name'],
},
update_file_manager_folder => {
method => 'PATCH',
path => 'file-manager/folders/:folder_id',
mandatory => ['name'],
},
delete_file_manager_folder => {
method => 'DELETE',
path => 'file-manager/folders/:folder_id',
},
# lists
lists => { path => 'lists' },
list => { path => 'lists/:list_id' },
add_list => {
method => 'POST',
path => 'lists',
mandatory => [
qw/
name
contact
permission_reminder
campaign_defaults
email_type_option
/
],
},
update_list => {
method => 'PATCH',
path => 'lists/:list_id',
mandatory => [
qw/
name
contact
permission_reminder
campaign_defaults
email_type_option
/
],
},
delete_list => {
method => 'DELETE',
path => 'lists/:list_id',
},
batch_list => {
method => 'POST',
path => 'lists/:list_id',
mandatory => ['members'],
},
abuse_reports => { path => 'lists/:list_id/abuse-reports' },
abuse_report => { path => 'lists/:list_id/abuse-reports/:report_id' },
list_activity => { path => 'lists/:list_id/activity' },
list_clients => { path => 'lists/:list_id/clients' },
growth_history => { path => 'lists/:list_id/growth-history' },
growth_history_month => { path => 'lists/:list_id/growth-history/:month' },
# list interests
interest_categories => { path => 'lists/:list_id/interest-categories' },
interest_category => { path => 'lists/:list_id/interest-categories/:interest_category_id' },
add_interest_category => {
method => 'POST',
path => 'lists/:list_id/interest-categories',
mandatory => [ 'title', 'type' ],
},
update_interest_category => {
method => 'PATCH',
path => 'lists/:list_id/interest-categories/:interest_category_id',
mandatory => [ 'title', 'type' ],
},
delete_interest_category => {
method => 'DELETE',
path => 'lists/:list_id/interest-categories/:interest_category_id',
},
interests => { path => 'lists/:list_id/interest-categories/:interest_category_id/interests' },
interest => { path => 'lists/:list_id/interest-categories/:interest_category_id/interests/:interest_id' },
add_interest => {
method => 'POST',
path => 'lists/:list_id/interest-categories/:interest_category_id/interests',
mandatory => ['name'],
},
update_interest => {
method => 'PATCH',
path => 'lists/:list_id/interest-categories/:interest_category_id/interests/:interest_id',
mandatory => ['name'],
},
delete_interest => {
method => 'DELETE',
path => 'lists/:list_id/interest-categories/:interest_category_id/interests/:interest_id',
},
# list members
members => { path => 'lists/:list_id/members' },
member => { path => 'lists/:list_id/members/:subscriber_hash' },
add_member => {
method => 'POST',
path => 'lists/:list_id/members',
mandatory => [ 'status', 'email_address', ],
},
update_member => {
method => 'PATCH',
path => 'lists/:list_id/members/:subscriber_hash',
},
upsert_member => {
method => 'PUT',
path => 'lists/:list_id/members/:subscriber_hash',
mandatory => [
qw/
email_address
status_if_new
/
],
},
delete_member => {
method => 'DELETE',
path => 'lists/:list_id/members/:subscriber_hash',
},
member_activity => { path => 'lists/:list_id/members/:subscriber_hash/activity' },
member_goals => { path => 'lists/:list_id/members/:subscriber_hash/goals' },
# list member notes
member_notes => { path => 'lists/:list_id/members/:subscriber_hash/notes' },
member_note => { path => 'lists/:list_id/members/:subscriber_hash/notes/:note_id' },
add_member_note => {
method => 'POST',
path => 'lists/:list_id/members/:subscriber_hash/notes',
mandatory => ['note'],
},
update_member_note => {
method => 'POST',
path => 'lists/:list_id/members/:subscriber_hash/notes/:note_id',
mandatory => ['note'],
},
delete_member_note => {
method => 'DELETE',
path => 'lists/:list_id/members/:subscriber_hash/notes/:note_id',
},
# list merge fields
merge_fields => { path => 'lists/:list_id/merge-fields' },
merge_field => { path => 'lists/:list_id/merge-fields/:merge_id' },
add_merge_field => {
method => 'POST',
path => 'lists/:list_id/merge-fields',
mandatory => [ 'name', 'type', ],
},
update_merge_field => {
method => 'PATCH',
path => 'lists/:list_id/merge-fields/:merge_id',
},
delete_merge_field => {
method => 'DELETE',
path => 'lists/:list_id/merge-fields/:merge_id',
},
# list segments
segments => { path => 'lists/:list_id/segments' },
segment => { path => 'lists/:list_id/segments/:segment_id' },
add_segment => {
method => 'POST',
path => 'lists/:list_id/segments',
mandatory => ['name'],
},
update_segment => {
method => 'PATCH',
path => 'lists/:list_id/segments/:segment_id',
},
delete_segment => {
method => 'DELETE',
path => 'lists/:list_id/segments/:segment_id',
},
segment_members => { path => 'lists/:list_id/segments/:segment_id/members' },
add_segment_member => {
method => 'POST',
path => 'lists/:list_id/segments/:segment_id/members'
},
delete_segment_member => {
method => 'DELETE',
path => 'lists/:list_id/segments/:segment_id/members/:subscriber_hash'
},
# list other
twitter_cards => { path => 'lists/:list_id/twitter-lead-gen-cards' },
twitter_card => { path => 'lists/:list_id/twitter-lead-gen-cards/:twitter_card_id' },
add_twitter_card => {
method => 'POST',
path => 'lists/:list_id/twitter-lead-gen-cards',
mandatory => [
qw/
name
title
cta_text
privacy_policy_url
image_url
twitter_account_id
/
],
},
webhooks => { path => 'lists/:list_id/webhooks' },
webhook => { path => 'lists/:list_id/webhooks/:webhook_id' },
add_webhook => {
method => 'POST',
path => 'lists/:list_id/webhooks'
},
delete_webhook => {
method => 'DELETE',
path => 'lists/:list_id/webhooks/:webhook_id'
},
# reports
reports => { path => 'reports' },
report => { path => 'reports/:campaign_id' },
abuse_reports => { path => 'reports/:campaign_id/abuse-reports' },
abuse_report => { path => 'reports/:campaign_id/abuse-reports/:report_id' },
advice => { path => 'reports/:campaign_id/advice' },
click_details => { path => 'reports/:campaign_id/click-details' },
click_detail => { path => 'reports/:campaign_id/click-details/:link_id' },
click_details_members => { path => 'reports/:campaign_id/click-details/:link_id/members' },
click_details_member => { path => 'reports/:campaign_id/click-details/:link_id/members/:subscriber_hash' },
domain_performance => { path => 'reports/:campaign_id/domain-performance' },
eepurl => { path => 'reports/:campaign_id/eepurl' },
email_activity => { path => 'reports/:campaign_id/email-activity' },
member_email_activity => { path => 'reports/:campaign_id/email-activity/:subscriber_hash' },
locations => { path => 'reports/:campaign_id/locations' },
sent_to => { path => 'reports/:campaign_id/sent-to' },
member_sent_to => { path => 'reports/:campaign_id/sent-to/:subscriber_hash' },
sub_reports => { path => 'reports/:campaign_id/sub-reports' },
unsubscribed => { path => 'reports/:campaign_id/unsubscribed' },
member_unsubscribed => { path => 'reports/:campaign_id/unsubscribed/:subscriber_hash' },
# template folders
template_folders => { path => 'template-folders' },
template_folder => { path => 'template-folders/:folder_id' },
add_template_folder => {
method => 'POST',
path => 'template-folders',
mandatory => ['name'],
},
update_template_folder => {
method => 'PATCH',
path => 'template-folders/:folder_id',
mandatory => ['name'],
},
delete_template_folder => {
method => 'DELETE',
path => 'template-folders/:folder_id',
},
# templates
templates => { path => 'templates' },
template => { path => 'templates/:template_id' },
add_template => {
method => 'POST',
path => 'templates',
mandatory => [ 'name', 'html' ],
},
update_template => {
method => 'PATCH',
path => 'templates/:template_id',
mandatory => [ 'name', 'html' ],
},
delete_template => {
method => 'DELETE',
path => 'templates/:template_id',
},
template_default_content => { path => 'templates/:template_id/default-content' },
};
},
);
has api_version => (
is => 'ro',
isa => Num,
default => sub { '3.0' },
);
has datacenter => (
is => 'lazy',
isa => Str,
default => sub {
my $self = shift;
if ($self->api_key) {
my ($dc) = ( $self->api_key =~ /\-(\w+)$/ );
return $dc;
}
else {
return 'us1';
}
},
);
has '+decoder' => (
builder => 1,
);
sub _build_decoder {
my $self = shift;
return sub {
my ($content, $content_type) = @_;
my $data = {};
return $data unless $content;
for ($content_type) {
/plain/ and do {
chomp $content;
$data = { text => $content };
};
/urlencoded/ and do {
for (split /&/, $content) {
my ($key, $value) = split /=/;
$data->{ uri_unescape($key) } = uri_unescape($value);
}
};
/json/ and $data = $self->json->decode($content);
/(xml|html)/ and $data = $self->xml->XMLin( $content, NoAttr => 0 );
}
return $data;
};
}
sub commands {
my ($self) = @_;
return $self->endpoints;
}
sub BUILD {
my ($self) = @_;
$self->user_agent( __PACKAGE__ . ' ' . ($Mail::Chimp3::VERSION || '') );
$self->base_url( 'https://' . $self->datacenter . '.api.mailchimp.com/' . $self->api_version );
$self->auth_type('basic');
$self->user('anystring');
$self->content_type('application/json');
return $self;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Mail::Chimp3 - An interface to mailchimp.com's RESTful Web API v3 using WEB::API
=head1 VERSION
version 0.04
=head1 SYNOPSIS
This is for the MailChimp API v3.0.
Please refer to the API documentation at
L<http://developer.mailchimp.com/documentation/mailchimp/reference/overview/>
use Mail::Chimp3;
my $mailchimp = Mail::Chimp3->new(
api_key => $apikey,
);
my $response = $mailchimp->add_store(
store_id => '123',
cart_id => '456',
);
=head1 METHODS
=over
=item abuse_report
=item abuse_reports
=item add_authorized_app
=item add_automation_subscriber
=item add_batch
=item add_campaign
=item add_campaign_feedback
=item add_campaign_folder
=item add_cart
=item add_cart_line
=item add_conversation_message
=item add_customer
=item add_file_manager_file
=item add_file_manager_folder
=item add_interest
=item add_interest_category
=item add_list
=item add_member
=item add_member_note
=item add_merge_field
=item add_order
=item add_order_line
=item add_product
=item add_segment
=item add_segment_member
=item add_store
=item add_template
=item add_template_folder
=item add_twitter_card
=item add_variant
=item add_webhook
=item advice
=item authorized_app
=item authorized_apps
=item automation
=item automation_email
=item automation_emails
=item automation_subscriber
=item automation_subscribers
=item automations
=item batch
=item batches
=item batch_list
=item campaign
=item campaign_content
=item campaign_feedback
=item campaign_feedbacks
=item campaign_folder
=item campaign_folders
=item campaign_send_checklist
=item campaigns
=item cancel_campaign
=item cart
=item cart_line
=item cart_lines
=item carts
=item click_detail
=item click_details
=item click_details_member
=item click_details_members
=item conversation
=item conversation_message
=item conversation_messages
=item conversations
=item customer
=item customers
=item delete_batch
=item delete_campaign
=item delete_campaign_feedback
=item delete_campaign_folder
=item delete_cart
=item delete_cart_line
=item delete_customer
=item delete_file_manager_file
=item delete_file_manager_folder
=item delete_interest
=item delete_interest_category
=item delete_list
=item delete_member
=item delete_member_note
=item delete_merge_field
=item delete_order
=item delete_order_line
=item delete_product
=item delete_segment
=item delete_segment_member
=item delete_store
=item delete_template
=item delete_template_folder
=item delete_variant
=item delete_webhook
=item domain_performance
=item eepurl
=item email_activity
=item file_manager_file
=item file_manager_files
=item file_manager_folder
=item file_manager_folders
=item growth_history
=item growth_history_month
=item interest
=item interest_categories
=item interest_category
=item interests
=item list
=item list_activity
=item list_clients
=item lists
=item locations
=item member
=item member_activity
=item member_email_activity
=item member_goals
=item member_note
=item member_notes
=item member_sent_to
=item member_unsubscribed
=item members
=item merge_field
=item merge_fields
=item order
=item order_line
=item order_lines
=item orders
=item pause_automation
=item pause_automation_email
=item pause_campaign
=item product
=item products
=item remove_automation_subscriber
=item removed_automation_subscribers
=item replicate_campaign
=item report
=item reports
=item resume_campaign
=item root
=item schedule_campaign
=item segment
=item segment_members
=item segments
=item send_campaign
=item sent_to
=item set_campaign_content
=item start_automation
=item start_automation_email
=item store
=item stores
=item sub_reports
=item template
=item template_default_content
=item template_folder
=item template_folders
=item templates
=item test_campaign
=item twitter_card
=item twitter_cards
=item unschedule_campaign
=item unsubscribed
=item update_campaign
=item update_campaign_feedback
=item update_campaign_folder
=item update_cart
=item update_cart_line
=item update_customer
=item update_file_manager_file
=item update_file_manager_folder
=item update_interest
=item update_interest_category
=item update_list
=item update_member
=item update_member_note
=item update_merge_field
=item update_order
=item update_order_line
=item update_segment
=item update_store
=item update_template
=item update_template_folder
=item update_variant
=item upsert_customer
=item upsert_member
=item upsert_variant
=item variant
=item variants
=item webhook
=item webhooks
=back
=head1 INTERNALS
=over
=item commands
Required by Web::API
=back
=head2 BUILD
basic configuration for the client API happens usually in the BUILD method when using Web::API
=head1 BUGS
Please report any bugs or feature requests on GitHub's issue tracker L<https://github.com/jdigory/p5-Mail-Chimp3/issues>.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Mail::Chimp3
You can also look for information at:
=over 4
=item * GitHub repository
L<https://github.com/jdigory/p5-Mail-Chimp3>
=back
=head1 CONTRIBUTORS
Peter Karman (pkarman)
=head1 AUTHOR
Josh Lavin <digory@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Josh Lavin.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|