fastly 16.1.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +101 -58
  5. data/docs/Action.md +11 -0
  6. data/docs/ActionType.md +9 -0
  7. data/docs/AgentKey.md +14 -0
  8. data/docs/AgentKeyMeta.md +10 -0
  9. data/docs/Backend.md +3 -1
  10. data/docs/BackendApi.md +12 -4
  11. data/docs/BackendResponse.md +3 -1
  12. data/docs/BotManagementRequestUpdateConfiguration.md +10 -0
  13. data/docs/BotManagementResponseConfiguration.md +10 -0
  14. data/docs/BotManagementResponseConfigurationConfiguration.md +10 -0
  15. data/docs/BotManagementResponseConfigure.md +13 -0
  16. data/docs/ClientSideProtectionApi.md +821 -0
  17. data/docs/ConditionOperator.md +9 -0
  18. data/docs/ConditionType.md +9 -0
  19. data/docs/DdosProtectionApi.md +4 -4
  20. data/docs/Directive.md +11 -0
  21. data/docs/DmDomainsApi.md +2 -2
  22. data/docs/DmRoutingConfigsApi.md +912 -0
  23. data/docs/DomainOwnershipsApi.md +2 -2
  24. data/docs/DomainResearchApi.md +2 -2
  25. data/docs/DraftDiff.md +12 -0
  26. data/docs/DraftUpdate.md +10 -0
  27. data/docs/EventsResponse.md +1 -1
  28. data/docs/HeaderEvent.md +14 -0
  29. data/docs/InitialVersion.md +12 -0
  30. data/docs/InitialVersionPath.md +11 -0
  31. data/docs/InlineResponse20010.md +2 -2
  32. data/docs/InlineResponse20011.md +2 -2
  33. data/docs/InlineResponse20012.md +1 -1
  34. data/docs/InlineResponse20013.md +2 -2
  35. data/docs/InlineResponse20014.md +2 -1
  36. data/docs/InlineResponse20015.md +10 -0
  37. data/docs/InlineResponse20016.md +10 -0
  38. data/docs/InlineResponse20017.md +11 -0
  39. data/docs/InlineResponse20018.md +11 -0
  40. data/docs/InlineResponse20019.md +11 -0
  41. data/docs/InlineResponse20020.md +11 -0
  42. data/docs/InlineResponse20021.md +11 -0
  43. data/docs/InlineResponse20022.md +10 -0
  44. data/docs/InlineResponse2005.md +2 -2
  45. data/docs/InlineResponse2006.md +2 -2
  46. data/docs/InlineResponse2007.md +2 -2
  47. data/docs/InlineResponse2008.md +2 -1
  48. data/docs/InlineResponse2009.md +2 -1
  49. data/docs/InvitationsResponse.md +1 -1
  50. data/docs/KvStoreApi.md +2 -2
  51. data/docs/KvStoreItemApi.md +2 -2
  52. data/docs/KvStoreResponseBodyEnable.md +12 -0
  53. data/docs/KvStoreResponseCustomer.md +10 -0
  54. data/docs/KvStoreResponseLinks.md +10 -0
  55. data/docs/KvStoreResponseLinksLinks.md +10 -0
  56. data/docs/KvStoreResponseProduct.md +10 -0
  57. data/docs/KvStoreResponseProductProduct.md +11 -0
  58. data/docs/LoggingAzureblobApi.md +4 -4
  59. data/docs/LoggingAzureblobResponse.md +1 -1
  60. data/docs/LoggingCloudfilesApi.md +4 -4
  61. data/docs/LoggingCloudfilesResponse.md +1 -1
  62. data/docs/LoggingDigitaloceanApi.md +4 -4
  63. data/docs/LoggingDigitaloceanResponse.md +1 -1
  64. data/docs/LoggingFtpApi.md +4 -4
  65. data/docs/LoggingFtpResponse.md +1 -1
  66. data/docs/LoggingGcsApi.md +4 -4
  67. data/docs/LoggingGcsResponse.md +1 -1
  68. data/docs/LoggingGenericCommon.md +1 -1
  69. data/docs/LoggingGenericCommonResponse.md +1 -1
  70. data/docs/LoggingGenericCommonResponseAllOf.md +1 -1
  71. data/docs/LoggingHttpsAdditional.md +1 -1
  72. data/docs/LoggingHttpsApi.md +4 -4
  73. data/docs/LoggingHttpsResponse.md +1 -1
  74. data/docs/LoggingOpenstackApi.md +4 -4
  75. data/docs/LoggingOpenstackResponse.md +1 -1
  76. data/docs/LoggingS3Api.md +4 -4
  77. data/docs/LoggingS3Response.md +1 -1
  78. data/docs/LoggingSftpApi.md +4 -4
  79. data/docs/LoggingSftpResponse.md +1 -1
  80. data/docs/LoggingSumologicAdditional.md +1 -1
  81. data/docs/LoggingSumologicApi.md +4 -4
  82. data/docs/LoggingSumologicResponse.md +1 -1
  83. data/docs/LoggingSyslogAdditional.md +1 -1
  84. data/docs/LoggingSyslogApi.md +4 -4
  85. data/docs/LoggingSyslogResponse.md +1 -1
  86. data/docs/MutualAuthenticationsResponse.md +1 -1
  87. data/docs/NgwafAgentKeysApi.md +55 -0
  88. data/docs/NgwafSimulateApi.md +61 -0
  89. data/docs/Notification.md +11 -0
  90. data/docs/NotificationConfig.md +10 -0
  91. data/docs/Page.md +17 -0
  92. data/docs/PageCreate.md +14 -0
  93. data/docs/PageUpdate.md +14 -0
  94. data/docs/Pagination.md +1 -1
  95. data/docs/PaginationMeta.md +4 -4
  96. data/docs/PaginationMeta1.md +13 -0
  97. data/docs/PathChange.md +15 -0
  98. data/docs/PathCreate.md +10 -0
  99. data/docs/PathResponse.md +14 -0
  100. data/docs/PathResponseAllOf.md +12 -0
  101. data/docs/PathUpdate.md +10 -0
  102. data/docs/PathWithRules.md +11 -0
  103. data/docs/PathsResponse.md +11 -0
  104. data/docs/Policy.md +17 -0
  105. data/docs/PolicyCreate.md +13 -0
  106. data/docs/PolicyUpdate.md +13 -0
  107. data/docs/Position.md +11 -0
  108. data/docs/ProductBotManagementApi.md +78 -0
  109. data/docs/ProductKvStoreApi.md +115 -0
  110. data/docs/RealtimeEntry.md +1 -1
  111. data/docs/RealtimeEntryAggregated.md +34 -3
  112. data/docs/RealtimeEntryDatacenter.md +345 -0
  113. data/docs/RealtimeMeasurements.md +34 -3
  114. data/docs/Report.md +15 -0
  115. data/docs/RequestBodyForCreate.md +1 -0
  116. data/docs/RequestBodyForUpdate.md +1 -0
  117. data/docs/Results.md +34 -3
  118. data/docs/RoutingConfig.md +11 -0
  119. data/docs/RoutingConfigCondition.md +13 -0
  120. data/docs/RoutingConfigResponse.md +16 -0
  121. data/docs/RoutingConfigResponseAllOf.md +14 -0
  122. data/docs/RoutingConfigState.md +9 -0
  123. data/docs/RoutingConfigVersionResponse.md +13 -0
  124. data/docs/RoutingConfigsResponse.md +11 -0
  125. data/docs/RuleChange.md +12 -0
  126. data/docs/RuleCreate.md +12 -0
  127. data/docs/RuleResponse.md +15 -0
  128. data/docs/RuleResponseAllOf.md +13 -0
  129. data/docs/RuleUpdate.md +12 -0
  130. data/docs/RulesResponse.md +11 -0
  131. data/docs/Script.md +20 -0
  132. data/docs/ScriptUpdate.md +12 -0
  133. data/docs/SecretStoreApi.md +2 -2
  134. data/docs/SecretStoreItemApi.md +2 -2
  135. data/docs/SecurityHeader.md +12 -0
  136. data/docs/ServiceAuthorizationsApi.md +2 -2
  137. data/docs/ServiceAuthorizationsResponse.md +1 -1
  138. data/docs/SuccessfulResponseAsObject.md +1 -0
  139. data/docs/SuccessfulResponseAsObjectAllOf.md +1 -0
  140. data/docs/TlsActivationsResponse.md +1 -1
  141. data/docs/TlsBulkCertificatesResponse.md +1 -1
  142. data/docs/TlsCertificatesResponse.md +1 -1
  143. data/docs/TlsConfigurationsResponse.md +1 -1
  144. data/docs/TlsDomainsResponse.md +1 -1
  145. data/docs/TlsPrivateKeysResponse.md +1 -1
  146. data/docs/TlsSubscriptionsResponse.md +1 -1
  147. data/docs/VersionsResponse.md +11 -0
  148. data/docs/WafSimulateRequest.md +11 -0
  149. data/docs/WafSimulateResponse.md +11 -0
  150. data/docs/WafSimulateSignal.md +16 -0
  151. data/docs/Website.md +14 -0
  152. data/docs/WebsiteCreate.md +10 -0
  153. data/docs/WebsiteUpdate.md +10 -0
  154. data/lib/fastly/api/backend_api.rb +16 -4
  155. data/lib/fastly/api/client_side_protection_api.rb +1465 -0
  156. data/lib/fastly/api/ddos_protection_api.rb +6 -6
  157. data/lib/fastly/api/dm_domains_api.rb +3 -3
  158. data/lib/fastly/api/dm_routing_configs_api.rb +1596 -0
  159. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  160. data/lib/fastly/api/domain_research_api.rb +3 -3
  161. data/lib/fastly/api/kv_store_api.rb +3 -3
  162. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  163. data/lib/fastly/api/logging_azureblob_api.rb +6 -6
  164. data/lib/fastly/api/logging_cloudfiles_api.rb +6 -6
  165. data/lib/fastly/api/logging_digitalocean_api.rb +6 -6
  166. data/lib/fastly/api/logging_ftp_api.rb +6 -6
  167. data/lib/fastly/api/logging_gcs_api.rb +6 -6
  168. data/lib/fastly/api/logging_https_api.rb +4 -4
  169. data/lib/fastly/api/logging_openstack_api.rb +6 -6
  170. data/lib/fastly/api/logging_s3_api.rb +6 -6
  171. data/lib/fastly/api/logging_sftp_api.rb +6 -6
  172. data/lib/fastly/api/logging_sumologic_api.rb +4 -4
  173. data/lib/fastly/api/logging_syslog_api.rb +4 -4
  174. data/lib/fastly/api/ngwaf_agent_keys_api.rb +83 -0
  175. data/lib/fastly/api/ngwaf_simulate_api.rb +95 -0
  176. data/lib/fastly/api/product_bot_management_api.rb +133 -0
  177. data/lib/fastly/api/product_kv_store_api.rb +186 -0
  178. data/lib/fastly/api/secret_store_api.rb +3 -3
  179. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  180. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  181. data/lib/fastly/configuration.rb +294 -0
  182. data/lib/fastly/models/action.rb +237 -0
  183. data/lib/fastly/models/action_type.rb +34 -0
  184. data/lib/fastly/models/agent_key.rb +283 -0
  185. data/lib/fastly/models/agent_key_meta.rb +223 -0
  186. data/lib/fastly/models/backend.rb +24 -2
  187. data/lib/fastly/models/backend_response.rb +24 -2
  188. data/lib/fastly/models/bot_management_request_update_configuration.rb +256 -0
  189. data/lib/fastly/models/bot_management_response_configuration.rb +216 -0
  190. data/lib/fastly/models/bot_management_response_configuration_configuration.rb +217 -0
  191. data/lib/fastly/models/bot_management_response_configure.rb +253 -0
  192. data/lib/fastly/models/condition_operator.rb +37 -0
  193. data/lib/fastly/models/condition_type.rb +34 -0
  194. data/lib/fastly/models/directive.rb +229 -0
  195. data/lib/fastly/models/draft_diff.rb +244 -0
  196. data/lib/fastly/models/draft_update.rb +218 -0
  197. data/lib/fastly/models/events_response.rb +1 -1
  198. data/lib/fastly/models/header_event.rb +252 -0
  199. data/lib/fastly/models/initial_version.rb +242 -0
  200. data/lib/fastly/models/initial_version_path.rb +254 -0
  201. data/lib/fastly/models/inline_response20010.rb +2 -2
  202. data/lib/fastly/models/inline_response20011.rb +2 -2
  203. data/lib/fastly/models/inline_response20012.rb +1 -1
  204. data/lib/fastly/models/inline_response20013.rb +11 -1
  205. data/lib/fastly/models/inline_response20014.rb +15 -4
  206. data/lib/fastly/models/inline_response20015.rb +217 -0
  207. data/lib/fastly/models/inline_response20016.rb +218 -0
  208. data/lib/fastly/models/inline_response20017.rb +227 -0
  209. data/lib/fastly/models/inline_response20018.rb +227 -0
  210. data/lib/fastly/models/inline_response20019.rb +228 -0
  211. data/lib/fastly/models/inline_response20020.rb +227 -0
  212. data/lib/fastly/models/inline_response20021.rb +227 -0
  213. data/lib/fastly/models/inline_response20022.rb +218 -0
  214. data/lib/fastly/models/inline_response2005.rb +2 -2
  215. data/lib/fastly/models/inline_response2006.rb +2 -12
  216. data/lib/fastly/models/inline_response2007.rb +2 -4
  217. data/lib/fastly/models/inline_response2008.rb +18 -8
  218. data/lib/fastly/models/inline_response2009.rb +17 -8
  219. data/lib/fastly/models/invitations_response.rb +1 -1
  220. data/lib/fastly/models/kv_store_response_body_enable.rb +243 -0
  221. data/lib/fastly/models/kv_store_response_customer.rb +216 -0
  222. data/lib/fastly/models/kv_store_response_links.rb +216 -0
  223. data/lib/fastly/models/kv_store_response_links_links.rb +217 -0
  224. data/lib/fastly/models/kv_store_response_product.rb +216 -0
  225. data/lib/fastly/models/kv_store_response_product_product.rb +227 -0
  226. data/lib/fastly/models/logging_azureblob_response.rb +3 -3
  227. data/lib/fastly/models/logging_cloudfiles_response.rb +3 -3
  228. data/lib/fastly/models/logging_digitalocean_response.rb +3 -3
  229. data/lib/fastly/models/logging_ftp_response.rb +3 -3
  230. data/lib/fastly/models/logging_gcs_response.rb +3 -3
  231. data/lib/fastly/models/logging_generic_common.rb +3 -3
  232. data/lib/fastly/models/logging_generic_common_response.rb +3 -3
  233. data/lib/fastly/models/logging_generic_common_response_all_of.rb +3 -3
  234. data/lib/fastly/models/logging_https_additional.rb +1 -1
  235. data/lib/fastly/models/logging_https_response.rb +1 -1
  236. data/lib/fastly/models/logging_message_type.rb +1 -1
  237. data/lib/fastly/models/logging_openstack_response.rb +3 -3
  238. data/lib/fastly/models/logging_s3_response.rb +3 -3
  239. data/lib/fastly/models/logging_sftp_response.rb +3 -3
  240. data/lib/fastly/models/logging_sumologic_additional.rb +1 -1
  241. data/lib/fastly/models/logging_sumologic_response.rb +1 -1
  242. data/lib/fastly/models/logging_syslog_additional.rb +1 -1
  243. data/lib/fastly/models/logging_syslog_response.rb +1 -1
  244. data/lib/fastly/models/mutual_authentications_response.rb +1 -1
  245. data/lib/fastly/models/notification.rb +270 -0
  246. data/lib/fastly/models/notification_config.rb +218 -0
  247. data/lib/fastly/models/page.rb +289 -0
  248. data/lib/fastly/models/page_create.rb +266 -0
  249. data/lib/fastly/models/page_update.rb +256 -0
  250. data/lib/fastly/models/pagination.rb +1 -1
  251. data/lib/fastly/models/pagination_meta.rb +30 -55
  252. data/lib/fastly/models/pagination_meta1.rb +273 -0
  253. data/lib/fastly/models/path_change.rb +274 -0
  254. data/lib/fastly/models/path_create.rb +242 -0
  255. data/lib/fastly/models/path_response.rb +285 -0
  256. data/lib/fastly/models/path_response_all_of.rb +254 -0
  257. data/lib/fastly/models/path_update.rb +233 -0
  258. data/lib/fastly/models/path_with_rules.rb +228 -0
  259. data/lib/fastly/models/paths_response.rb +228 -0
  260. data/lib/fastly/models/policy.rb +315 -0
  261. data/lib/fastly/models/policy_create.rb +289 -0
  262. data/lib/fastly/models/policy_update.rb +279 -0
  263. data/lib/fastly/models/position.rb +228 -0
  264. data/lib/fastly/models/realtime_entry.rb +2 -5
  265. data/lib/fastly/models/realtime_entry_aggregated.rb +344 -34
  266. data/lib/fastly/models/realtime_entry_datacenter.rb +3577 -0
  267. data/lib/fastly/models/realtime_measurements.rb +344 -34
  268. data/lib/fastly/models/report.rb +261 -0
  269. data/lib/fastly/models/request_body_for_create.rb +12 -1
  270. data/lib/fastly/models/request_body_for_update.rb +12 -1
  271. data/lib/fastly/models/results.rb +341 -31
  272. data/lib/fastly/models/routing_config.rb +251 -0
  273. data/lib/fastly/models/routing_config_condition.rb +261 -0
  274. data/lib/fastly/models/routing_config_response.rb +305 -0
  275. data/lib/fastly/models/routing_config_response_all_of.rb +274 -0
  276. data/lib/fastly/models/routing_config_state.rb +36 -0
  277. data/lib/fastly/models/routing_config_version_response.rb +250 -0
  278. data/lib/fastly/models/routing_configs_response.rb +228 -0
  279. data/lib/fastly/models/rule_change.rb +236 -0
  280. data/lib/fastly/models/rule_create.rb +267 -0
  281. data/lib/fastly/models/rule_response.rb +279 -0
  282. data/lib/fastly/models/rule_response_all_of.rb +248 -0
  283. data/lib/fastly/models/rule_update.rb +252 -0
  284. data/lib/fastly/models/rules_response.rb +228 -0
  285. data/lib/fastly/models/script.rb +350 -0
  286. data/lib/fastly/models/script_update.rb +271 -0
  287. data/lib/fastly/models/security_header.rb +234 -0
  288. data/lib/fastly/models/service_authorizations_response.rb +1 -1
  289. data/lib/fastly/models/successful_response_as_object.rb +12 -1
  290. data/lib/fastly/models/successful_response_as_object_all_of.rb +12 -1
  291. data/lib/fastly/models/tls_activations_response.rb +1 -1
  292. data/lib/fastly/models/tls_bulk_certificates_response.rb +1 -1
  293. data/lib/fastly/models/tls_certificates_response.rb +1 -1
  294. data/lib/fastly/models/tls_configurations_response.rb +1 -1
  295. data/lib/fastly/models/tls_domains_response.rb +1 -1
  296. data/lib/fastly/models/tls_private_keys_response.rb +1 -1
  297. data/lib/fastly/models/tls_subscriptions_response.rb +1 -1
  298. data/lib/fastly/models/versions_response.rb +228 -0
  299. data/lib/fastly/models/waf_simulate_request.rb +233 -0
  300. data/lib/fastly/models/waf_simulate_response.rb +240 -0
  301. data/lib/fastly/models/waf_simulate_signal.rb +344 -0
  302. data/lib/fastly/models/website.rb +257 -0
  303. data/lib/fastly/models/website_create.rb +222 -0
  304. data/lib/fastly/models/website_update.rb +217 -0
  305. data/lib/fastly/version.rb +1 -1
  306. data/lib/fastly.rb +77 -0
  307. data/sig.json +1 -1
  308. metadata +156 -2
