MailchimpMarketing 3.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/MailchimpMarketing.gemspec +45 -0
  4. data/README.md +378 -0
  5. data/lib/MailchimpMarketing.rb +162 -0
  6. data/lib/MailchimpMarketing/api/activity_feed_api.rb +57 -0
  7. data/lib/MailchimpMarketing/api/authorized_apps_api.rb +78 -0
  8. data/lib/MailchimpMarketing/api/automations_api.rb +351 -0
  9. data/lib/MailchimpMarketing/api/batch_webhooks_api.rb +111 -0
  10. data/lib/MailchimpMarketing/api/batches_api.rb +94 -0
  11. data/lib/MailchimpMarketing/api/campaign_folders_api.rb +111 -0
  12. data/lib/MailchimpMarketing/api/campaigns_api.rb +414 -0
  13. data/lib/MailchimpMarketing/api/connected_sites_api.rb +110 -0
  14. data/lib/MailchimpMarketing/api/conversations_api.rb +124 -0
  15. data/lib/MailchimpMarketing/api/dashboard_api.rb +128 -0
  16. data/lib/MailchimpMarketing/api/ecommerce_api.rb +1139 -0
  17. data/lib/MailchimpMarketing/api/external_auths_api.rb +78 -0
  18. data/lib/MailchimpMarketing/api/facebook_ads_api.rb +66 -0
  19. data/lib/MailchimpMarketing/api/file_manager_api.rb +224 -0
  20. data/lib/MailchimpMarketing/api/landing_pages_api.rb +164 -0
  21. data/lib/MailchimpMarketing/api/lists_api.rb +1302 -0
  22. data/lib/MailchimpMarketing/api/ping_api.rb +39 -0
  23. data/lib/MailchimpMarketing/api/postcards_api.rb +45 -0
  24. data/lib/MailchimpMarketing/api/reporting_api.rb +142 -0
  25. data/lib/MailchimpMarketing/api/reports_api.rb +464 -0
  26. data/lib/MailchimpMarketing/api/root_api.rb +41 -0
  27. data/lib/MailchimpMarketing/api/search_campaigns_api.rb +43 -0
  28. data/lib/MailchimpMarketing/api/search_members_api.rb +44 -0
  29. data/lib/MailchimpMarketing/api/template_folders_api.rb +111 -0
  30. data/lib/MailchimpMarketing/api/templates_api.rb +137 -0
  31. data/lib/MailchimpMarketing/api/verified_domains_api.rb +104 -0
  32. data/lib/MailchimpMarketing/api_client.rb +214 -0
  33. data/lib/MailchimpMarketing/api_error.rb +38 -0
  34. data/lib/MailchimpMarketing/configuration.rb +209 -0
  35. data/lib/MailchimpMarketing/version.rb +15 -0
  36. metadata +257 -0
