Class: Fastly::ClientSideProtectionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly/api/client_side_protection_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ClientSideProtectionApi

Returns a new instance of ClientSideProtectionApi.



17
18
19
# File 'lib/fastly/api/client_side_protection_api.rb', line 17

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/fastly/api/client_side_protection_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#csp_create_page(opts = {}) ⇒ Page

Create page Create a new page for monitoring.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:



24
25
26
27
# File 'lib/fastly/api/client_side_protection_api.rb', line 24

def csp_create_page(opts = {})
  data, _status_code, _headers = csp_create_page_with_http_info(opts)
  data
end

#csp_create_page_with_http_info(opts = {}) ⇒ Array<(Page, Integer, Hash)>

Create page Create a new page for monitoring.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 33

def csp_create_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_create_page ...'
  end
  # unbox the parameters from the hash
  # resource path
  local_var_path = '/client-side-protection/v1/pages'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'page_create'])

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_create_page",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_create_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_create_policy(opts = {}) ⇒ Policy

Create policy Create a new Content Security Policy for a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_create (PolicyCreate)

Returns:



88
89
90
91
# File 'lib/fastly/api/client_side_protection_api.rb', line 88

def csp_create_policy(opts = {})
  data, _status_code, _headers = csp_create_policy_with_http_info(opts)
  data
end

#csp_create_policy_with_http_info(opts = {}) ⇒ Array<(Policy, Integer, Hash)>

Create policy Create a new Content Security Policy for a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_create (PolicyCreate)

Returns:

  • (Array<(Policy, Integer, Hash)>)

    Policy data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 98

def csp_create_policy_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_create_policy ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_create_policy"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/policies'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'policy_create'])

  # return_type
  return_type = opts[:debug_return_type] || 'Policy'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_create_policy",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_create_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_create_website(opts = {}) ⇒ Website

Create website Create a new website for Client-Side Protection monitoring.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:



157
158
159
160
# File 'lib/fastly/api/client_side_protection_api.rb', line 157

def csp_create_website(opts = {})
  data, _status_code, _headers = csp_create_website_with_http_info(opts)
  data
end

#csp_create_website_with_http_info(opts = {}) ⇒ Array<(Website, Integer, Hash)>

Create website Create a new website for Client-Side Protection monitoring.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:

  • (Array<(Website, Integer, Hash)>)

    Website data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 166

def csp_create_website_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_create_website ...'
  end
  # unbox the parameters from the hash
  # resource path
  local_var_path = '/client-side-protection/v1/websites'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'website_create'])

  # return_type
  return_type = opts[:debug_return_type] || 'Website'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_create_website",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_create_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_delete_page(opts = {}) ⇒ nil

Delete page Delete a page and all associated scripts and policies.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

Returns:

  • (nil)


220
221
222
223
# File 'lib/fastly/api/client_side_protection_api.rb', line 220

def csp_delete_page(opts = {})
  csp_delete_page_with_http_info(opts)
  nil
end

#csp_delete_page_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete page Delete a page and all associated scripts and policies.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

Returns:

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

    nil, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 229

def csp_delete_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_delete_page ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_delete_page"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_delete_page",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_delete_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_delete_website(opts = {}) ⇒ nil

Delete website Delete a website and all associated pages, scripts, and policies.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Website identifier (required)

Returns:

  • (nil)


283
284
285
286
# File 'lib/fastly/api/client_side_protection_api.rb', line 283

def csp_delete_website(opts = {})
  csp_delete_website_with_http_info(opts)
  nil
end

#csp_delete_website_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete website Delete a website and all associated pages, scripts, and policies.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Website identifier (required)

Returns:

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

    nil, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 292