@@ -0,0 +1,1465 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'cgi'
12
+
13
+ module Fastly
14
+ class ClientSideProtectionApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+ # Create page
21
+ # Create a new page for monitoring.
22
+ # @option opts [PageCreate] :page_create
23
+ # @return [Page]
24
+ def csp_create_page(opts = {})
25
+ data, _status_code, _headers = csp_create_page_with_http_info(opts)
26
+ data
27
+ end
28
+
29
+ # Create page
30
+ # Create a new page for monitoring.
31
+ # @option opts [PageCreate] :page_create
32
+ # @return [Array<(Page, Integer, Hash)>] Page data, response status code and response headers
33
+ def csp_create_page_with_http_info(opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_create_page ...'
36
+ end
37
+ # unbox the parameters from the hash
38
+ # resource path
39
+ local_var_path = '/client-side-protection/v1/pages'
40
+
41
+ # query parameters
42
+ query_params = opts[:query_params] || {}
43
+
44
+ # header parameters
45
+ header_params = opts[:header_params] || {}
46
+ # HTTP header 'Accept' (if needed)
47
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
48
+ # HTTP header 'Content-Type'
49
+ content_type = @api_client.select_header_content_type(['application/json'])
50
+ if !content_type.nil?
51
+ header_params['Content-Type'] = content_type
52
+ end
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'page_create'])
59
+
60
+ # return_type
61
+ return_type = opts[:debug_return_type] || 'Page'
62
+
63
+ # auth_names
64
+ auth_names = opts[:debug_auth_names] || ['token']
65
+
66
+ new_options = opts.merge(
67
+ :operation => :"ClientSideProtectionApi.csp_create_page",
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_create_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+
83
+ # Create policy
84
+ # Create a new Content Security Policy for a page.
85
+ # @option opts [String] :page_id Page identifier (required)
86
+ # @option opts [PolicyCreate] :policy_create
87
+ # @return [Policy]
88
+ def csp_create_policy(opts = {})
89
+ data, _status_code, _headers = csp_create_policy_with_http_info(opts)
90
+ data
91
+ end
92
+
93
+ # Create policy
94
+ # Create a new Content Security Policy for a page.
95
+ # @option opts [String] :page_id Page identifier (required)
96
+ # @option opts [PolicyCreate] :policy_create
97
+ # @return [Array<(Policy, Integer, Hash)>] Policy data, response status code and response headers
98
+ def csp_create_policy_with_http_info(opts = {})
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_create_policy ...'
101
+ end
102
+ # unbox the parameters from the hash
103
+ page_id = opts[:'page_id']
104
+ # verify the required parameter 'page_id' is set
105
+ if @api_client.config.client_side_validation && page_id.nil?
106
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_create_policy"
107
+ end
108
+ # resource path
109
+ local_var_path = '/client-side-protection/v1/pages/{page_id}/policies'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
110
+
111
+ # query parameters
112
+ query_params = opts[:query_params] || {}
113
+
114
+ # header parameters
115
+ header_params = opts[:header_params] || {}
116
+ # HTTP header 'Accept' (if needed)
117
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
118
+ # HTTP header 'Content-Type'
119
+ content_type = @api_client.select_header_content_type(['application/json'])
120
+ if !content_type.nil?
121
+ header_params['Content-Type'] = content_type
122
+ end
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'policy_create'])
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type] || 'Policy'
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['token']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"ClientSideProtectionApi.csp_create_policy",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_create_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # Create website
154
+ # Create a new website for Client-Side Protection monitoring.
155
+ # @option opts [WebsiteCreate] :website_create
156
+ # @return [Website]
157
+ def csp_create_website(opts = {})
158
+ data, _status_code, _headers = csp_create_website_with_http_info(opts)
159
+ data
160
+ end
161
+
162
+ # Create website
163
+ # Create a new website for Client-Side Protection monitoring.
164
+ # @option opts [WebsiteCreate] :website_create
165
+ # @return [Array<(Website, Integer, Hash)>] Website data, response status code and response headers
166
+ def csp_create_website_with_http_info(opts = {})
167
+ if @api_client.config.debugging
168
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_create_website ...'
169
+ end
170
+ # unbox the parameters from the hash
171
+ # resource path
172
+ local_var_path = '/client-side-protection/v1/websites'
173
+
174
+ # query parameters
175
+ query_params = opts[:query_params] || {}
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
181
+ # HTTP header 'Content-Type'
182
+ content_type = @api_client.select_header_content_type(['application/json'])
183
+ if !content_type.nil?
184
+ header_params['Content-Type'] = content_type
185
+ end
186
+
187
+ # form parameters
188
+ form_params = opts[:form_params] || {}
189
+
190
+ # http body (model)
191
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'website_create'])
192
+
193
+ # return_type
194
+ return_type = opts[:debug_return_type] || 'Website'
195
+
196
+ # auth_names
197
+ auth_names = opts[:debug_auth_names] || ['token']
198
+
199
+ new_options = opts.merge(
200
+ :operation => :"ClientSideProtectionApi.csp_create_website",
201
+ :header_params => header_params,
202
+ :query_params => query_params,
203
+ :form_params => form_params,
204
+ :body => post_body,
205
+ :auth_names => auth_names,
206
+ :return_type => return_type
207
+ )
208
+
209
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_create_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
212
+ end
213
+ return data, status_code, headers
214
+ end
215
+
216
+ # Delete page
217
+ # Delete a page and all associated scripts and policies.
218
+ # @option opts [String] :page_id Page identifier (required)
219
+ # @return [nil]
220
+ def csp_delete_page(opts = {})
221
+ csp_delete_page_with_http_info(opts)
222
+ nil
223
+ end
224
+
225
+ # Delete page
226
+ # Delete a page and all associated scripts and policies.
227
+ # @option opts [String] :page_id Page identifier (required)
228
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
229
+ def csp_delete_page_with_http_info(opts = {})
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_delete_page ...'
232
+ end
233
+ # unbox the parameters from the hash
234
+ page_id = opts[:'page_id']
235
+ # verify the required parameter 'page_id' is set
236
+ if @api_client.config.client_side_validation && page_id.nil?
237
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_delete_page"
238
+ end
239
+ # resource path
240
+ local_var_path = '/client-side-protection/v1/pages/{page_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+
245
+ # header parameters
246
+ header_params = opts[:header_params] || {}
247
+ # HTTP header 'Accept' (if needed)
248
+ header_params['Accept'] = @api_client.select_header_accept(['application/problem+json'])
249
+
250
+ # form parameters
251
+ form_params = opts[:form_params] || {}
252
+
253
+ # http body (model)
254
+ post_body = opts[:debug_body]
255
+
256
+ # return_type
257
+ return_type = opts[:debug_return_type]
258
+
259
+ # auth_names
260
+ auth_names = opts[:debug_auth_names] || ['token']
261
+
262
+ new_options = opts.merge(
263
+ :operation => :"ClientSideProtectionApi.csp_delete_page",
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => return_type
270
+ )
271
+
272
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_delete_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
275
+ end
276
+ return data, status_code, headers
277
+ end
278
+
279
+ # Delete website
280
+ # Delete a website and all associated pages, scripts, and policies.
281
+ # @option opts [String] :website_id Website identifier (required)
282
+ # @return [nil]
283
+ def csp_delete_website(opts = {})
284
+ csp_delete_website_with_http_info(opts)
285
+ nil
286
+ end
287
+
288
+ # Delete website
289
+ # Delete a website and all associated pages, scripts, and policies.
290
+ # @option opts [String] :website_id Website identifier (required)
291
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
292
+ def csp_delete_website_with_http_info(opts = {})
293
+ if @api_client.config.debugging
294
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_delete_website ...'
295
+ end
296
+ # unbox the parameters from the hash
297
+ website_id = opts[:'website_id']
298
+ # verify the required parameter 'website_id' is set
299
+ if @api_client.config.client_side_validation && website_id.nil?
300
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling ClientSideProtectionApi.csp_delete_website"
301
+ end
302
+ # resource path
303
+ local_var_path = '/client-side-protection/v1/websites/{website_id}'.sub('{' + 'website_id' + '}', CGI.escape(website_id.to_s))
304
+
305
+ # query parameters
306
+ query_params = opts[:query_params] || {}
307
+
308
+ # header parameters
309
+ header_params = opts[:header_params] || {}
310
+ # HTTP header 'Accept' (if needed)
311
+ header_params['Accept'] = @api_client.select_header_accept(['application/problem+json'])
312
+
313
+ # form parameters
314
+ form_params = opts[:form_params] || {}
315
+
316
+ # http body (model)
317
+ post_body = opts[:debug_body]
318
+
319
+ # return_type
320
+ return_type = opts[:debug_return_type]
321
+
322
+ # auth_names
323
+ auth_names = opts[:debug_auth_names] || ['token']
324
+
325
+ new_options = opts.merge(
326
+ :operation => :"ClientSideProtectionApi.csp_delete_website",
327
+ :header_params => header_params,
328
+ :query_params => query_params,
329
+ :form_params => form_params,
330
+ :body => post_body,
331
+ :auth_names => auth_names,
332
+ :return_type => return_type
333
+ )
334
+
335
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
336
+ if @api_client.config.debugging
337
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_delete_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
338
+ end
339
+ return data, status_code, headers
340
+ end
341
+
342
+ # Get page
343
+ # Get details for a specific page.
344
+ # @option opts [String] :page_id Page identifier (required)
345
+ # @return [Page]
346
+ def csp_get_page(opts = {})
347
+ data, _status_code, _headers = csp_get_page_with_http_info(opts)
348
+ data
349
+ end
350
+
351
+ # Get page
352
+ # Get details for a specific page.
353
+ # @option opts [String] :page_id Page identifier (required)
354
+ # @return [Array<(Page, Integer, Hash)>] Page data, response status code and response headers
355
+ def csp_get_page_with_http_info(opts = {})
356
+ if @api_client.config.debugging
357
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_page ...'
358
+ end
359
+ # unbox the parameters from the hash
360
+ page_id = opts[:'page_id']
361
+ # verify the required parameter 'page_id' is set
362
+ if @api_client.config.client_side_validation && page_id.nil?
363
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_get_page"
364
+ end
365
+ # resource path
366
+ local_var_path = '/client-side-protection/v1/pages/{page_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
367
+
368
+ # query parameters
369
+ query_params = opts[:query_params] || {}
370
+
371
+ # header parameters
372
+ header_params = opts[:header_params] || {}
373
+ # HTTP header 'Accept' (if needed)
374
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
375
+
376
+ # form parameters
377
+ form_params = opts[:form_params] || {}
378
+
379
+ # http body (model)
380
+ post_body = opts[:debug_body]
381
+
382
+ # return_type
383
+ return_type = opts[:debug_return_type] || 'Page'
384
+
385
+ # auth_names
386
+ auth_names = opts[:debug_auth_names] || ['token']
387
+
388
+ new_options = opts.merge(
389
+ :operation => :"ClientSideProtectionApi.csp_get_page",
390
+ :header_params => header_params,
391
+ :query_params => query_params,
392
+ :form_params => form_params,
393
+ :body => post_body,
394
+ :auth_names => auth_names,
395
+ :return_type => return_type
396
+ )
397
+
398
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
399
+ if @api_client.config.debugging
400
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
401
+ end
402
+ return data, status_code, headers
403
+ end
404
+
405
+ # Get policy
406
+ # Get details for a specific policy.
407
+ # @option opts [String] :page_id Page identifier (required)
408
+ # @option opts [String] :policy_id Policy identifier (required)
409
+ # @return [Policy]
410
+ def csp_get_policy(opts = {})
411
+ data, _status_code, _headers = csp_get_policy_with_http_info(opts)
412
+ data
413
+ end
414
+
415
+ # Get policy
416
+ # Get details for a specific policy.
417
+ # @option opts [String] :page_id Page identifier (required)
418
+ # @option opts [String] :policy_id Policy identifier (required)
419
+ # @return [Array<(Policy, Integer, Hash)>] Policy data, response status code and response headers
420
+ def csp_get_policy_with_http_info(opts = {})
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_policy ...'
423
+ end
424
+ # unbox the parameters from the hash
425
+ page_id = opts[:'page_id']
426
+ policy_id = opts[:'policy_id']
427
+ # verify the required parameter 'page_id' is set
428
+ if @api_client.config.client_side_validation && page_id.nil?
429
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_get_policy"
430
+ end
431
+ # verify the required parameter 'policy_id' is set
432
+ if @api_client.config.client_side_validation && policy_id.nil?
433
+ fail ArgumentError, "Missing the required parameter 'policy_id' when calling ClientSideProtectionApi.csp_get_policy"
434
+ end
435
+ # resource path
436
+ 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))
437
+
438
+ # query parameters
439
+ query_params = opts[:query_params] || {}
440
+
441
+ # header parameters
442
+ header_params = opts[:header_params] || {}
443
+ # HTTP header 'Accept' (if needed)
444
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
445
+
446
+ # form parameters
447
+ form_params = opts[:form_params] || {}
448
+
449
+ # http body (model)
450
+ post_body = opts[:debug_body]
451
+
452
+ # return_type
453
+ return_type = opts[:debug_return_type] || 'Policy'
454
+
455
+ # auth_names
456
+ auth_names = opts[:debug_auth_names] || ['token']
457
+
458
+ new_options = opts.merge(
459
+ :operation => :"ClientSideProtectionApi.csp_get_policy",
460
+ :header_params => header_params,
461
+ :query_params => query_params,
462
+ :form_params => form_params,
463
+ :body => post_body,
464
+ :auth_names => auth_names,
465
+ :return_type => return_type
466
+ )
467
+
468
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
469
+ if @api_client.config.debugging
470
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
471
+ end
472
+ return data, status_code, headers
473
+ end
474
+
475
+ # Get script
476
+ # Get details for a specific script.
477
+ # @option opts [String] :page_id Page identifier (required)
478
+ # @option opts [String] :script_id Script identifier (required)
479
+ # @return [Script]
480
+ def csp_get_script(opts = {})
481
+ data, _status_code, _headers = csp_get_script_with_http_info(opts)
482
+ data
483
+ end
484
+
485
+ # Get script
486
+ # Get details for a specific script.
487
+ # @option opts [String] :page_id Page identifier (required)
488
+ # @option opts [String] :script_id Script identifier (required)
489
+ # @return [Array<(Script, Integer, Hash)>] Script data, response status code and response headers
490
+ def csp_get_script_with_http_info(opts = {})
491
+ if @api_client.config.debugging
492
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_script ...'
493
+ end
494
+ # unbox the parameters from the hash
495
+ page_id = opts[:'page_id']
496
+ script_id = opts[:'script_id']
497
+ # verify the required parameter 'page_id' is set
498
+ if @api_client.config.client_side_validation && page_id.nil?
499
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_get_script"
500
+ end
501
+ # verify the required parameter 'script_id' is set
502
+ if @api_client.config.client_side_validation && script_id.nil?
503
+ fail ArgumentError, "Missing the required parameter 'script_id' when calling ClientSideProtectionApi.csp_get_script"
504
+ end
505
+ # resource path
506
+ 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))
507
+
508
+ # query parameters
509
+ query_params = opts[:query_params] || {}
510
+
511
+ # header parameters
512
+ header_params = opts[:header_params] || {}
513
+ # HTTP header 'Accept' (if needed)
514
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
515
+
516
+ # form parameters
517
+ form_params = opts[:form_params] || {}
518
+
519
+ # http body (model)
520
+ post_body = opts[:debug_body]
521
+
522
+ # return_type
523
+ return_type = opts[:debug_return_type] || 'Script'
524
+
525
+ # auth_names
526
+ auth_names = opts[:debug_auth_names] || ['token']
527
+
528
+ new_options = opts.merge(
529
+ :operation => :"ClientSideProtectionApi.csp_get_script",
530
+ :header_params => header_params,
531
+ :query_params => query_params,
532
+ :form_params => form_params,
533
+ :body => post_body,
534
+ :auth_names => auth_names,
535
+ :return_type => return_type
536
+ )
537
+
538
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
539
+ if @api_client.config.debugging
540
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_script\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
541
+ end
542
+ return data, status_code, headers
543
+ end
544
+
545
+ # Get website
546
+ # Get details for a specific website.
547
+ # @option opts [String] :website_id Website identifier (required)
548
+ # @return [Website]
549
+ def csp_get_website(opts = {})
550
+ data, _status_code, _headers = csp_get_website_with_http_info(opts)
551
+ data
552
+ end
553
+
554
+ # Get website
555
+ # Get details for a specific website.
556
+ # @option opts [String] :website_id Website identifier (required)
557
+ # @return [Array<(Website, Integer, Hash)>] Website data, response status code and response headers
558
+ def csp_get_website_with_http_info(opts = {})
559
+ if @api_client.config.debugging
560
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_get_website ...'
561
+ end
562
+ # unbox the parameters from the hash
563
+ website_id = opts[:'website_id']
564
+ # verify the required parameter 'website_id' is set
565
+ if @api_client.config.client_side_validation && website_id.nil?
566
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling ClientSideProtectionApi.csp_get_website"
567
+ end
568
+ # resource path
569
+ local_var_path = '/client-side-protection/v1/websites/{website_id}'.sub('{' + 'website_id' + '}', CGI.escape(website_id.to_s))
570
+
571
+ # query parameters
572
+ query_params = opts[:query_params] || {}
573
+
574
+ # header parameters
575
+ header_params = opts[:header_params] || {}
576
+ # HTTP header 'Accept' (if needed)
577
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
578
+
579
+ # form parameters
580
+ form_params = opts[:form_params] || {}
581
+
582
+ # http body (model)
583
+ post_body = opts[:debug_body]
584
+
585
+ # return_type
586
+ return_type = opts[:debug_return_type] || 'Website'
587
+
588
+ # auth_names
589
+ auth_names = opts[:debug_auth_names] || ['token']
590
+
591
+ new_options = opts.merge(
592
+ :operation => :"ClientSideProtectionApi.csp_get_website",
593
+ :header_params => header_params,
594
+ :query_params => query_params,
595
+ :form_params => form_params,
596
+ :body => post_body,
597
+ :auth_names => auth_names,
598
+ :return_type => return_type
599
+ )
600
+
601
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
602
+ if @api_client.config.debugging
603
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_get_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
604
+ end
605
+ return data, status_code, headers
606
+ end
607
+
608
+ # List header events
609
+ # List security header change events for a page.
610
+ # @option opts [String] :page_id Page identifier (required)
611
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
612
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
613
+ # @return [InlineResponse20011]
614
+ def csp_list_header_events(opts = {})
615
+ data, _status_code, _headers = csp_list_header_events_with_http_info(opts)
616
+ data
617
+ end
618
+
619
+ # List header events
620
+ # List security header change events for a page.
621
+ # @option opts [String] :page_id Page identifier (required)
622
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
623
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
624
+ # @return [Array<(InlineResponse20011, Integer, Hash)>] InlineResponse20011 data, response status code and response headers
625
+ def csp_list_header_events_with_http_info(opts = {})
626
+ if @api_client.config.debugging
627
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_header_events ...'
628
+ end
629
+ # unbox the parameters from the hash
630
+ page_id = opts[:'page_id']
631
+ # verify the required parameter 'page_id' is set
632
+ if @api_client.config.client_side_validation && page_id.nil?
633
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_header_events"
634
+ end
635
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
636
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_header_events, must be smaller than or equal to 1000.'
637
+ end
638
+
639
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
640
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_header_events, must be greater than or equal to 1.'
641
+ end
642
+
643
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
644
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_header_events, must be greater than or equal to 0.'
645
+ end
646
+
647
+ # resource path
648
+ local_var_path = '/client-side-protection/v1/pages/{page_id}/events'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
649
+
650
+ # query parameters
651
+ query_params = opts[:query_params] || {}
652
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
653
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
654
+
655
+ # header parameters
656
+ header_params = opts[:header_params] || {}
657
+ # HTTP header 'Accept' (if needed)
658
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
659
+
660
+ # form parameters
661
+ form_params = opts[:form_params] || {}
662
+
663
+ # http body (model)
664
+ post_body = opts[:debug_body]
665
+
666
+ # return_type
667
+ return_type = opts[:debug_return_type] || 'InlineResponse20011'
668
+
669
+ # auth_names
670
+ auth_names = opts[:debug_auth_names] || ['token']
671
+
672
+ new_options = opts.merge(
673
+ :operation => :"ClientSideProtectionApi.csp_list_header_events",
674
+ :header_params => header_params,
675
+ :query_params => query_params,
676
+ :form_params => form_params,
677
+ :body => post_body,
678
+ :auth_names => auth_names,
679
+ :return_type => return_type
680
+ )
681
+
682
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
683
+ if @api_client.config.debugging
684
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_header_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
685
+ end
686
+ return data, status_code, headers
687
+ end
688
+
689
+ # List security headers
690
+ # List security headers detected on a page.
691
+ # @option opts [String] :page_id Page identifier (required)
692
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
693
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
694
+ # @return [InlineResponse20010]
695
+ def csp_list_headers(opts = {})
696
+ data, _status_code, _headers = csp_list_headers_with_http_info(opts)
697
+ data
698
+ end
699
+
700
+ # List security headers
701
+ # List security headers detected on a page.
702
+ # @option opts [String] :page_id Page identifier (required)
703
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
704
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
705
+ # @return [Array<(InlineResponse20010, Integer, Hash)>] InlineResponse20010 data, response status code and response headers
706
+ def csp_list_headers_with_http_info(opts = {})
707
+ if @api_client.config.debugging
708
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_headers ...'
709
+ end
710
+ # unbox the parameters from the hash
711
+ page_id = opts[:'page_id']
712
+ # verify the required parameter 'page_id' is set
713
+ if @api_client.config.client_side_validation && page_id.nil?
714
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_headers"
715
+ end
716
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
717
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_headers, must be smaller than or equal to 1000.'
718
+ end
719
+
720
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
721
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_headers, must be greater than or equal to 1.'
722
+ end
723
+
724
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
725
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_headers, must be greater than or equal to 0.'
726
+ end
727
+
728
+ # resource path
729
+ local_var_path = '/client-side-protection/v1/pages/{page_id}/headers'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
730
+
731
+ # query parameters
732
+ query_params = opts[:query_params] || {}
733
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
734
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
735
+
736
+ # header parameters
737
+ header_params = opts[:header_params] || {}
738
+ # HTTP header 'Accept' (if needed)
739
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
740
+
741
+ # form parameters
742
+ form_params = opts[:form_params] || {}
743
+
744
+ # http body (model)
745
+ post_body = opts[:debug_body]
746
+
747
+ # return_type
748
+ return_type = opts[:debug_return_type] || 'InlineResponse20010'
749
+
750
+ # auth_names
751
+ auth_names = opts[:debug_auth_names] || ['token']
752
+
753
+ new_options = opts.merge(
754
+ :operation => :"ClientSideProtectionApi.csp_list_headers",
755
+ :header_params => header_params,
756
+ :query_params => query_params,
757
+ :form_params => form_params,
758
+ :body => post_body,
759
+ :auth_names => auth_names,
760
+ :return_type => return_type
761
+ )
762
+
763
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
764
+ if @api_client.config.debugging
765
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_headers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
766
+ end
767
+ return data, status_code, headers
768
+ end
769
+
770
+ # List pages
771
+ # List all pages. Optionally filter by website.
772
+ # @option opts [String] :website_id Filter pages by website ID
773
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
774
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
775
+ # @return [InlineResponse2006]
776
+ def csp_list_pages(opts = {})
777
+ data, _status_code, _headers = csp_list_pages_with_http_info(opts)
778
+ data
779
+ end
780
+
781
+ # List pages
782
+ # List all pages. Optionally filter by website.
783
+ # @option opts [String] :website_id Filter pages by website ID
784
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
785
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
786
+ # @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
787
+ def csp_list_pages_with_http_info(opts = {})
788
+ if @api_client.config.debugging
789
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_pages ...'
790
+ end
791
+ # unbox the parameters from the hash
792
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
793
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_pages, must be smaller than or equal to 1000.'
794
+ end
795
+
796
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
797
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_pages, must be greater than or equal to 1.'
798
+ end
799
+
800
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
801
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_pages, must be greater than or equal to 0.'
802
+ end
803
+
804
+ # resource path
805
+ local_var_path = '/client-side-protection/v1/pages'
806
+
807
+ # query parameters
808
+ query_params = opts[:query_params] || {}
809
+ query_params[:'website_id'] = opts[:'website_id'] if !opts[:'website_id'].nil?
810
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
811
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
812
+
813
+ # header parameters
814
+ header_params = opts[:header_params] || {}
815
+ # HTTP header 'Accept' (if needed)
816
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
817
+
818
+ # form parameters
819
+ form_params = opts[:form_params] || {}
820
+
821
+ # http body (model)
822
+ post_body = opts[:debug_body]
823
+
824
+ # return_type
825
+ return_type = opts[:debug_return_type] || 'InlineResponse2006'
826
+
827
+ # auth_names
828
+ auth_names = opts[:debug_auth_names] || ['token']
829
+
830
+ new_options = opts.merge(
831
+ :operation => :"ClientSideProtectionApi.csp_list_pages",
832
+ :header_params => header_params,
833
+ :query_params => query_params,
834
+ :form_params => form_params,
835
+ :body => post_body,
836
+ :auth_names => auth_names,
837
+ :return_type => return_type
838
+ )
839
+
840
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
841
+ if @api_client.config.debugging
842
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
843
+ end
844
+ return data, status_code, headers
845
+ end
846
+
847
+ # List policies
848
+ # List all Content Security Policies for a page.
849
+ # @option opts [String] :page_id Page identifier (required)
850
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
851
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
852
+ # @return [InlineResponse2008]
853
+ def csp_list_policies(opts = {})
854
+ data, _status_code, _headers = csp_list_policies_with_http_info(opts)
855
+ data
856
+ end
857
+
858
+ # List policies
859
+ # List all Content Security Policies for a page.
860
+ # @option opts [String] :page_id Page identifier (required)
861
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
862
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
863
+ # @return [Array<(InlineResponse2008, Integer, Hash)>] InlineResponse2008 data, response status code and response headers
864
+ def csp_list_policies_with_http_info(opts = {})
865
+ if @api_client.config.debugging
866
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_policies ...'
867
+ end
868
+ # unbox the parameters from the hash
869
+ page_id = opts[:'page_id']
870
+ # verify the required parameter 'page_id' is set
871
+ if @api_client.config.client_side_validation && page_id.nil?
872
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_policies"
873
+ end
874
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
875
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policies, must be smaller than or equal to 1000.'
876
+ end
877
+
878
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
879
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policies, must be greater than or equal to 1.'
880
+ end
881
+
882
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
883
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_policies, must be greater than or equal to 0.'
884
+ end
885
+
886
+ # resource path
887
+ local_var_path = '/client-side-protection/v1/pages/{page_id}/policies'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
888
+
889
+ # query parameters
890
+ query_params = opts[:query_params] || {}
891
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
892
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
893
+
894
+ # header parameters
895
+ header_params = opts[:header_params] || {}
896
+ # HTTP header 'Accept' (if needed)
897
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
898
+
899
+ # form parameters
900
+ form_params = opts[:form_params] || {}
901
+
902
+ # http body (model)
903
+ post_body = opts[:debug_body]
904
+
905
+ # return_type
906
+ return_type = opts[:debug_return_type] || 'InlineResponse2008'
907
+
908
+ # auth_names
909
+ auth_names = opts[:debug_auth_names] || ['token']
910
+
911
+ new_options = opts.merge(
912
+ :operation => :"ClientSideProtectionApi.csp_list_policies",
913
+ :header_params => header_params,
914
+ :query_params => query_params,
915
+ :form_params => form_params,
916
+ :body => post_body,
917
+ :auth_names => auth_names,
918
+ :return_type => return_type
919
+ )
920
+
921
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
922
+ if @api_client.config.debugging
923
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
924
+ end
925
+ return data, status_code, headers
926
+ end
927
+
928
+ # List policy reports
929
+ # List CSP violation reports for a policy.
930
+ # @option opts [String] :page_id Page identifier (required)
931
+ # @option opts [String] :policy_id Policy identifier (required)
932
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
933
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
934
+ # @return [InlineResponse2009]
935
+ def csp_list_policy_reports(opts = {})
936
+ data, _status_code, _headers = csp_list_policy_reports_with_http_info(opts)
937
+ data
938
+ end
939
+
940
+ # List policy reports
941
+ # List CSP violation reports for a policy.
942
+ # @option opts [String] :page_id Page identifier (required)
943
+ # @option opts [String] :policy_id Policy identifier (required)
944
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
945
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
946
+ # @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
947
+ def csp_list_policy_reports_with_http_info(opts = {})
948
+ if @api_client.config.debugging
949
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_policy_reports ...'
950
+ end
951
+ # unbox the parameters from the hash
952
+ page_id = opts[:'page_id']
953
+ policy_id = opts[:'policy_id']
954
+ # verify the required parameter 'page_id' is set
955
+ if @api_client.config.client_side_validation && page_id.nil?
956
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_policy_reports"
957
+ end
958
+ # verify the required parameter 'policy_id' is set
959
+ if @api_client.config.client_side_validation && policy_id.nil?
960
+ fail ArgumentError, "Missing the required parameter 'policy_id' when calling ClientSideProtectionApi.csp_list_policy_reports"
961
+ end
962
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
963
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policy_reports, must be smaller than or equal to 1000.'
964
+ end
965
+
966
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
967
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_policy_reports, must be greater than or equal to 1.'
968
+ end
969
+
970
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
971
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_policy_reports, must be greater than or equal to 0.'
972
+ end
973
+
974
+ # resource path
975
+ 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))
976
+
977
+ # query parameters
978
+ query_params = opts[:query_params] || {}
979
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
980
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
981
+
982
+ # header parameters
983
+ header_params = opts[:header_params] || {}
984
+ # HTTP header 'Accept' (if needed)
985
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
986
+
987
+ # form parameters
988
+ form_params = opts[:form_params] || {}
989
+
990
+ # http body (model)
991
+ post_body = opts[:debug_body]
992
+
993
+ # return_type
994
+ return_type = opts[:debug_return_type] || 'InlineResponse2009'
995
+
996
+ # auth_names
997
+ auth_names = opts[:debug_auth_names] || ['token']
998
+
999
+ new_options = opts.merge(
1000
+ :operation => :"ClientSideProtectionApi.csp_list_policy_reports",
1001
+ :header_params => header_params,
1002
+ :query_params => query_params,
1003
+ :form_params => form_params,
1004
+ :body => post_body,
1005
+ :auth_names => auth_names,
1006
+ :return_type => return_type
1007
+ )
1008
+
1009
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1010
+ if @api_client.config.debugging
1011
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_policy_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1012
+ end
1013
+ return data, status_code, headers
1014
+ end
1015
+
1016
+ # List scripts
1017
+ # List all scripts detected on a page.
1018
+ # @option opts [String] :page_id Page identifier (required)
1019
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
1020
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
1021
+ # @return [InlineResponse2007]
1022
+ def csp_list_scripts(opts = {})
1023
+ data, _status_code, _headers = csp_list_scripts_with_http_info(opts)
1024
+ data
1025
+ end
1026
+
1027
+ # List scripts
1028
+ # List all scripts detected on a page.
1029
+ # @option opts [String] :page_id Page identifier (required)
1030
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
1031
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
1032
+ # @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers
1033
+ def csp_list_scripts_with_http_info(opts = {})
1034
+ if @api_client.config.debugging
1035
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_scripts ...'
1036
+ end
1037
+ # unbox the parameters from the hash
1038
+ page_id = opts[:'page_id']
1039
+ # verify the required parameter 'page_id' is set
1040
+ if @api_client.config.client_side_validation && page_id.nil?
1041
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_list_scripts"
1042
+ end
1043
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
1044
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_scripts, must be smaller than or equal to 1000.'
1045
+ end
1046
+
1047
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1048
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_scripts, must be greater than or equal to 1.'
1049
+ end
1050
+
1051
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
1052
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_scripts, must be greater than or equal to 0.'
1053
+ end
1054
+
1055
+ # resource path
1056
+ local_var_path = '/client-side-protection/v1/pages/{page_id}/scripts'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
1057
+
1058
+ # query parameters
1059
+ query_params = opts[:query_params] || {}
1060
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1061
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
1062
+
1063
+ # header parameters
1064
+ header_params = opts[:header_params] || {}
1065
+ # HTTP header 'Accept' (if needed)
1066
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
1067
+
1068
+ # form parameters
1069
+ form_params = opts[:form_params] || {}
1070
+
1071
+ # http body (model)
1072
+ post_body = opts[:debug_body]
1073
+
1074
+ # return_type
1075
+ return_type = opts[:debug_return_type] || 'InlineResponse2007'
1076
+
1077
+ # auth_names
1078
+ auth_names = opts[:debug_auth_names] || ['token']
1079
+
1080
+ new_options = opts.merge(
1081
+ :operation => :"ClientSideProtectionApi.csp_list_scripts",
1082
+ :header_params => header_params,
1083
+ :query_params => query_params,
1084
+ :form_params => form_params,
1085
+ :body => post_body,
1086
+ :auth_names => auth_names,
1087
+ :return_type => return_type
1088
+ )
1089
+
1090
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1091
+ if @api_client.config.debugging
1092
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1093
+ end
1094
+ return data, status_code, headers
1095
+ end
1096
+
1097
+ # List websites
1098
+ # List all websites configured for Client-Side Protection.
1099
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
1100
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
1101
+ # @return [InlineResponse2005]
1102
+ def csp_list_websites(opts = {})
1103
+ data, _status_code, _headers = csp_list_websites_with_http_info(opts)
1104
+ data
1105
+ end
1106
+
1107
+ # List websites
1108
+ # List all websites configured for Client-Side Protection.
1109
+ # @option opts [Integer] :limit Limit how many results are returned. (default to 100)
1110
+ # @option opts [Integer] :page Page number of the collection to request. (default to 0)
1111
+ # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers
1112
+ def csp_list_websites_with_http_info(opts = {})
1113
+ if @api_client.config.debugging
1114
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_list_websites ...'
1115
+ end
1116
+ # unbox the parameters from the hash
1117
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
1118
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_websites, must be smaller than or equal to 1000.'
1119
+ end
1120
+
1121
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1122
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ClientSideProtectionApi.csp_list_websites, must be greater than or equal to 1.'
1123
+ end
1124
+
1125
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
1126
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ClientSideProtectionApi.csp_list_websites, must be greater than or equal to 0.'
1127
+ end
1128
+
1129
+ # resource path
1130
+ local_var_path = '/client-side-protection/v1/websites'
1131
+
1132
+ # query parameters
1133
+ query_params = opts[:query_params] || {}
1134
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1135
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
1136
+
1137
+ # header parameters
1138
+ header_params = opts[:header_params] || {}
1139
+ # HTTP header 'Accept' (if needed)
1140
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
1141
+
1142
+ # form parameters
1143
+ form_params = opts[:form_params] || {}
1144
+
1145
+ # http body (model)
1146
+ post_body = opts[:debug_body]
1147
+
1148
+ # return_type
1149
+ return_type = opts[:debug_return_type] || 'InlineResponse2005'
1150
+
1151
+ # auth_names
1152
+ auth_names = opts[:debug_auth_names] || ['token']
1153
+
1154
+ new_options = opts.merge(
1155
+ :operation => :"ClientSideProtectionApi.csp_list_websites",
1156
+ :header_params => header_params,
1157
+ :query_params => query_params,
1158
+ :form_params => form_params,
1159
+ :body => post_body,
1160
+ :auth_names => auth_names,
1161
+ :return_type => return_type
1162
+ )
1163
+
1164
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1165
+ if @api_client.config.debugging
1166
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_list_websites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1167
+ end
1168
+ return data, status_code, headers
1169
+ end
1170
+
1171
+ # Update page
1172
+ # Update a page's configuration.
1173
+ # @option opts [String] :page_id Page identifier (required)
1174
+ # @option opts [PageUpdate] :page_update
1175
+ # @return [Page]
1176
+ def csp_update_page(opts = {})
1177
+ data, _status_code, _headers = csp_update_page_with_http_info(opts)
1178
+ data
1179
+ end
1180
+
1181
+ # Update page
1182
+ # Update a page&#39;s configuration.
1183
+ # @option opts [String] :page_id Page identifier (required)
1184
+ # @option opts [PageUpdate] :page_update
1185
+ # @return [Array<(Page, Integer, Hash)>] Page data, response status code and response headers
1186
+ def csp_update_page_with_http_info(opts = {})
1187
+ if @api_client.config.debugging
1188
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_page ...'
1189
+ end
1190
+ # unbox the parameters from the hash
1191
+ page_id = opts[:'page_id']
1192
+ # verify the required parameter 'page_id' is set
1193
+ if @api_client.config.client_side_validation && page_id.nil?
1194
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_update_page"
1195
+ end
1196
+ # resource path
1197
+ local_var_path = '/client-side-protection/v1/pages/{page_id}'.sub('{' + 'page_id' + '}', CGI.escape(page_id.to_s))
1198
+
1199
+ # query parameters
1200
+ query_params = opts[:query_params] || {}
1201
+
1202
+ # header parameters
1203
+ header_params = opts[:header_params] || {}
1204
+ # HTTP header 'Accept' (if needed)
1205
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
1206
+ # HTTP header 'Content-Type'
1207
+ content_type = @api_client.select_header_content_type(['application/json'])
1208
+ if !content_type.nil?
1209
+ header_params['Content-Type'] = content_type
1210
+ end
1211
+
1212
+ # form parameters
1213
+ form_params = opts[:form_params] || {}
1214
+
1215
+ # http body (model)
1216
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'page_update'])
1217
+
1218
+ # return_type
1219
+ return_type = opts[:debug_return_type] || 'Page'
1220
+
1221
+ # auth_names
1222
+ auth_names = opts[:debug_auth_names] || ['token']
1223
+
1224
+ new_options = opts.merge(
1225
+ :operation => :"ClientSideProtectionApi.csp_update_page",
1226
+ :header_params => header_params,
1227
+ :query_params => query_params,
1228
+ :form_params => form_params,
1229
+ :body => post_body,
1230
+ :auth_names => auth_names,
1231
+ :return_type => return_type
1232
+ )
1233
+
1234
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1235
+ if @api_client.config.debugging
1236
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1237
+ end
1238
+ return data, status_code, headers
1239
+ end
1240
+
1241
+ # Update policy
1242
+ # Update a policy's configuration.
1243
+ # @option opts [String] :page_id Page identifier (required)
1244
+ # @option opts [String] :policy_id Policy identifier (required)
1245
+ # @option opts [PolicyUpdate] :policy_update
1246
+ # @return [Policy]
1247
+ def csp_update_policy(opts = {})
1248
+ data, _status_code, _headers = csp_update_policy_with_http_info(opts)
1249
+ data
1250
+ end
1251
+
1252
+ # Update policy
1253
+ # Update a policy&#39;s configuration.
1254
+ # @option opts [String] :page_id Page identifier (required)
1255
+ # @option opts [String] :policy_id Policy identifier (required)
1256
+ # @option opts [PolicyUpdate] :policy_update
1257
+ # @return [Array<(Policy, Integer, Hash)>] Policy data, response status code and response headers
1258
+ def csp_update_policy_with_http_info(opts = {})
1259
+ if @api_client.config.debugging
1260
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_policy ...'
1261
+ end
1262
+ # unbox the parameters from the hash
1263
+ page_id = opts[:'page_id']
1264
+ policy_id = opts[:'policy_id']
1265
+ # verify the required parameter 'page_id' is set
1266
+ if @api_client.config.client_side_validation && page_id.nil?
1267
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_update_policy"
1268
+ end
1269
+ # verify the required parameter 'policy_id' is set
1270
+ if @api_client.config.client_side_validation && policy_id.nil?
1271
+ fail ArgumentError, "Missing the required parameter 'policy_id' when calling ClientSideProtectionApi.csp_update_policy"
1272
+ end
1273
+ # resource path
1274
+ 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))
1275
+
1276
+ # query parameters
1277
+ query_params = opts[:query_params] || {}
1278
+
1279
+ # header parameters
1280
+ header_params = opts[:header_params] || {}
1281
+ # HTTP header 'Accept' (if needed)
1282
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
1283
+ # HTTP header 'Content-Type'
1284
+ content_type = @api_client.select_header_content_type(['application/json'])
1285
+ if !content_type.nil?
1286
+ header_params['Content-Type'] = content_type
1287
+ end
1288
+
1289
+ # form parameters
1290
+ form_params = opts[:form_params] || {}
1291
+
1292
+ # http body (model)
1293
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'policy_update'])
1294
+
1295
+ # return_type
1296
+ return_type = opts[:debug_return_type] || 'Policy'
1297
+
1298
+ # auth_names
1299
+ auth_names = opts[:debug_auth_names] || ['token']
1300
+
1301
+ new_options = opts.merge(
1302
+ :operation => :"ClientSideProtectionApi.csp_update_policy",
1303
+ :header_params => header_params,
1304
+ :query_params => query_params,
1305
+ :form_params => form_params,
1306
+ :body => post_body,
1307
+ :auth_names => auth_names,
1308
+ :return_type => return_type
1309
+ )
1310
+
1311
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1312
+ if @api_client.config.debugging
1313
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1314
+ end
1315
+ return data, status_code, headers
1316
+ end
1317
+
1318
+ # Update script
1319
+ # Update a script's authorization status or justification.
1320
+ # @option opts [String] :page_id Page identifier (required)
1321
+ # @option opts [String] :script_id Script identifier (required)
1322
+ # @option opts [ScriptUpdate] :script_update
1323
+ # @return [Script]
1324
+ def csp_update_script(opts = {})
1325
+ data, _status_code, _headers = csp_update_script_with_http_info(opts)
1326
+ data
1327
+ end
1328
+
1329
+ # Update script
1330
+ # Update a script&#39;s authorization status or justification.
1331
+ # @option opts [String] :page_id Page identifier (required)
1332
+ # @option opts [String] :script_id Script identifier (required)
1333
+ # @option opts [ScriptUpdate] :script_update
1334
+ # @return [Array<(Script, Integer, Hash)>] Script data, response status code and response headers
1335
+ def csp_update_script_with_http_info(opts = {})
1336
+ if @api_client.config.debugging
1337
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_script ...'
1338
+ end
1339
+ # unbox the parameters from the hash
1340
+ page_id = opts[:'page_id']
1341
+ script_id = opts[:'script_id']
1342
+ # verify the required parameter 'page_id' is set
1343
+ if @api_client.config.client_side_validation && page_id.nil?
1344
+ fail ArgumentError, "Missing the required parameter 'page_id' when calling ClientSideProtectionApi.csp_update_script"
1345
+ end
1346
+ # verify the required parameter 'script_id' is set
1347
+ if @api_client.config.client_side_validation && script_id.nil?
1348
+ fail ArgumentError, "Missing the required parameter 'script_id' when calling ClientSideProtectionApi.csp_update_script"
1349
+ end
1350
+ # resource path
1351
+ 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))
1352
+
1353
+ # query parameters
1354
+ query_params = opts[:query_params] || {}
1355
+
1356
+ # header parameters
1357
+ header_params = opts[:header_params] || {}
1358
+ # HTTP header 'Accept' (if needed)
1359
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
1360
+ # HTTP header 'Content-Type'
1361
+ content_type = @api_client.select_header_content_type(['application/json'])
1362
+ if !content_type.nil?
1363
+ header_params['Content-Type'] = content_type
1364
+ end
1365
+
1366
+ # form parameters
1367
+ form_params = opts[:form_params] || {}
1368
+
1369
+ # http body (model)
1370
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'script_update'])
1371
+
1372
+ # return_type
1373
+ return_type = opts[:debug_return_type] || 'Script'
1374
+
1375
+ # auth_names
1376
+ auth_names = opts[:debug_auth_names] || ['token']
1377
+
1378
+ new_options = opts.merge(
1379
+ :operation => :"ClientSideProtectionApi.csp_update_script",
1380
+ :header_params => header_params,
1381
+ :query_params => query_params,
1382
+ :form_params => form_params,
1383
+ :body => post_body,
1384
+ :auth_names => auth_names,
1385
+ :return_type => return_type
1386
+ )
1387
+
1388
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1389
+ if @api_client.config.debugging
1390
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_script\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1391
+ end
1392
+ return data, status_code, headers
1393
+ end
1394
+
1395
+ # Update website
1396
+ # Update a website's configuration.
1397
+ # @option opts [String] :website_id Website identifier (required)
1398
+ # @option opts [WebsiteUpdate] :website_update
1399
+ # @return [Website]
1400
+ def csp_update_website(opts = {})
1401
+ data, _status_code, _headers = csp_update_website_with_http_info(opts)
1402
+ data
1403
+ end
1404
+
1405
+ # Update website
1406
+ # Update a website&#39;s configuration.
1407
+ # @option opts [String] :website_id Website identifier (required)
1408
+ # @option opts [WebsiteUpdate] :website_update
1409
+ # @return [Array<(Website, Integer, Hash)>] Website data, response status code and response headers
1410
+ def csp_update_website_with_http_info(opts = {})
1411
+ if @api_client.config.debugging
1412
+ @api_client.config.logger.debug 'Calling API: ClientSideProtectionApi.csp_update_website ...'
1413
+ end
1414
+ # unbox the parameters from the hash
1415
+ website_id = opts[:'website_id']
1416
+ # verify the required parameter 'website_id' is set
1417
+ if @api_client.config.client_side_validation && website_id.nil?
1418
+ fail ArgumentError, "Missing the required parameter 'website_id' when calling ClientSideProtectionApi.csp_update_website"
1419
+ end
1420
+ # resource path
1421
+ local_var_path = '/client-side-protection/v1/websites/{website_id}'.sub('{' + 'website_id' + '}', CGI.escape(website_id.to_s))
1422
+
1423
+ # query parameters
1424
+ query_params = opts[:query_params] || {}
1425
+
1426
+ # header parameters
1427
+ header_params = opts[:header_params] || {}
1428
+ # HTTP header 'Accept' (if needed)
1429
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
1430
+ # HTTP header 'Content-Type'
1431
+ content_type = @api_client.select_header_content_type(['application/json'])
1432
+ if !content_type.nil?
1433
+ header_params['Content-Type'] = content_type
1434
+ end
1435
+
1436
+ # form parameters
1437
+ form_params = opts[:form_params] || {}
1438
+
1439
+ # http body (model)
1440
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'website_update'])
1441
+
1442
+ # return_type
1443
+ return_type = opts[:debug_return_type] || 'Website'
1444
+
1445
+ # auth_names
1446
+ auth_names = opts[:debug_auth_names] || ['token']
1447
+
1448
+ new_options = opts.merge(
1449
+ :operation => :"ClientSideProtectionApi.csp_update_website",
1450
+ :header_params => header_params,
1451
+ :query_params => query_params,
1452
+ :form_params => form_params,
1453
+ :body => post_body,
1454
+ :auth_names => auth_names,
1455
+ :return_type => return_type
1456
+ )
1457
+
1458
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1459
+ if @api_client.config.debugging
1460
+ @api_client.config.logger.debug "API called: ClientSideProtectionApi#csp_update_website\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1461
+ end
1462
+ return data, status_code, headers
1463
+ end
1464
+ end
1465
+ end