fastly 5.3.1 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +85 -63
  5. data/docs/AclEntry.md +1 -1
  6. data/docs/AclEntryApi.md +176 -0
  7. data/docs/AclEntryResponse.md +1 -1
  8. data/docs/ApexRedirectApi.md +56 -0
  9. data/docs/BulkUpdateAclEntry.md +1 -1
  10. data/docs/ClientKey.md +12 -0
  11. data/docs/ContactApi.md +50 -0
  12. data/docs/Content.md +2 -2
  13. data/docs/ContentApi.md +52 -0
  14. data/docs/DirectorApi.md +42 -0
  15. data/docs/DomainInspector.md +12 -0
  16. data/docs/DomainInspectorEntry.md +11 -0
  17. data/docs/DomainInspectorEntryDimensions.md +12 -0
  18. data/docs/DomainInspectorHistoricalApi.md +72 -0
  19. data/docs/DomainInspectorMeasurements.md +71 -0
  20. data/docs/DomainInspectorRealtimeApi.md +132 -0
  21. data/docs/DomainInspectorRealtimeEntry.md +12 -0
  22. data/docs/EventAttributes.md +1 -1
  23. data/docs/{EventsResponseAllOf.md → EventData.md} +1 -1
  24. data/docs/HistoricalDomains.md +13 -0
  25. data/docs/HistoricalDomainsData.md +11 -0
  26. data/docs/HistoricalDomainsMeta.md +18 -0
  27. data/docs/HistoricalDomainsMetaFilters.md +12 -0
  28. data/docs/HistoricalDomainsResponse.md +13 -0
  29. data/docs/HistoricalDomainsResponseAllOf.md +10 -0
  30. data/docs/{HistoricalFieldResultsAttributesAllOf.md → HistoricalFieldResultsAttributesAdditional.md} +1 -1
  31. data/docs/HistoricalOriginsResponse.md +13 -0
  32. data/docs/HistoricalOriginsResponseAllOf.md +10 -0
  33. data/docs/IamRolesApi.md +157 -0
  34. data/docs/IamServiceGroupsApi.md +157 -0
  35. data/docs/IamUserGroupsApi.md +315 -0
  36. data/docs/InlineResponse2005.md +11 -0
  37. data/docs/InlineResponse2006.md +11 -0
  38. data/docs/InlineResponse2007.md +10 -0
  39. data/docs/InlineResponse400.md +10 -0
  40. data/docs/LegacyWafConfigurationSet.md +11 -0
  41. data/docs/LegacyWafConfigurationSetsApi.md +125 -0
  42. data/docs/LegacyWafFirewall.md +18 -0
  43. data/docs/LegacyWafFirewallApi.md +352 -0
  44. data/docs/LegacyWafOwasp.md +38 -0
  45. data/docs/LegacyWafOwaspApi.md +138 -0
  46. data/docs/LegacyWafRule.md +14 -0
  47. data/docs/LegacyWafRuleApi.md +184 -0
  48. data/docs/LegacyWafRuleStatus.md +12 -0
  49. data/docs/LegacyWafRuleStatusApi.md +202 -0
  50. data/docs/LegacyWafRuleset.md +11 -0
  51. data/docs/LegacyWafRulesetApi.md +136 -0
  52. data/docs/LegacyWafTag.md +10 -0
  53. data/docs/LegacyWafTagApi.md +58 -0
  54. data/docs/LegacyWafUpdateStatus.md +15 -0
  55. data/docs/LegacyWafUpdateStatusApi.md +102 -0
  56. data/docs/LoggingKafkaApi.md +42 -0
  57. data/docs/LoggingKinesisApi.md +42 -0
  58. data/docs/OriginInspector.md +12 -0
  59. data/docs/OriginInspectorDimensions.md +12 -0
  60. data/docs/OriginInspectorEntry.md +11 -0
  61. data/docs/OriginInspectorHistorical.md +13 -0
  62. data/docs/OriginInspectorHistoricalApi.md +72 -0
  63. data/docs/OriginInspectorHistoricalData.md +11 -0
  64. data/docs/OriginInspectorHistoricalMeta.md +18 -0
  65. data/docs/OriginInspectorHistoricalMetaFilters.md +12 -0
  66. data/docs/OriginInspectorMeasurements.md +161 -0
  67. data/docs/OriginInspectorRealtimeApi.md +132 -0
  68. data/docs/OriginInspectorRealtimeEntry.md +12 -0
  69. data/docs/OriginInspectorRealtimeEntryRecorded.md +9 -0
  70. data/docs/OriginInspectorSubsequentRequestTimestamp.md +9 -0
  71. data/docs/OriginInspectorValues.md +161 -0
  72. data/docs/PaginationCursorMeta.md +11 -0
  73. data/docs/ReadOnlyServiceId.md +9 -0
  74. data/docs/ReadOnlyVersion.md +9 -0
  75. data/docs/RealtimeEntry.md +2 -2
  76. data/docs/RealtimeEntryAggregated.md +227 -0
  77. data/docs/RealtimeEntryRecorded.md +9 -0
  78. data/docs/RealtimeMeasurements.md +1 -1
  79. data/docs/RecordedTimestamp.md +9 -0
  80. data/docs/RequestSettingsApi.md +40 -0
  81. data/docs/ResponseObjectApi.md +82 -0
  82. data/docs/Secret.md +12 -0
  83. data/docs/SecretResponse.md +13 -0
  84. data/docs/SecretStore.md +10 -0
  85. data/docs/SecretStoreApi.md +233 -0
  86. data/docs/SecretStoreItemApi.md +255 -0
  87. data/docs/SecretStoreResponse.md +12 -0
  88. data/docs/ServiceAuthorizationsApi.md +76 -0
  89. data/docs/SigningKey.md +10 -0
  90. data/docs/SnippetApi.md +42 -0
  91. data/docs/SubsequentRequestTimestamp.md +9 -0
  92. data/docs/SudoApi.md +52 -0
  93. data/docs/SudoGenericTokenError.md +10 -0
  94. data/docs/SudoRequest.md +12 -0
  95. data/docs/SudoResponse.md +10 -0
  96. data/docs/TokensApi.md +70 -0
  97. data/docs/Values.md +71 -0
  98. data/docs/WafActiveRulesApi.md +41 -0
  99. data/lib/fastly/api/acl_entry_api.rb +332 -0
  100. data/lib/fastly/api/apex_redirect_api.rb +111 -0
  101. data/lib/fastly/api/contact_api.rb +90 -0
  102. data/lib/fastly/api/content_api.rb +79 -0
  103. data/lib/fastly/api/director_api.rb +82 -0
  104. data/lib/fastly/api/domain_inspector_historical_api.rb +125 -0
  105. data/lib/fastly/api/domain_inspector_realtime_api.rb +223 -0
  106. data/lib/fastly/api/iam_roles_api.rb +271 -0
  107. data/lib/fastly/api/iam_service_groups_api.rb +271 -0
  108. data/lib/fastly/api/iam_user_groups_api.rb +547 -0
  109. data/lib/fastly/api/legacy_waf_configuration_sets_api.rb +209 -0
  110. data/lib/fastly/api/legacy_waf_firewall_api.rb +627 -0
  111. data/lib/fastly/api/legacy_waf_owasp_api.rb +244 -0
  112. data/lib/fastly/api/legacy_waf_rule_api.rb +307 -0
  113. data/lib/fastly/api/legacy_waf_rule_status_api.rb +366 -0
  114. data/lib/fastly/api/legacy_waf_ruleset_api.rb +237 -0
  115. data/lib/fastly/api/legacy_waf_tag_api.rb +96 -0
  116. data/lib/fastly/api/legacy_waf_update_status_api.rb +184 -0
  117. data/lib/fastly/api/logging_kafka_api.rb +82 -0
  118. data/lib/fastly/api/logging_kinesis_api.rb +82 -0
  119. data/lib/fastly/api/origin_inspector_historical_api.rb +125 -0
  120. data/lib/fastly/api/origin_inspector_realtime_api.rb +223 -0
  121. data/lib/fastly/api/request_settings_api.rb +75 -0
  122. data/lib/fastly/api/response_object_api.rb +157 -0
  123. data/lib/fastly/api/secret_store_api.rb +381 -0
  124. data/lib/fastly/api/secret_store_item_api.rb +437 -0
  125. data/lib/fastly/api/service_authorizations_api.rb +126 -0
  126. data/lib/fastly/api/snippet_api.rb +82 -0
  127. data/lib/fastly/api/sudo_api.rb +83 -0
  128. data/lib/fastly/api/tokens_api.rb +122 -0
  129. data/lib/fastly/api/waf_active_rules_api.rb +75 -0
  130. data/lib/fastly/configuration.rb +504 -0
  131. data/lib/fastly/models/acl_entry.rb +1 -1
  132. data/lib/fastly/models/acl_entry_response.rb +1 -1
  133. data/lib/fastly/models/bulk_update_acl_entry.rb +1 -1
  134. data/lib/fastly/models/client_key.rb +239 -0
  135. data/lib/fastly/models/content.rb +8 -4
  136. data/lib/fastly/models/domain.rb +1 -0
  137. data/lib/fastly/models/domain_inspector.rb +238 -0
  138. data/lib/fastly/models/domain_inspector_entry.rb +228 -0
  139. data/lib/fastly/models/domain_inspector_entry_dimensions.rb +238 -0
  140. data/lib/fastly/models/domain_inspector_measurements.rb +828 -0
  141. data/lib/fastly/models/domain_inspector_realtime_entry.rb +241 -0
  142. data/lib/fastly/models/event_attributes.rb +4 -2
  143. data/lib/fastly/models/{events_response_all_of.rb → event_data.rb} +3 -3
  144. data/lib/fastly/models/events_response.rb +1 -1
  145. data/lib/fastly/models/historical_domains.rb +249 -0
  146. data/lib/fastly/models/historical_domains_data.rb +228 -0
  147. data/lib/fastly/models/historical_domains_meta.rb +297 -0
  148. data/lib/fastly/models/historical_domains_meta_filters.rb +235 -0
  149. data/lib/fastly/models/historical_domains_response.rb +257 -0
  150. data/lib/fastly/models/historical_domains_response_all_of.rb +219 -0
  151. data/lib/fastly/models/historical_field_results_attributes.rb +1 -1
  152. data/lib/fastly/models/{historical_field_results_attributes_all_of.rb → historical_field_results_attributes_additional.rb} +3 -3
  153. data/lib/fastly/models/historical_origins_response.rb +257 -0
  154. data/lib/fastly/models/historical_origins_response_all_of.rb +219 -0
  155. data/lib/fastly/models/inline_response2005.rb +227 -0
  156. data/lib/fastly/models/inline_response2006.rb +227 -0
  157. data/lib/fastly/models/inline_response2007.rb +218 -0
  158. data/lib/fastly/models/inline_response400.rb +250 -0
  159. data/lib/fastly/models/legacy_waf_configuration_set.rb +227 -0
  160. data/lib/fastly/models/legacy_waf_firewall.rb +297 -0
  161. data/lib/fastly/models/legacy_waf_owasp.rb +527 -0
  162. data/lib/fastly/models/legacy_waf_rule.rb +257 -0
  163. data/lib/fastly/models/legacy_waf_rule_status.rb +237 -0
  164. data/lib/fastly/models/legacy_waf_ruleset.rb +227 -0
  165. data/lib/fastly/models/legacy_waf_tag.rb +217 -0
  166. data/lib/fastly/models/legacy_waf_update_status.rb +267 -0
  167. data/lib/fastly/models/origin_inspector.rb +238 -0
  168. data/lib/fastly/models/origin_inspector_dimensions.rb +238 -0
  169. data/lib/fastly/models/origin_inspector_entry.rb +228 -0
  170. data/lib/fastly/models/origin_inspector_historical.rb +249 -0
  171. data/lib/fastly/models/origin_inspector_historical_data.rb +225 -0
  172. data/lib/fastly/models/origin_inspector_historical_meta.rb +297 -0
  173. data/lib/fastly/models/origin_inspector_historical_meta_filters.rb +235 -0
  174. data/lib/fastly/models/origin_inspector_measurements.rb +1728 -0
  175. data/lib/fastly/models/origin_inspector_realtime_entry.rb +241 -0
  176. data/lib/fastly/models/origin_inspector_realtime_entry_recorded.rb +208 -0
  177. data/lib/fastly/models/origin_inspector_subsequent_request_timestamp.rb +208 -0
  178. data/lib/fastly/models/origin_inspector_values.rb +1728 -0
  179. data/lib/fastly/models/pagination_cursor_meta.rb +227 -0
  180. data/lib/fastly/models/read_only_service_id.rb +207 -0
  181. data/lib/fastly/models/read_only_version.rb +207 -0
  182. data/lib/fastly/models/realtime_entry.rb +2 -7
  183. data/lib/fastly/models/realtime_entry_aggregated.rb +2397 -0
  184. data/lib/fastly/models/realtime_entry_recorded.rb +208 -0
  185. data/lib/fastly/models/realtime_measurements.rb +4 -2
  186. data/lib/fastly/models/recorded_timestamp.rb +208 -0
  187. data/lib/fastly/models/secret.rb +238 -0
  188. data/lib/fastly/models/secret_response.rb +249 -0
  189. data/lib/fastly/models/secret_store.rb +217 -0
  190. data/lib/fastly/models/secret_store_response.rb +238 -0
  191. data/lib/fastly/models/signing_key.rb +218 -0
  192. data/lib/fastly/models/subsequent_request_timestamp.rb +208 -0
  193. data/lib/fastly/models/sudo_generic_token_error.rb +216 -0
  194. data/lib/fastly/models/sudo_request.rb +244 -0
  195. data/lib/fastly/models/sudo_response.rb +217 -0
  196. data/lib/fastly/models/values.rb +828 -0
  197. data/lib/fastly/version.rb +1 -1
  198. data/lib/fastly.rb +72 -2
  199. data/sig.json +1 -1
  200. metadata +146 -6
