Class: MailchimpMarketing::LandingPagesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client) ⇒ LandingPagesApi

Returns a new instance of LandingPagesApi.



19
20
21
# File 'lib/MailchimpMarketing/api/landing_pages_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/landing_pages_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create(body = {}, opts = {}) ⇒ LandingPage

Create a new landing page Create a new Mailchimp landing page.

Parameters:

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (LandingPage)


273
274
275
276
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 273

def create(body = {}, opts = {})
  data, _status_code, _headers = create_with_http_info(body, opts)
  data
end

#create_with_http_info(body, opts = {}) ⇒ Array<(LandingPage, Fixnum, Hash)>

Create a new landing page Create a new Mailchimp landing page.

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(LandingPage, Fixnum, Hash)>)

    LandingPage data, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 283

def create_with_http_info(body, opts = {})
  # resource path
  local_var_path = '/landing-pages'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'LandingPage')
  return data, status_code, headers
end

#delete_page(page_id = {}, opts = {}) ⇒ nil

Delete a landing page Delete a landing page.

Parameters:

  • page_id (defaults to: {})

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 27

def delete_page(page_id = {}, opts = {})
  delete_page_with_http_info(page_id, opts)
  nil
end

#delete_page_with_http_info(page_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a landing page Delete a landing page.

Parameters:

  • page_id

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 37

def delete_page_with_http_info(page_id, opts = {})
  # resource path
  local_var_path = '/landing-pages/{page_id}'.sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#get_all(opts = {}) ⇒ InlineResponse2006

__summary__ Get all landing pages.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort_dir (String)

    Determines the order direction for sorted results.

  • :sort_field (String)

    Returns files sorted by the specified field.

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

  • :count (Integer)

    The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 10. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 1000 (default to 10)

Returns:

  • (InlineResponse2006)


74
75
76
77
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 74

def get_all(opts = {})
  data, _status_code, _headers = get_all_with_http_info(opts)
  data
end

#get_all_with_http_info(opts = {}) ⇒ Array<(InlineResponse2006, Fixnum, Hash)>

__summary__ Get all landing pages.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort_dir (String)

    Determines the order direction for sorted results.

  • :sort_field (String)

    Returns files sorted by the specified field.

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

  • :count (Integer)

    The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 10. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 1000

Returns:

  • (Array<(InlineResponse2006, Fixnum, Hash)>)

    InlineResponse2006 data, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 88

def get_all_with_http_info(opts = {})
  # resource path
  local_var_path = '/landing-pages'

  # query parameters
  query_params = {}
  query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?
  query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
  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?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2006')
  return data, status_code, headers
end

#get_page(page_id = {}, opts = {}) ⇒ LandingPage

Get information about a specific page Get information about a specific page.

Parameters:

  • page_id (defaults to: {})

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (LandingPage)


129
130
131
132
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 129

def get_page(page_id = {}, opts = {})
  data, _status_code, _headers = get_page_with_http_info(page_id, opts)
  data
end

#get_page_content(page_id = {}, opts = {}) ⇒ LandingPageContent

Get landing page content Get the the HTML for your landing page.

Parameters:

  • page_id (defaults to: {})

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (LandingPageContent)


179
180
181
182
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 179

def get_page_content(page_id = {}, opts = {})
  data, _status_code, _headers = get_page_content_with_http_info(page_id, opts)
  data
end

#get_page_content_with_http_info(page_id, opts = {}) ⇒ Array<(LandingPageContent, Fixnum, Hash)>

Get landing page content Get the the HTML for your landing page.

Parameters:

  • page_id

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Array<(LandingPageContent, Fixnum, Hash)>)

    LandingPageContent data, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 191

def get_page_content_with_http_info(page_id, opts = {})
  # resource path
  local_var_path = '/landing-pages/{page_id}/content'.sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  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?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'LandingPageContent')
  return data, status_code, headers
end

#get_page_with_http_info(page_id, opts = {}) ⇒ Array<(LandingPage, Fixnum, Hash)>

Get information about a specific page Get information about a specific page.

Parameters:

  • page_id

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Array<(LandingPage, Fixnum, Hash)>)

    LandingPage data, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 141

def get_page_with_http_info(page_id, opts = {})
  # resource path
  local_var_path = '/landing-pages/{page_id}'.sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  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?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'LandingPage')
  return data, status_code, headers
end

#publish_page(page_id = {}, opts = {}) ⇒ nil

Publish a landing page Publish a landing page that is in draft, unpublished, or has been previously published and edited.

Parameters:

  • page_id (defaults to: {})

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


317
318
319
320
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 317

def publish_page(page_id = {}, opts = {})
  publish_page_with_http_info(page_id, opts)
  nil
end

#publish_page_with_http_info(page_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Publish a landing page Publish a landing page that is in draft, unpublished, or has been previously published and edited.

Parameters:

  • page_id

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 327

def publish_page_with_http_info(page_id, opts = {})
  # resource path
  local_var_path = '/landing-pages/{page_id}/actions/publish'.sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#unpublish_page(page_id = {}, opts = {}) ⇒ nil

Unpublish a landing page Unpublish a landing page that is in draft or has been published.

Parameters:

  • page_id (defaults to: {})

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


360
361
362
363
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 360

def unpublish_page(page_id = {}, opts = {})
  unpublish_page_with_http_info(page_id, opts)
  nil
end

#unpublish_page_with_http_info(page_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Unpublish a landing page Unpublish a landing page that is in draft or has been published.

Parameters:

  • page_id

    The unique id for the page.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 370

def unpublish_page_with_http_info(page_id, opts = {})
  # resource path
  local_var_path = '/landing-pages/{page_id}/actions/unpublish'.sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#update_page(page_id = {}, body = {}, opts = {}) ⇒ LandingPage

Update landing page Update a landing page.

Parameters:

  • page_id (defaults to: {})

    The unique id for the page.

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (LandingPage)


228
229
230
231
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 228

def update_page(page_id = {}, body = {}, opts = {})
  data, _status_code, _headers = update_page_with_http_info(page_id, body, opts)
  data
end

#update_page_with_http_info(page_id, body, opts = {}) ⇒ Array<(LandingPage, Fixnum, Hash)>

Update landing page Update a landing page.

Parameters:

  • page_id

    The unique id for the page.

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(LandingPage, Fixnum, Hash)>)

    LandingPage data, response status code and response headers



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
# File 'lib/MailchimpMarketing/api/landing_pages_api.rb', line 239

def update_page_with_http_info(page_id, body, opts = {})
  # resource path
  local_var_path = '/landing-pages/{page_id}'.sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'LandingPage')
  return data, status_code, headers
end