def csp_delete_website_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_delete_website ...'
  end
  # unbox the parameters from the hash
  website_id = opts[:'website_id']
  # verify the required parameter 'website_id' is set
  if @api_client.config.client_side_validation && website_id.nil?
    fail ArgumentError, "Missing the required parameter 'website_id' when calling ClientSideProtectionApi.csp_delete_website"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/websites/{website_id}'.sub('{' + 'website_id' + '}', CGI.escape(website_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_delete_website",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_delete_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_get_page(opts = {}) ⇒ Page

Get page Get details for a specific page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

Returns:



346
347
348
349
# File 'lib/fastly/api/client_side_protection_api.rb', line 346

def csp_get_page(opts = {})
  data, _status_code, _headers = csp_get_page_with_http_info(opts)
  data
end

#csp_get_page_with_http_info(opts = {}) ⇒ Array<(Page, Integer, Hash)>

Get page Get details for a specific page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 355

def csp_get_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_page ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_get_page"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_get_page",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_get_policy(opts = {}) ⇒ Policy

Get policy Get details for a specific policy.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_id (String)

    Policy identifier (required)

Returns:



410
411
412
413
# File 'lib/fastly/api/client_side_protection_api.rb', line 410

def csp_get_policy(opts = {})
  data, _status_code, _headers = csp_get_policy_with_http_info(opts)
  data
end

#csp_get_policy_with_http_info(opts = {}) ⇒ Array<(Policy, Integer, Hash)>

Get policy Get details for a specific policy.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_id (String)

    Policy identifier (required)

Returns:

  • (Array<(Policy, Integer, Hash)>)

    Policy data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 420