@@ -0,0 +1,111 @@
1
+ =begin
2
+ #Mailchimp Marketing API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.0.7
7
+ Contact: apihelp@mailchimp.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+ require 'json'
15
+
16
+ module MailchimpMarketing
17
+ class BatchWebhooksApi
18
+ attr_accessor :api_client
19
+
20
+ def initialize(api_client)
21
+ @api_client = api_client
22
+ end
23
+
24
+ # Delete batch webhook
25
+ def remove(batch_webhook_id, opts = {})
26
+ fail ArgumentError, "Missing required param: 'batch_webhook_id'" if batch_webhook_id.nil?
27
+
28
+ query_params = {}
29
+ form_params = {}
30
+ post_body = nil
31
+
32
+ local_var_path = '/batch-webhooks/{batch_webhook_id}'.sub('{' + 'batch_webhook_id' + '}', batch_webhook_id.to_s)
33
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
34
+ :query_params => query_params,
35
+ :form_params => form_params,
36
+ :body => post_body)
37
+ return data, status_code, headers
38
+ end
39
+
40
+ # Get batch webhook info
41
+ def get(batch_webhook_id, opts = {})
42
+ fail ArgumentError, "Missing required param: 'batch_webhook_id'" if batch_webhook_id.nil?
43
+
44
+ query_params = {}
45
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
46
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
47
+ form_params = {}
48
+ post_body = nil
49
+
50
+ local_var_path = '/batch-webhooks/{batch_webhook_id}'.sub('{' + 'batch_webhook_id' + '}', batch_webhook_id.to_s)
51
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
52
+ :query_params => query_params,
53
+ :form_params => form_params,
54
+ :body => post_body)
55
+ return data, status_code, headers
56
+ end
57
+
58
+ # List batch webhooks
59
+ def list(opts = {})
60
+ fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000
61
+
62
+ query_params = {}
63
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
64
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
65
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
66
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
67
+ form_params = {}
68
+ post_body = nil
69
+
70
+ local_var_path = '/batch-webhooks'
71
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body)
75
+ return data, status_code, headers
76
+ end
77
+
78
+ # Update batch webhook
79
+ def update(batch_webhook_id, body, opts = {})
80
+ fail ArgumentError, "Missing required param: 'batch_webhook_id'" if batch_webhook_id.nil?
81
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
82
+
83
+ query_params = {}
84
+ form_params = {}
85
+ post_body = @api_client.object_to_http_body(body)
86
+
87
+ local_var_path = '/batch-webhooks/{batch_webhook_id}'.sub('{' + 'batch_webhook_id' + '}', batch_webhook_id.to_s)
88
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
89
+ :query_params => query_params,
90
+ :form_params => form_params,
91
+ :body => post_body)
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Add batch webhook
96
+ def create(body, opts = {})
97
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
98
+
99
+ query_params = {}
100
+ form_params = {}
101
+ post_body = @api_client.object_to_http_body(body)
102
+
103
+ local_var_path = '/batch-webhooks'
104
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
105
+ :query_params => query_params,
106
+ :form_params => form_params,
107
+ :body => post_body)
108
+ return data, status_code, headers
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,94 @@
1
+ =begin
2
+ #Mailchimp Marketing API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.0.7
7
+ Contact: apihelp@mailchimp.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+ require 'json'
15
+
16
+ module MailchimpMarketing
17
+ class BatchesApi
18
+ attr_accessor :api_client
19
+
20
+ def initialize(api_client)
21
+ @api_client = api_client
22
+ end
23
+
24
+ # Delete batch request
25
+ def delete_request(batch_id, opts = {})
26
+ fail ArgumentError, "Missing required param: 'batch_id'" if batch_id.nil?
27
+
28
+ query_params = {}
29
+ form_params = {}
30
+ post_body = nil
31
+
32
+ local_var_path = '/batches/{batch_id}'.sub('{' + 'batch_id' + '}', batch_id.to_s)
33
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
34
+ :query_params => query_params,
35
+ :form_params => form_params,
36
+ :body => post_body)
37
+ return data, status_code, headers
38
+ end
39
+
40
+ # List batch requests
41
+ def list(opts = {})
42
+ fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000
43
+
44
+ query_params = {}
45
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
46
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
47
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
48
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
49
+ form_params = {}
50
+ post_body = nil
51
+
52
+ local_var_path = '/batches'
53
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
54
+ :query_params => query_params,
55
+ :form_params => form_params,
56
+ :body => post_body)
57
+ return data, status_code, headers
58
+ end
59
+
60
+ # Get batch operation status
61
+ def status(batch_id, opts = {})
62
+ fail ArgumentError, "Missing required param: 'batch_id'" if batch_id.nil?
63
+
64
+ query_params = {}
65
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
66
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
67
+ form_params = {}
68
+ post_body = nil
69
+
70
+ local_var_path = '/batches/{batch_id}'.sub('{' + 'batch_id' + '}', batch_id.to_s)
71
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body)
75
+ return data, status_code, headers
76
+ end
77
+
78
+ # Start batch operation
79
+ def start(body, opts = {})
80
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
81
+
82
+ query_params = {}
83
+ form_params = {}
84
+ post_body = @api_client.object_to_http_body(body)
85
+
86
+ local_var_path = '/batches'
87
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
88
+ :query_params => query_params,
89
+ :form_params => form_params,
90
+ :body => post_body)
91
+ return data, status_code, headers
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,111 @@
1
+ =begin
2
+ #Mailchimp Marketing API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.0.7
7
+ Contact: apihelp@mailchimp.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+ require 'json'
15
+
16
+ module MailchimpMarketing
17
+ class CampaignFoldersApi
18
+ attr_accessor :api_client
19
+
20
+ def initialize(api_client)
21
+ @api_client = api_client
22
+ end
23
+
24
+ # Delete campaign folder
25
+ def remove(folder_id, opts = {})
26
+ fail ArgumentError, "Missing required param: 'folder_id'" if folder_id.nil?
27
+
28
+ query_params = {}
29
+ form_params = {}
30
+ post_body = nil
31
+
32
+ local_var_path = '/campaign-folders/{folder_id}'.sub('{' + 'folder_id' + '}', folder_id.to_s)
33
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
34
+ :query_params => query_params,
35
+ :form_params => form_params,
36
+ :body => post_body)
37
+ return data, status_code, headers
38
+ end
39
+
40
+ # List campaign folders
41
+ def list(opts = {})
42
+ fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000
43
+
44
+ query_params = {}
45
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
46
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
47
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
48
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
49
+ form_params = {}
50
+ post_body = nil
51
+
52
+ local_var_path = '/campaign-folders'
53
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
54
+ :query_params => query_params,
55
+ :form_params => form_params,
56
+ :body => post_body)
57
+ return data, status_code, headers
58
+ end
59
+
60
+ # Get campaign folder
61
+ def get(folder_id, opts = {})
62
+ fail ArgumentError, "Missing required param: 'folder_id'" if folder_id.nil?
63
+
64
+ query_params = {}
65
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
66
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
67
+ form_params = {}
68
+ post_body = nil
69
+
70
+ local_var_path = '/campaign-folders/{folder_id}'.sub('{' + 'folder_id' + '}', folder_id.to_s)
71
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body)
75
+ return data, status_code, headers
76
+ end
77
+
78
+ # Update campaign folder
79
+ def update(folder_id, body, opts = {})
80
+ fail ArgumentError, "Missing required param: 'folder_id'" if folder_id.nil?
81
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
82
+
83
+ query_params = {}
84
+ form_params = {}
85
+ post_body = @api_client.object_to_http_body(body)
86
+
87
+ local_var_path = '/campaign-folders/{folder_id}'.sub('{' + 'folder_id' + '}', folder_id.to_s)
88
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
89
+ :query_params => query_params,
90
+ :form_params => form_params,
91
+ :body => post_body)
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Add campaign folder
96
+ def create(body, opts = {})
97
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
98
+
99
+ query_params = {}
100
+ form_params = {}
101
+ post_body = @api_client.object_to_http_body(body)
102
+
103
+ local_var_path = '/campaign-folders'
104
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
105
+ :query_params => query_params,
106
+ :form_params => form_params,
107
+ :body => post_body)
108
+ return data, status_code, headers
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,414 @@
1
+ =begin
2
+ #Mailchimp Marketing API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 3.0.7
7
+ Contact: apihelp@mailchimp.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+ require 'json'
15
+
16
+ module MailchimpMarketing
17
+ class CampaignsApi
18
+ attr_accessor :api_client
19
+
20
+ def initialize(api_client)
21
+ @api_client = api_client
22
+ end
23
+
24
+ # Delete campaign
25
+ def remove(campaign_id, opts = {})
26
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
27
+
28
+ query_params = {}
29
+ form_params = {}
30
+ post_body = nil
31
+
32
+ local_var_path = '/campaigns/{campaign_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
33
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
34
+ :query_params => query_params,
35
+ :form_params => form_params,
36
+ :body => post_body)
37
+ return data, status_code, headers
38
+ end
39
+
40
+ # Delete campaign feedback message
41
+ def delete_feedback_message(campaign_id, feedback_id, opts = {})
42
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
43
+ fail ArgumentError, "Missing required param: 'feedback_id'" if feedback_id.nil?
44
+
45
+ query_params = {}
46
+ form_params = {}
47
+ post_body = nil
48
+
49
+ local_var_path = '/campaigns/{campaign_id}/feedback/{feedback_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'feedback_id' + '}', feedback_id.to_s)
50
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
51
+ :query_params => query_params,
52
+ :form_params => form_params,
53
+ :body => post_body)
54
+ return data, status_code, headers
55
+ end
56
+
57
+ # List campaigns
58
+ def list(opts = {})
59
+ fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000
60
+ fail ArgumentError, 'invalid value for "type", must be one of regular, plaintext, absplit, rss, variate' if opts[:'type'] && !['regular', 'plaintext', 'absplit', 'rss', 'variate'].include?(opts[:'type'])
61
+ fail ArgumentError, 'invalid value for "status", must be one of save, paused, schedule, sending, sent' if opts[:'status'] && !['save', 'paused', 'schedule', 'sending', 'sent'].include?(opts[:'status'])
62
+ fail ArgumentError, 'invalid value for "sort_field", must be one of create_time, send_time' if opts[:'sort_field'] && !['create_time', 'send_time'].include?(opts[:'sort_field'])
63
+ fail ArgumentError, 'invalid value for "sort_dir", must be one of ASC, DESC' if opts[:'sort_dir'] && !['ASC', 'DESC'].include?(opts[:'sort_dir'])
64
+
65
+ query_params = {}
66
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
67
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
68
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
69
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
70
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
71
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
72
+ query_params[:'before_send_time'] = opts[:'before_send_time'] if !opts[:'before_send_time'].nil?
73
+ query_params[:'since_send_time'] = opts[:'since_send_time'] if !opts[:'since_send_time'].nil?
74
+ query_params[:'before_create_time'] = opts[:'before_create_time'] if !opts[:'before_create_time'].nil?
75
+ query_params[:'since_create_time'] = opts[:'since_create_time'] if !opts[:'since_create_time'].nil?
76
+ query_params[:'list_id'] = opts[:'list_id'] if !opts[:'list_id'].nil?
77
+ query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
78
+ query_params[:'member_id'] = opts[:'member_id'] if !opts[:'member_id'].nil?
79
+ query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
80
+ query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?
81
+ form_params = {}
82
+ post_body = nil
83
+
84
+ local_var_path = '/campaigns'
85
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body)
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # Get campaign info
93
+ def get(campaign_id, opts = {})
94
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
95
+
96
+ query_params = {}
97
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
98
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
99
+ form_params = {}
100
+ post_body = nil
101
+
102
+ local_var_path = '/campaigns/{campaign_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
103
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
104
+ :query_params => query_params,
105
+ :form_params => form_params,
106
+ :body => post_body)
107
+ return data, status_code, headers
108
+ end
109
+
110
+ # Get campaign content
111
+ def get_content(campaign_id, opts = {})
112
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
113
+
114
+ query_params = {}
115
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
116
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
117
+ form_params = {}
118
+ post_body = nil
119
+
120
+ local_var_path = '/campaigns/{campaign_id}/content'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
121
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
122
+ :query_params => query_params,
123
+ :form_params => form_params,
124
+ :body => post_body)
125
+ return data, status_code, headers
126
+ end
127
+
128
+ # List campaign feedback
129
+ def get_feedback(campaign_id, opts = {})
130
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
131
+
132
+ query_params = {}
133
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
134
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
135
+ form_params = {}
136
+ post_body = nil
137
+
138
+ local_var_path = '/campaigns/{campaign_id}/feedback'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
139
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body)
143
+ return data, status_code, headers
144
+ end
145
+
146
+ # Get campaign feedback message
147
+ def get_feedback_message(campaign_id, feedback_id, opts = {})
148
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
149
+ fail ArgumentError, "Missing required param: 'feedback_id'" if feedback_id.nil?
150
+
151
+ query_params = {}
152
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
153
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
154
+ form_params = {}
155
+ post_body = nil
156
+
157
+ local_var_path = '/campaigns/{campaign_id}/feedback/{feedback_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'feedback_id' + '}', feedback_id.to_s)
158
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
159
+ :query_params => query_params,
160
+ :form_params => form_params,
161
+ :body => post_body)
162
+ return data, status_code, headers
163
+ end
164
+
165
+ # Get campaign send checklist
166
+ def get_send_checklist(campaign_id, opts = {})
167
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
168
+
169
+ query_params = {}
170
+ query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
171
+ query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
172
+ form_params = {}
173
+ post_body = nil
174
+
175
+ local_var_path = '/campaigns/{campaign_id}/send-checklist'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
176
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
177
+ :query_params => query_params,
178
+ :form_params => form_params,
179
+ :body => post_body)
180
+ return data, status_code, headers
181
+ end
182
+
183
+ # Update campaign settings
184
+ def update(campaign_id, body, opts = {})
185
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
186
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
187
+
188
+ query_params = {}
189
+ form_params = {}
190
+ post_body = @api_client.object_to_http_body(body)
191
+
192
+ local_var_path = '/campaigns/{campaign_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
193
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
194
+ :query_params => query_params,
195
+ :form_params => form_params,
196
+ :body => post_body)
197
+ return data, status_code, headers
198
+ end
199
+
200
+ # Update campaign feedback message
201
+ def update_feedback_message(campaign_id, feedback_id, body, opts = {})
202
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
203
+ fail ArgumentError, "Missing required param: 'feedback_id'" if feedback_id.nil?
204
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
205
+
206
+ query_params = {}
207
+ form_params = {}
208
+ post_body = @api_client.object_to_http_body(body)
209
+
210
+ local_var_path = '/campaigns/{campaign_id}/feedback/{feedback_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'feedback_id' + '}', feedback_id.to_s)
211
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body)
215
+ return data, status_code, headers
216
+ end
217
+
218
+ # Add campaign
219
+ def create(body, opts = {})
220
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
221
+
222
+ query_params = {}
223
+ form_params = {}
224
+ post_body = @api_client.object_to_http_body(body)
225
+
226
+ local_var_path = '/campaigns'
227
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
228
+ :query_params => query_params,
229
+ :form_params => form_params,
230
+ :body => post_body)
231
+ return data, status_code, headers
232
+ end
233
+
234
+ # Cancel campaign
235
+ def cancel_send(campaign_id, opts = {})
236
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
237
+
238
+ query_params = {}
239
+ form_params = {}
240
+ post_body = nil
241
+
242
+ local_var_path = '/campaigns/{campaign_id}/actions/cancel-send'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
243
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
244
+ :query_params => query_params,
245
+ :form_params => form_params,
246
+ :body => post_body)
247
+ return data, status_code, headers
248
+ end
249
+
250
+ # Resend campaign
251
+ def create_resend(campaign_id, opts = {})
252
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
253
+
254
+ query_params = {}
255
+ form_params = {}
256
+ post_body = nil
257
+
258
+ local_var_path = '/campaigns/{campaign_id}/actions/create-resend'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
259
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
260
+ :query_params => query_params,
261
+ :form_params => form_params,
262
+ :body => post_body)
263
+ return data, status_code, headers
264
+ end
265
+
266
+ # Pause rss campaign
267
+ def pause(campaign_id, opts = {})
268
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
269
+
270
+ query_params = {}
271
+ form_params = {}
272
+ post_body = nil
273
+
274
+ local_var_path = '/campaigns/{campaign_id}/actions/pause'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
275
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body)
279
+ return data, status_code, headers
280
+ end
281
+
282
+ # Replicate campaign
283
+ def replicate(campaign_id, opts = {})
284
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
285
+
286
+ query_params = {}
287
+ form_params = {}
288
+ post_body = nil
289
+
290
+ local_var_path = '/campaigns/{campaign_id}/actions/replicate'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
291
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
292
+ :query_params => query_params,
293
+ :form_params => form_params,
294
+ :body => post_body)
295
+ return data, status_code, headers
296
+ end
297
+
298
+ # Resume rss campaign
299
+ def resume(campaign_id, opts = {})
300
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
301
+
302
+ query_params = {}
303
+ form_params = {}
304
+ post_body = nil
305
+
306
+ local_var_path = '/campaigns/{campaign_id}/actions/resume'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
307
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
308
+ :query_params => query_params,
309
+ :form_params => form_params,
310
+ :body => post_body)
311
+ return data, status_code, headers
312
+ end
313
+
314
+ # Schedule campaign
315
+ def schedule(campaign_id, body, opts = {})
316
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
317
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
318
+
319
+ query_params = {}
320
+ form_params = {}
321
+ post_body = @api_client.object_to_http_body(body)
322
+
323
+ local_var_path = '/campaigns/{campaign_id}/actions/schedule'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
324
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
325
+ :query_params => query_params,
326
+ :form_params => form_params,
327
+ :body => post_body)
328
+ return data, status_code, headers
329
+ end
330
+
331
+ # Send campaign
332
+ def send(campaign_id, opts = {})
333
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
334
+
335
+ query_params = {}
336
+ form_params = {}
337
+ post_body = nil
338
+
339
+ local_var_path = '/campaigns/{campaign_id}/actions/send'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
340
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
341
+ :query_params => query_params,
342
+ :form_params => form_params,
343
+ :body => post_body)
344
+ return data, status_code, headers
345
+ end
346
+
347
+ # Send test email
348
+ def send_test_email(campaign_id, body, opts = {})
349
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
350
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
351
+
352
+ query_params = {}
353
+ form_params = {}
354
+ post_body = @api_client.object_to_http_body(body)
355
+
356
+ local_var_path = '/campaigns/{campaign_id}/actions/test'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
357
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
358
+ :query_params => query_params,
359
+ :form_params => form_params,
360
+ :body => post_body)
361
+ return data, status_code, headers
362
+ end
363
+
364
+ # Unschedule campaign
365
+ def unschedule(campaign_id, opts = {})
366
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
367
+
368
+ query_params = {}
369
+ form_params = {}
370
+ post_body = nil
371
+
372
+ local_var_path = '/campaigns/{campaign_id}/actions/unschedule'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
373
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
374
+ :query_params => query_params,
375
+ :form_params => form_params,
376
+ :body => post_body)
377
+ return data, status_code, headers
378
+ end
379
+
380
+ # Add campaign feedback
381
+ def add_feedback(campaign_id, body, opts = {})
382
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
383
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
384
+
385
+ query_params = {}
386
+ form_params = {}
387
+ post_body = @api_client.object_to_http_body(body)
388
+
389
+ local_var_path = '/campaigns/{campaign_id}/feedback'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
390
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
391
+ :query_params => query_params,
392
+ :form_params => form_params,
393
+ :body => post_body)
394
+ return data, status_code, headers
395
+ end
396
+
397
+ # Set campaign content
398
+ def set_content(campaign_id, body, opts = {})
399
+ fail ArgumentError, "Missing required param: 'campaign_id'" if campaign_id.nil?
400
+ fail ArgumentError, "Missing required param: 'body'" if body.nil?
401
+
402
+ query_params = {}
403
+ form_params = {}
404
+ post_body = @api_client.object_to_http_body(body)
405
+
406
+ local_var_path = '/campaigns/{campaign_id}/content'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)
407
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
408
+ :query_params => query_params,
409
+ :form_params => form_params,
410
+ :body => post_body)
411
+ return data, status_code, headers
412
+ end
413
+ end
414
+ end