Class: MailchimpMarketing::ReportingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/MailchimpMarketing/api/reporting_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client) ⇒ ReportingApi

Returns a new instance of ReportingApi.



19
20
21
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 19

def initialize(api_client)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_facebook_ad_product_activity_report(outreach_id, opts = {}) ⇒ Object

List facebook ecommerce report



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 62

def get_facebook_ad_product_activity_report(outreach_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000
  fail ArgumentError, 'invalid value for "sort_field", must be one of title, total_revenue, total_purchased' if opts[:'sort_field'] && !['title', 'total_revenue', 'total_purchased'].include?(opts[:'sort_field'])

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
  post_body = nil

  local_var_path = '/reporting/facebook-ads/{outreach_id}/ecommerce-product-activity'.sub('{' + 'outreach_id' + '}', outreach_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_facebook_ad_report(outreach_id, opts = {}) ⇒ Object

Get facebook ad report



46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 46

def get_facebook_ad_report(outreach_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/reporting/facebook-ads/{outreach_id}'.sub('{' + 'outreach_id' + '}', outreach_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_facebook_ads_report_all(opts = {}) ⇒ Object

List facebook ads reports



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 24

def get_facebook_ads_report_all(opts = {})
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000
  fail ArgumentError, 'invalid value for "sort_field", must be one of created_at, updated_at, end_time' if opts[:'sort_field'] && !['created_at', 'updated_at', 'end_time'].include?(opts[:'sort_field'])
  fail ArgumentError, 'invalid value for "sort_dir", must be one of ASC, DESC' if opts[:'sort_dir'] && !['ASC', 'DESC'].include?(opts[:'sort_dir'])

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
  query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?
  post_body = nil

  local_var_path = '/reporting/facebook-ads'
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_landing_page_report(outreach_id, opts = {}) ⇒ Object

Get landing page report



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 101

def get_landing_page_report(outreach_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/reporting/landing-pages/{outreach_id}'.sub('{' + 'outreach_id' + '}', outreach_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_landing_page_reports_all(opts = {}) ⇒ Object

List landing pages reports



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 83

def get_landing_page_reports_all(opts = {})
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/reporting/landing-pages'
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_survey_question_answers(outreach_id, question_id, opts = {}) ⇒ Object

List answers for question



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 184

def get_survey_question_answers(outreach_id, question_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?
  fail ArgumentError, "Missing required param: 'question_id'" if question_id.nil?
  fail ArgumentError, 'invalid value for "respondent_familiarity_is", must be one of new, known, unknown' if opts[:'respondent_familiarity_is'] && !['new', 'known', 'unknown'].include?(opts[:'respondent_familiarity_is'])

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'respondent_familiarity_is'] = opts[:'respondent_familiarity_is'] if !opts[:'respondent_familiarity_is'].nil?
  post_body = nil

  local_var_path = '/reporting/surveys/{outreach_id}/questions/{question_id}/answers'.sub('{' + 'outreach_id' + '}', outreach_id.to_s).sub('{' + 'question_id' + '}', question_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_survey_question_report(outreach_id, question_id, opts = {}) ⇒ Object

Get survey question report



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 167

def get_survey_question_report(outreach_id, question_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?
  fail ArgumentError, "Missing required param: 'question_id'" if question_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/reporting/surveys/{outreach_id}/questions/{question_id}'.sub('{' + 'outreach_id' + '}', outreach_id.to_s).sub('{' + 'question_id' + '}', question_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_survey_question_reports_all(outreach_id, opts = {}) ⇒ Object

List survey question reports



151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 151

def get_survey_question_reports_all(outreach_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/reporting/surveys/{outreach_id}/questions'.sub('{' + 'outreach_id' + '}', outreach_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_survey_report(outreach_id, opts = {}) ⇒ Object

Get survey report



135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 135

def get_survey_report(outreach_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  post_body = nil

  local_var_path = '/reporting/surveys/{outreach_id}'.sub('{' + 'outreach_id' + '}', outreach_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_survey_reports_all(opts = {}) ⇒ Object

List survey reports



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 117

def get_survey_reports_all(opts = {})
  fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  post_body = nil

  local_var_path = '/reporting/surveys'
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_survey_response(outreach_id, response_id, opts = {}) ⇒ Object

Get survey response



223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 223

def get_survey_response(outreach_id, response_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?
  fail ArgumentError, "Missing required param: 'response_id'" if response_id.nil?

  query_params = {}
  post_body = nil

  local_var_path = '/reporting/surveys/{outreach_id}/responses/{response_id}'.sub('{' + 'outreach_id' + '}', outreach_id.to_s).sub('{' + 'response_id' + '}', response_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end

#get_survey_responses_all(outreach_id, opts = {}) ⇒ Object

List survey responses



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/MailchimpMarketing/api/reporting_api.rb', line 203

def get_survey_responses_all(outreach_id, opts = {})
  fail ArgumentError, "Missing required param: 'outreach_id'" if outreach_id.nil?
  fail ArgumentError, 'invalid value for "respondent_familiarity_is", must be one of new, known, unknown' if opts[:'respondent_familiarity_is'] && !['new', 'known', 'unknown'].include?(opts[:'respondent_familiarity_is'])

  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'answered_question'] = opts[:'answered_question'] if !opts[:'answered_question'].nil?
  query_params[:'chose_answer'] = opts[:'chose_answer'] if !opts[:'chose_answer'].nil?
  query_params[:'respondent_familiarity_is'] = opts[:'respondent_familiarity_is'] if !opts[:'respondent_familiarity_is'].nil?
  post_body = nil

  local_var_path = '/reporting/surveys/{outreach_id}/responses'.sub('{' + 'outreach_id' + '}', outreach_id.to_s)
  data = @api_client.call_api(:GET, local_var_path,
    :query_params => query_params,
    :body => post_body)
  return data
end