def csp_get_policy_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_policy ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  policy_id = opts[:'policy_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_get_policy"
  end
  # verify the required parameter 'policy_id' is set
  if @api_client.config.client_side_validation && policy_id.nil?
    fail ArgumentError, "Missing the required parameter 'policy_id' when calling ClientSideProtectionApi.csp_get_policy"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/policies/{policy_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s)).sub('{' + 'policy_id' + '}', CGI.escape(policy_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Policy'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_get_policy",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_get_script(opts = {}) ⇒ Script

Get script Get details for a specific script.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :script_id (String)

    Script identifier (required)

Returns:



480
481
482
483
# File 'lib/fastly/api/client_side_protection_api.rb', line 480

def csp_get_script(opts = {})
  data, _status_code, _headers = csp_get_script_with_http_info(opts)
  data
end

#csp_get_script_with_http_info(opts = {}) ⇒ Array<(Script, Integer, Hash)>

Get script Get details for a specific script.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :script_id (String)

    Script identifier (required)

Returns:

  • (Array<(Script, Integer, Hash)>)

    Script data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 490

def csp_get_script_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_script ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  script_id = opts[:'script_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_get_script"
  end
  # verify the required parameter 'script_id' is set
  if @api_client.config.client_side_validation && script_id.nil?
    fail ArgumentError, "Missing the required parameter 'script_id' when calling ClientSideProtectionApi.csp_get_script"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/scripts/{script_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s)).sub('{' + 'script_id' + '}', CGI.escape(script_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Script'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_get_script",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_script\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_get_website(opts = {}) ⇒ Website

Get website Get details for a specific website.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Website identifier (required)

Returns:



549
550
551
552
# File 'lib/fastly/api/client_side_protection_api.rb', line 549

def csp_get_website(opts = {})
  data, _status_code, _headers = csp_get_website_with_http_info(opts)
  data
end

#csp_get_website_with_http_info(opts = {}) ⇒ Array<(Website, Integer, Hash)>

Get website Get details for a specific website.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Website identifier (required)

Returns:

  • (Array<(Website, Integer, Hash)>)

    Website data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 558

def csp_get_website_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_website ...'
  end
  # unbox the parameters from the hash
  website_id = opts[:'website_id']
  # verify the required parameter 'website_id' is set
  if @api_client.config.client_side_validation && website_id.nil?
    fail ArgumentError, "Missing the required parameter 'website_id' when calling ClientSideProtectionApi.csp_get_website"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/websites/{website_id}'.sub('{' + 'website_id' + '}', CGI.escape(website_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Website'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_get_website",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_list_header_events(opts = {}) ⇒ InlineResponse20011

List header events List security header change events for a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:



614
615
616
617
# File 'lib/fastly/api/client_side_protection_api.rb', line 614

def csp_list_header_events(opts = {})
  data, _status_code, _headers = csp_list_header_events_with_http_info(opts)
  data
end

#csp_list_header_events_with_http_info(opts = {}) ⇒ Array<(InlineResponse20011, Integer, Hash)>

List header events List security header change events for a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:

  • (Array<(InlineResponse20011, Integer, Hash)>)

    InlineResponse20011 data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 625

def csp_list_header_events_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_header_events ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_header_events"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_header_events, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_header_events, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_header_events, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/events'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse20011'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_list_header_events",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_header_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_list_headers(opts = {}) ⇒ InlineResponse20010

List security headers List security headers detected on a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:



695
696
697
698
# File 'lib/fastly/api/client_side_protection_api.rb', line 695

def csp_list_headers(opts = {})
  data, _status_code, _headers = csp_list_headers_with_http_info(opts)
  data
end

#csp_list_headers_with_http_info(opts = {}) ⇒ Array<(InlineResponse20010, Integer, Hash)>

List security headers List security headers detected on a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:

  • (Array<(InlineResponse20010, Integer, Hash)>)

    InlineResponse20010 data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 706

def csp_list_headers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_headers ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_headers"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_headers, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_headers, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_headers, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/headers'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse20010'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_list_headers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_headers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_list_pages(opts = {}) ⇒ InlineResponse2006

List pages List all pages. Optionally filter by website.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Filter pages by website ID

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:



776
777
778
779
# File 'lib/fastly/api/client_side_protection_api.rb', line 776

def csp_list_pages(opts = {})
  data, _status_code, _headers = csp_list_pages_with_http_info(opts)
  data
end

#csp_list_pages_with_http_info(opts = {}) ⇒ Array<(InlineResponse2006, Integer, Hash)>

List pages List all pages. Optionally filter by website.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Filter pages by website ID

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:

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

    InlineResponse2006 data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 787

def csp_list_pages_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_pages ...'
  end
  # unbox the parameters from the hash
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_pages, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_pages, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_pages, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/client-side-protection/v1/pages'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'website_id'] = opts[:'website_id'] if !opts[:'website_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse2006'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_list_pages",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_list_policies(opts = {}) ⇒ InlineResponse2008

List policies List all Content Security Policies for a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:



853
854
855
856
# File 'lib/fastly/api/client_side_protection_api.rb', line 853

def csp_list_policies(opts = {})
  data, _status_code, _headers = csp_list_policies_with_http_info(opts)
  data
end

#csp_list_policies_with_http_info(opts = {}) ⇒ Array<(InlineResponse2008, Integer, Hash)>

List policies List all Content Security Policies for a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:

  • (Array<(InlineResponse2008, Integer, Hash)>)

    InlineResponse2008 data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 864

def csp_list_policies_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_policies ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_policies"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policies, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policies, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_policies, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/policies'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse2008'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_list_policies",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_list_policy_reports(opts = {}) ⇒ InlineResponse2009

List policy reports List CSP violation reports for a policy.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_id (String)

    Policy identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:



935
936
937
938
# File 'lib/fastly/api/client_side_protection_api.rb', line 935

def csp_list_policy_reports(opts = {})
  data, _status_code, _headers = csp_list_policy_reports_with_http_info(opts)
  data
end

#csp_list_policy_reports_with_http_info(opts = {}) ⇒ Array<(InlineResponse2009, Integer, Hash)>

List policy reports List CSP violation reports for a policy.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_id (String)

    Policy identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:

  • (Array<(InlineResponse2009, Integer, Hash)>)

    InlineResponse2009 data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 947

def csp_list_policy_reports_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_policy_reports ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  policy_id = opts[:'policy_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_policy_reports"
  end
  # verify the required parameter 'policy_id' is set
  if @api_client.config.client_side_validation && policy_id.nil?
    fail ArgumentError, "Missing the required parameter 'policy_id' when calling ClientSideProtectionApi.csp_list_policy_reports"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policy_reports, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policy_reports, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_policy_reports, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/policies/{policy_id}/reports'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s)).sub('{' + 'policy_id' + '}', CGI.escape(policy_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse2009'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_list_policy_reports",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_policy_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_list_scripts(opts = {}) ⇒ InlineResponse2007

List scripts List all scripts detected on a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:



1022
1023
1024
1025
# File 'lib/fastly/api/client_side_protection_api.rb', line 1022

def csp_list_scripts(opts = {})
  data, _status_code, _headers = csp_list_scripts_with_http_info(opts)
  data
end

#csp_list_scripts_with_http_info(opts = {}) ⇒ Array<(InlineResponse2007, Integer, Hash)>

List scripts List all scripts detected on a page.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:

  • (Array<(InlineResponse2007, Integer, Hash)>)

    InlineResponse2007 data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 1033

def csp_list_scripts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_scripts ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_scripts"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_scripts, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_scripts, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_scripts, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/scripts'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse2007'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_list_scripts",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_list_websites(opts = {}) ⇒ InlineResponse2005

List websites List all websites configured for Client-Side Protection.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:



1102
1103
1104
1105
# File 'lib/fastly/api/client_side_protection_api.rb', line 1102

def csp_list_websites(opts = {})
  data, _status_code, _headers = csp_list_websites_with_http_info(opts)
  data
end

#csp_list_websites_with_http_info(opts = {}) ⇒ Array<(InlineResponse2005, Integer, Hash)>

List websites List all websites configured for Client-Side Protection.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :limit (Integer)

    Limit how many results are returned. (default to 100)

  • :page (Integer)

    Page number of the collection to request. (default to 0)

Returns:

  • (Array<(InlineResponse2005, Integer, Hash)>)

    InlineResponse2005 data, response status code and response headers



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
# File 'lib/fastly/api/client_side_protection_api.rb', line 1112

def csp_list_websites_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_websites ...'
  end
  # unbox the parameters from the hash
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_websites, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_websites, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_websites, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/client-side-protection/v1/websites'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse2005'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_list_websites",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_websites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_update_page(opts = {}) ⇒ Page

Update page Update a page's configuration.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :page_update (PageUpdate)

Returns:



1176
1177
1178
1179
# File 'lib/fastly/api/client_side_protection_api.rb', line 1176

def csp_update_page(opts = {})
  data, _status_code, _headers = csp_update_page_with_http_info(opts)
  data
end

#csp_update_page_with_http_info(opts = {}) ⇒ Array<(Page, Integer, Hash)>

Update page Update a page's configuration.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :page_update (PageUpdate)

Returns:

  • (Array<(Page, Integer, Hash)>)

    Page data, response status code and response headers



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
# File 'lib/fastly/api/client_side_protection_api.rb', line 1186

def csp_update_page_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_page ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_update_page"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'page_update'])

  # return_type
  return_type = opts[:debug_return_type] || 'Page'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_update_page",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_update_policy(opts = {}) ⇒ Policy

Update policy Update a policy's configuration.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_id (String)

    Policy identifier (required)

  • :policy_update (PolicyUpdate)

Returns:



1247
1248
1249
1250
# File 'lib/fastly/api/client_side_protection_api.rb', line 1247

def csp_update_policy(opts = {})
  data, _status_code, _headers = csp_update_policy_with_http_info(opts)
  data
end

#csp_update_policy_with_http_info(opts = {}) ⇒ Array<(Policy, Integer, Hash)>

Update policy Update a policy's configuration.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :policy_id (String)

    Policy identifier (required)

  • :policy_update (PolicyUpdate)

Returns:

  • (Array<(Policy, Integer, Hash)>)

    Policy data, response status code and response headers



1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
# File 'lib/fastly/api/client_side_protection_api.rb', line 1258

def csp_update_policy_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_policy ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  policy_id = opts[:'policy_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_update_policy"
  end
  # verify the required parameter 'policy_id' is set
  if @api_client.config.client_side_validation && policy_id.nil?
    fail ArgumentError, "Missing the required parameter 'policy_id' when calling ClientSideProtectionApi.csp_update_policy"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/policies/{policy_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s)).sub('{' + 'policy_id' + '}', CGI.escape(policy_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'policy_update'])

  # return_type
  return_type = opts[:debug_return_type] || 'Policy'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_update_policy",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_update_script(opts = {}) ⇒ Script

Update script Update a script's authorization status or justification.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :script_id (String)

    Script identifier (required)

  • :script_update (ScriptUpdate)

Returns:



1324
1325
1326
1327
# File 'lib/fastly/api/client_side_protection_api.rb', line 1324

def csp_update_script(opts = {})
  data, _status_code, _headers = csp_update_script_with_http_info(opts)
  data
end

#csp_update_script_with_http_info(opts = {}) ⇒ Array<(Script, Integer, Hash)>

Update script Update a script's authorization status or justification.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :page_id (String)

    Page identifier (required)

  • :script_id (String)

    Script identifier (required)

  • :script_update (ScriptUpdate)

Returns:

  • (Array<(Script, Integer, Hash)>)

    Script data, response status code and response headers



1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
# File 'lib/fastly/api/client_side_protection_api.rb', line 1335

def csp_update_script_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_script ...'
  end
  # unbox the parameters from the hash
  page_id = opts[:'page_id']
  script_id = opts[:'script_id']
  # verify the required parameter 'page_id' is set
  if @api_client.config.client_side_validation && page_id.nil?
    fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_update_script"
  end
  # verify the required parameter 'script_id' is set
  if @api_client.config.client_side_validation && script_id.nil?
    fail ArgumentError, "Missing the required parameter 'script_id' when calling ClientSideProtectionApi.csp_update_script"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/pages/{page_id}/scripts/{script_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s)).sub('{' + 'script_id' + '}', CGI.escape(script_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'script_update'])

  # return_type
  return_type = opts[:debug_return_type] || 'Script'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_update_script",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_script\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#csp_update_website(opts = {}) ⇒ Website

Update website Update a website's configuration.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Website identifier (required)

  • :website_update (WebsiteUpdate)

Returns:



1400
1401
1402
1403
# File 'lib/fastly/api/client_side_protection_api.rb', line 1400

def csp_update_website(opts = {})
  data, _status_code, _headers = csp_update_website_with_http_info(opts)
  data
end

#csp_update_website_with_http_info(opts = {}) ⇒ Array<(Website, Integer, Hash)>

Update website Update a website's configuration.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :website_id (String)

    Website identifier (required)

  • :website_update (WebsiteUpdate)

Returns:

  • (Array<(Website, Integer, Hash)>)

    Website data, response status code and response headers



1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
# File 'lib/fastly/api/client_side_protection_api.rb', line 1410

def csp_update_website_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_website ...'
  end
  # unbox the parameters from the hash
  website_id = opts[:'website_id']
  # verify the required parameter 'website_id' is set
  if @api_client.config.client_side_validation && website_id.nil?
    fail ArgumentError, "Missing the required parameter 'website_id' when calling ClientSideProtectionApi.csp_update_website"
  end
  # resource path
  local_var_path = '/client-side-protection/v1/websites/{website_id}'.sub('{' + 'website_id' + '}', CGI.escape(website_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'website_update'])

  # return_type
  return_type = opts[:debug_return_type] || 'Website'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ClientSideProtectionApi.csp_update_website",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end