@@ -0,0 +1,244 @@
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://developer.fastly.com/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 LegacyWafOwaspApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+ # Create an OWASP settings object
21
+ # Create an OWASP settings object for a particular service and firewall.
22
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
23
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
24
+ # @option opts [Hash<String, Object>] :request_body
25
+ # @return [Object]
26
+ def create_owasp_settings(opts = {})
27
+ data, _status_code, _headers = create_owasp_settings_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Create an OWASP settings object
32
+ # Create an OWASP settings object for a particular service and firewall.
33
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
34
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
35
+ # @option opts [Hash<String, Object>] :request_body
36
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
37
+ def create_owasp_settings_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: LegacyWafOwaspApi.create_owasp_settings ...'
40
+ end
41
+ # unbox the parameters from the hash
42
+ service_id = opts[:'service_id']
43
+ firewall_id = opts[:'firewall_id']
44
+ # verify the required parameter 'service_id' is set
45
+ if @api_client.config.client_side_validation && service_id.nil?
46
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafOwaspApi.create_owasp_settings"
47
+ end
48
+ # verify the required parameter 'firewall_id' is set
49
+ if @api_client.config.client_side_validation && firewall_id.nil?
50
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafOwaspApi.create_owasp_settings"
51
+ end
52
+ # resource path
53
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/owasp'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
54
+
55
+ # query parameters
56
+ query_params = opts[:query_params] || {}
57
+
58
+ # header parameters
59
+ header_params = opts[:header_params] || {}
60
+ # HTTP header 'Accept' (if needed)
61
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
62
+ # HTTP header 'Content-Type'
63
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
64
+ if !content_type.nil?
65
+ header_params['Content-Type'] = content_type
66
+ end
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type] || 'Object'
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['token']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"LegacyWafOwaspApi.create_owasp_settings",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: LegacyWafOwaspApi#create_owasp_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Get the OWASP settings object
98
+ # Get the OWASP settings object for a particular service and firewall.
99
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
100
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
101
+ # @return [Object]
102
+ def get_owasp_settings(opts = {})
103
+ data, _status_code, _headers = get_owasp_settings_with_http_info(opts)
104
+ data
105
+ end
106
+
107
+ # Get the OWASP settings object
108
+ # Get the OWASP settings object for a particular service and firewall.
109
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
110
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
111
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
112
+ def get_owasp_settings_with_http_info(opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug 'Calling API: LegacyWafOwaspApi.get_owasp_settings ...'
115
+ end
116
+ # unbox the parameters from the hash
117
+ service_id = opts[:'service_id']
118
+ firewall_id = opts[:'firewall_id']
119
+ # verify the required parameter 'service_id' is set
120
+ if @api_client.config.client_side_validation && service_id.nil?
121
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafOwaspApi.get_owasp_settings"
122
+ end
123
+ # verify the required parameter 'firewall_id' is set
124
+ if @api_client.config.client_side_validation && firewall_id.nil?
125
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafOwaspApi.get_owasp_settings"
126
+ end
127
+ # resource path
128
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/owasp'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
129
+
130
+ # query parameters
131
+ query_params = opts[:query_params] || {}
132
+
133
+ # header parameters
134
+ header_params = opts[:header_params] || {}
135
+ # HTTP header 'Accept' (if needed)
136
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
137
+
138
+ # form parameters
139
+ form_params = opts[:form_params] || {}
140
+
141
+ # http body (model)
142
+ post_body = opts[:debug_body]
143
+
144
+ # return_type
145
+ return_type = opts[:debug_return_type] || 'Object'
146
+
147
+ # auth_names
148
+ auth_names = opts[:debug_auth_names] || ['token']
149
+
150
+ new_options = opts.merge(
151
+ :operation => :"LegacyWafOwaspApi.get_owasp_settings",
152
+ :header_params => header_params,
153
+ :query_params => query_params,
154
+ :form_params => form_params,
155
+ :body => post_body,
156
+ :auth_names => auth_names,
157
+ :return_type => return_type
158
+ )
159
+
160
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
161
+ if @api_client.config.debugging
162
+ @api_client.config.logger.debug "API called: LegacyWafOwaspApi#get_owasp_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
163
+ end
164
+ return data, status_code, headers
165
+ end
166
+
167
+ # Update the OWASP settings object
168
+ # Update the OWASP settings object for a particular service and firewall.
169
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
170
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
171
+ # @option opts [Hash<String, Object>] :request_body
172
+ # @return [Object]
173
+ def update_owasp_settings(opts = {})
174
+ data, _status_code, _headers = update_owasp_settings_with_http_info(opts)
175
+ data
176
+ end
177
+
178
+ # Update the OWASP settings object
179
+ # Update the OWASP settings object for a particular service and firewall.
180
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
181
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
182
+ # @option opts [Hash<String, Object>] :request_body
183
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
184
+ def update_owasp_settings_with_http_info(opts = {})
185
+ if @api_client.config.debugging
186
+ @api_client.config.logger.debug 'Calling API: LegacyWafOwaspApi.update_owasp_settings ...'
187
+ end
188
+ # unbox the parameters from the hash
189
+ service_id = opts[:'service_id']
190
+ firewall_id = opts[:'firewall_id']
191
+ # verify the required parameter 'service_id' is set
192
+ if @api_client.config.client_side_validation && service_id.nil?
193
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafOwaspApi.update_owasp_settings"
194
+ end
195
+ # verify the required parameter 'firewall_id' is set
196
+ if @api_client.config.client_side_validation && firewall_id.nil?
197
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafOwaspApi.update_owasp_settings"
198
+ end
199
+ # resource path
200
+ local_var_path = '/service/{service_id}/wafs/{firewall_id}/owasp'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))
201
+
202
+ # query parameters
203
+ query_params = opts[:query_params] || {}
204
+
205
+ # header parameters
206
+ header_params = opts[:header_params] || {}
207
+ # HTTP header 'Accept' (if needed)
208
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
209
+ # HTTP header 'Content-Type'
210
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
211
+ if !content_type.nil?
212
+ header_params['Content-Type'] = content_type
213
+ end
214
+
215
+ # form parameters
216
+ form_params = opts[:form_params] || {}
217
+
218
+ # http body (model)
219
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])
220
+
221
+ # return_type
222
+ return_type = opts[:debug_return_type] || 'Object'
223
+
224
+ # auth_names
225
+ auth_names = opts[:debug_auth_names] || ['token']
226
+
227
+ new_options = opts.merge(
228
+ :operation => :"LegacyWafOwaspApi.update_owasp_settings",
229
+ :header_params => header_params,
230
+ :query_params => query_params,
231
+ :form_params => form_params,
232
+ :body => post_body,
233
+ :auth_names => auth_names,
234
+ :return_type => return_type
235
+ )
236
+
237
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
238
+ if @api_client.config.debugging
239
+ @api_client.config.logger.debug "API called: LegacyWafOwaspApi#update_owasp_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
240
+ end
241
+ return data, status_code, headers
242
+ end
243
+ end
244
+ end
@@ -0,0 +1,307 @@
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://developer.fastly.com/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 LegacyWafRuleApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+ # Get VCL for a rule associated with a firewall
21
+ # Get associated VCL for a specific rule associated with a specific firewall.
22
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
23
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
24
+ # @return [Object]
25
+ def get_legacy_waf_firewall_rule_vcl(opts = {})
26
+ data, _status_code, _headers = get_legacy_waf_firewall_rule_vcl_with_http_info(opts)
27
+ data
28
+ end
29
+
30
+ # Get VCL for a rule associated with a firewall
31
+ # Get associated VCL for a specific rule associated with a specific firewall.
32
+ # @option opts [String] :firewall_id Alphanumeric string identifying a Firewall. (required)
33
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
34
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
35
+ def get_legacy_waf_firewall_rule_vcl_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleApi.get_legacy_waf_firewall_rule_vcl ...'
38
+ end
39
+ # unbox the parameters from the hash
40
+ firewall_id = opts[:'firewall_id']
41
+ waf_rule_id = opts[:'waf_rule_id']
42
+ # verify the required parameter 'firewall_id' is set
43
+ if @api_client.config.client_side_validation && firewall_id.nil?
44
+ fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafRuleApi.get_legacy_waf_firewall_rule_vcl"
45
+ end
46
+ # verify the required parameter 'waf_rule_id' is set
47
+ if @api_client.config.client_side_validation && waf_rule_id.nil?
48
+ fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling LegacyWafRuleApi.get_legacy_waf_firewall_rule_vcl"
49
+ end
50
+ # resource path
51
+ local_var_path = '/wafs/{firewall_id}/rules/{waf_rule_id}/vcl'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s)).sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s))
52
+
53
+ # query parameters
54
+ query_params = opts[:query_params] || {}
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body]
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'Object'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['token']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"LegacyWafRuleApi.get_legacy_waf_firewall_rule_vcl",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: LegacyWafRuleApi#get_legacy_waf_firewall_rule_vcl\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Get a rule
91
+ # Get a specific rule.
92
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
93
+ # @option opts [String] :filter_configuration_set_id Optional. Limit rule to a specific configuration set or pass \&quot;all\&quot; to search all configuration sets, including stale ones.
94
+ # @option opts [String] :include Include relationships. Optional. Comma separated values. Permitted values: &#x60;tags&#x60;, &#x60;rule_statuses&#x60;, &#x60;source&#x60;, and &#x60;vcl&#x60;.
95
+ # @return [Object]
96
+ def get_legacy_waf_rule(opts = {})
97
+ data, _status_code, _headers = get_legacy_waf_rule_with_http_info(opts)
98
+ data
99
+ end
100
+
101
+ # Get a rule
102
+ # Get a specific rule.
103
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
104
+ # @option opts [String] :filter_configuration_set_id Optional. Limit rule to a specific configuration set or pass \&quot;all\&quot; to search all configuration sets, including stale ones.
105
+ # @option opts [String] :include Include relationships. Optional. Comma separated values. Permitted values: &#x60;tags&#x60;, &#x60;rule_statuses&#x60;, &#x60;source&#x60;, and &#x60;vcl&#x60;.
106
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
107
+ def get_legacy_waf_rule_with_http_info(opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleApi.get_legacy_waf_rule ...'
110
+ end
111
+ # unbox the parameters from the hash
112
+ waf_rule_id = opts[:'waf_rule_id']
113
+ # verify the required parameter 'waf_rule_id' is set
114
+ if @api_client.config.client_side_validation && waf_rule_id.nil?
115
+ fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling LegacyWafRuleApi.get_legacy_waf_rule"
116
+ end
117
+ # resource path
118
+ local_var_path = '/wafs/rules/{waf_rule_id}'.sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s))
119
+
120
+ # query parameters
121
+ query_params = opts[:query_params] || {}
122
+ query_params[:'filter[configuration_set_id]'] = opts[:'filter_configuration_set_id'] if !opts[:'filter_configuration_set_id'].nil?
123
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:debug_body]
135
+
136
+ # return_type
137
+ return_type = opts[:debug_return_type] || 'Object'
138
+
139
+ # auth_names
140
+ auth_names = opts[:debug_auth_names] || ['token']
141
+
142
+ new_options = opts.merge(
143
+ :operation => :"LegacyWafRuleApi.get_legacy_waf_rule",
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type
150
+ )
151
+
152
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: LegacyWafRuleApi#get_legacy_waf_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ return data, status_code, headers
157
+ end
158
+
159
+ # Get VCL for a rule
160
+ # Get associated VCL for a specific rule.
161
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
162
+ # @return [Object]
163
+ def get_legacy_waf_rule_vcl(opts = {})
164
+ data, _status_code, _headers = get_legacy_waf_rule_vcl_with_http_info(opts)
165
+ data
166
+ end
167
+
168
+ # Get VCL for a rule
169
+ # Get associated VCL for a specific rule.
170
+ # @option opts [String] :waf_rule_id Alphanumeric string identifying a WAF rule. (required)
171
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
172
+ def get_legacy_waf_rule_vcl_with_http_info(opts = {})
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleApi.get_legacy_waf_rule_vcl ...'
175
+ end
176
+ # unbox the parameters from the hash
177
+ waf_rule_id = opts[:'waf_rule_id']
178
+ # verify the required parameter 'waf_rule_id' is set
179
+ if @api_client.config.client_side_validation && waf_rule_id.nil?
180
+ fail ArgumentError, "Missing the required parameter 'waf_rule_id' when calling LegacyWafRuleApi.get_legacy_waf_rule_vcl"
181
+ end
182
+ # resource path
183
+ local_var_path = '/wafs/rules/{waf_rule_id}/vcl'.sub('{' + 'waf_rule_id' + '}', CGI.escape(waf_rule_id.to_s))
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+
188
+ # header parameters
189
+ header_params = opts[:header_params] || {}
190
+ # HTTP header 'Accept' (if needed)
191
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:debug_body]
198
+
199
+ # return_type
200
+ return_type = opts[:debug_return_type] || 'Object'
201
+
202
+ # auth_names
203
+ auth_names = opts[:debug_auth_names] || ['token']
204
+
205
+ new_options = opts.merge(
206
+ :operation => :"LegacyWafRuleApi.get_legacy_waf_rule_vcl",
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => return_type
213
+ )
214
+
215
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug "API called: LegacyWafRuleApi#get_legacy_waf_rule_vcl\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
+ end
219
+ return data, status_code, headers
220
+ end
221
+
222
+ # List rules in the latest configuration set
223
+ # List all rules in the latest configuration set.
224
+ # @option opts [String] :filter_rule_id Limit the returned rules to a specific rule ID.
225
+ # @option opts [String] :filter_severity Limit the returned rules to a specific severity.
226
+ # @option opts [String] :filter_tags_name Limit the returned rules to a set linked to a tag by name.
227
+ # @option opts [String] :filter_configuration_set_id Optional. Limit rules to specific configuration set or pass \&quot;all\&quot; to search all configuration sets, including stale ones.
228
+ # @option opts [Integer] :page_number Current page.
229
+ # @option opts [Integer] :page_size Number of records per page. (default to 20)
230
+ # @option opts [String] :include Include relationships. Optional. Comma separated values. Permitted values: &#x60;tags&#x60;, &#x60;rule_statuses&#x60;, and &#x60;source&#x60;.
231
+ # @return [Array<Object>]
232
+ def list_legacy_waf_rules(opts = {})
233
+ data, _status_code, _headers = list_legacy_waf_rules_with_http_info(opts)
234
+ data
235
+ end
236
+
237
+ # List rules in the latest configuration set
238
+ # List all rules in the latest configuration set.
239
+ # @option opts [String] :filter_rule_id Limit the returned rules to a specific rule ID.
240
+ # @option opts [String] :filter_severity Limit the returned rules to a specific severity.
241
+ # @option opts [String] :filter_tags_name Limit the returned rules to a set linked to a tag by name.
242
+ # @option opts [String] :filter_configuration_set_id Optional. Limit rules to specific configuration set or pass \&quot;all\&quot; to search all configuration sets, including stale ones.
243
+ # @option opts [Integer] :page_number Current page.
244
+ # @option opts [Integer] :page_size Number of records per page. (default to 20)
245
+ # @option opts [String] :include Include relationships. Optional. Comma separated values. Permitted values: &#x60;tags&#x60;, &#x60;rule_statuses&#x60;, and &#x60;source&#x60;.
246
+ # @return [Array<(Array<Object>, Integer, Hash)>] Array<Object> data, response status code and response headers
247
+ def list_legacy_waf_rules_with_http_info(opts = {})
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug 'Calling API: LegacyWafRuleApi.list_legacy_waf_rules ...'
250
+ end
251
+ # unbox the parameters from the hash
252
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
253
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafRuleApi.list_legacy_waf_rules, must be smaller than or equal to 100.'
254
+ end
255
+
256
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
257
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafRuleApi.list_legacy_waf_rules, must be greater than or equal to 1.'
258
+ end
259
+
260
+ # resource path
261
+ local_var_path = '/wafs/rules'
262
+
263
+ # query parameters
264
+ query_params = opts[:query_params] || {}
265
+ query_params[:'filter[rule_id]'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil?
266
+ query_params[:'filter[severity]'] = opts[:'filter_severity'] if !opts[:'filter_severity'].nil?
267
+ query_params[:'filter[tags][name]'] = opts[:'filter_tags_name'] if !opts[:'filter_tags_name'].nil?
268
+ query_params[:'filter[configuration_set_id]'] = opts[:'filter_configuration_set_id'] if !opts[:'filter_configuration_set_id'].nil?
269
+ query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
270
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
271
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
272
+
273
+ # header parameters
274
+ header_params = opts[:header_params] || {}
275
+ # HTTP header 'Accept' (if needed)
276
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
277
+
278
+ # form parameters
279
+ form_params = opts[:form_params] || {}
280
+
281
+ # http body (model)
282
+ post_body = opts[:debug_body]
283
+
284
+ # return_type
285
+ return_type = opts[:debug_return_type] || 'Array<Object>'
286
+
287
+ # auth_names
288
+ auth_names = opts[:debug_auth_names] || ['token']
289
+
290
+ new_options = opts.merge(
291
+ :operation => :"LegacyWafRuleApi.list_legacy_waf_rules",
292
+ :header_params => header_params,
293
+ :query_params => query_params,
294
+ :form_params => form_params,
295
+ :body => post_body,
296
+ :auth_names => auth_names,
297
+ :return_type => return_type
298
+ )
299
+
300
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
301
+ if @api_client.config.debugging
302
+ @api_client.config.logger.debug "API called: LegacyWafRuleApi#list_legacy_waf_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
303
+ end
304
+ return data, status_code, headers
305
+ end
306
+ end
307
+ end