fastly 13.0.0 → 14.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -0
- data/Gemfile.lock +4 -4
- data/README.md +21 -6
- data/docs/AttackReport.md +19 -0
- data/docs/AttackSignal.md +12 -0
- data/docs/AttackSource.md +13 -0
- data/docs/Backend.md +6 -6
- data/docs/BackendApi.md +18 -18
- data/docs/BackendResponse.md +6 -6
- data/docs/DdosProtectionApi.md +40 -0
- data/docs/DdosProtectionAttributeStats.md +1 -1
- data/docs/DdosProtectionInvalidRequest.md +13 -0
- data/docs/DdosProtectionNotAuthorized.md +11 -0
- data/docs/DdosProtectionRule.md +1 -1
- data/docs/DdosProtectionRuleAllOf.md +1 -1
- data/docs/DdosProtectionRulePatch.md +10 -0
- data/docs/HistoricalApi.md +2 -0
- data/docs/Invitation.md +1 -1
- data/docs/InvitationCreateData.md +12 -0
- data/docs/InvitationCreateDataAllOf.md +10 -0
- data/docs/{InvitationResponse.md → InvitationCreateResponse.md} +1 -1
- data/docs/{InvitationResponseAllOf.md → InvitationCreateResponseAllOf.md} +1 -1
- data/docs/InvitationData.md +0 -1
- data/docs/InvitationResponseData.md +1 -1
- data/docs/InvitationsApi.md +2 -2
- data/docs/KvStoreApi.md +2 -0
- data/docs/ListAttackReport.md +11 -0
- data/docs/{DdosProtectionTrafficAttribute.md → ListAttackReportMeta.md} +2 -1
- data/docs/{DdosProtectionAction.md → ListSignalReport.md} +2 -1
- data/docs/LogExplorerApi.md +1 -1
- data/docs/LoggingAzureblobApi.md +8 -4
- data/docs/LoggingAzureblobResponse.md +2 -1
- data/docs/LoggingBigqueryAdditional.md +1 -1
- data/docs/LoggingBigqueryApi.md +8 -4
- data/docs/LoggingBigqueryResponse.md +2 -1
- data/docs/LoggingCloudfilesApi.md +8 -4
- data/docs/LoggingCloudfilesResponse.md +2 -1
- data/docs/LoggingCommon.md +2 -1
- data/docs/LoggingCommonResponse.md +2 -1
- data/docs/LoggingCommonResponseAllOf.md +2 -1
- data/docs/LoggingDatadogAdditional.md +1 -1
- data/docs/LoggingDatadogApi.md +8 -4
- data/docs/LoggingDatadogResponse.md +2 -1
- data/docs/LoggingDigitaloceanApi.md +8 -4
- data/docs/LoggingDigitaloceanResponse.md +2 -1
- data/docs/LoggingElasticsearchAdditional.md +1 -1
- data/docs/LoggingElasticsearchApi.md +8 -4
- data/docs/LoggingElasticsearchResponse.md +2 -1
- data/docs/LoggingFtpApi.md +8 -4
- data/docs/LoggingFtpResponse.md +2 -1
- data/docs/LoggingGcsApi.md +8 -4
- data/docs/LoggingGcsResponse.md +2 -1
- data/docs/LoggingGooglePubsubAdditional.md +1 -1
- data/docs/LoggingGooglePubsubResponse.md +2 -1
- data/docs/LoggingGrafanacloudlogsAdditional.md +1 -1
- data/docs/LoggingGrafanacloudlogsApi.md +8 -4
- data/docs/LoggingGrafanacloudlogsResponse.md +2 -1
- data/docs/LoggingHerokuApi.md +8 -4
- data/docs/LoggingHerokuResponse.md +2 -1
- data/docs/LoggingHoneycombAdditional.md +1 -1
- data/docs/LoggingHoneycombApi.md +8 -4
- data/docs/LoggingHoneycombResponse.md +2 -1
- data/docs/LoggingHttpsAdditional.md +1 -1
- data/docs/LoggingHttpsApi.md +8 -4
- data/docs/LoggingHttpsResponse.md +2 -1
- data/docs/LoggingKafkaApi.md +4 -2
- data/docs/LoggingKafkaResponse.md +2 -1
- data/docs/LoggingKafkaResponsePost.md +2 -1
- data/docs/LoggingKinesisAdditional.md +1 -1
- data/docs/LoggingKinesisApi.md +2 -2
- data/docs/LoggingKinesisResponse.md +1 -1
- data/docs/LoggingLogentriesApi.md +8 -4
- data/docs/LoggingLogentriesResponse.md +2 -1
- data/docs/LoggingLogglyApi.md +8 -4
- data/docs/LoggingLogglyResponse.md +2 -1
- data/docs/LoggingLogshuttleApi.md +8 -4
- data/docs/LoggingLogshuttleResponse.md +2 -1
- data/docs/LoggingNewrelicAdditional.md +1 -1
- data/docs/LoggingNewrelicApi.md +8 -4
- data/docs/LoggingNewrelicResponse.md +2 -1
- data/docs/LoggingNewrelicotlpAdditional.md +1 -1
- data/docs/LoggingNewrelicotlpApi.md +8 -4
- data/docs/LoggingNewrelicotlpResponse.md +2 -1
- data/docs/LoggingOpenstackApi.md +8 -4
- data/docs/LoggingOpenstackResponse.md +2 -1
- data/docs/LoggingPapertrailApi.md +8 -4
- data/docs/LoggingPapertrailResponse.md +2 -1
- data/docs/LoggingPubsubApi.md +8 -4
- data/docs/LoggingS3Api.md +8 -4
- data/docs/LoggingS3Response.md +2 -1
- data/docs/LoggingScalyrApi.md +8 -4
- data/docs/LoggingScalyrResponse.md +2 -1
- data/docs/LoggingSftpApi.md +8 -4
- data/docs/LoggingSftpResponse.md +2 -1
- data/docs/LoggingSplunkApi.md +8 -4
- data/docs/LoggingSplunkResponse.md +2 -1
- data/docs/LoggingSumologicApi.md +8 -4
- data/docs/LoggingSumologicResponse.md +2 -1
- data/docs/LoggingSyslogApi.md +8 -4
- data/docs/LoggingSyslogResponse.md +2 -1
- data/docs/NgwafReportsApi.md +99 -0
- data/docs/ObservabilityTimeseriesApi.md +67 -0
- data/docs/PoolAdditional.md +1 -1
- data/docs/PoolApi.md +8 -8
- data/docs/PoolResponse.md +2 -2
- data/docs/PoolResponseCommon.md +1 -1
- data/docs/PoolResponsePost.md +2 -2
- data/docs/PurgeApi.md +1 -1
- data/docs/SignalReport.md +13 -0
- data/docs/TimeseriesGetResponse.md +11 -0
- data/docs/TimeseriesMeta.md +13 -0
- data/docs/TimeseriesResult.md +11 -0
- data/docs/TlsCertificateDataAttributes.md +1 -0
- data/docs/TlsCsrData.md +0 -1
- data/docs/TlsCsrDataAttributes.md +1 -0
- data/docs/TlsSubscriptionsApi.md +0 -2
- data/docs/TopWorkspace.md +12 -0
- data/lib/fastly/api/backend_api.rb +24 -24
- data/lib/fastly/api/ddos_protection_api.rb +70 -0
- data/lib/fastly/api/historical_api.rb +3 -0
- data/lib/fastly/api/invitations_api.rb +3 -3
- data/lib/fastly/api/kv_store_api.rb +3 -0
- data/lib/fastly/api/logging_azureblob_api.rb +18 -4
- data/lib/fastly/api/logging_bigquery_api.rb +18 -4
- data/lib/fastly/api/logging_cloudfiles_api.rb +18 -4
- data/lib/fastly/api/logging_datadog_api.rb +18 -4
- data/lib/fastly/api/logging_digitalocean_api.rb +18 -4
- data/lib/fastly/api/logging_elasticsearch_api.rb +18 -4
- data/lib/fastly/api/logging_ftp_api.rb +18 -4
- data/lib/fastly/api/logging_gcs_api.rb +18 -4
- data/lib/fastly/api/logging_grafanacloudlogs_api.rb +18 -4
- data/lib/fastly/api/logging_heroku_api.rb +18 -4
- data/lib/fastly/api/logging_honeycomb_api.rb +18 -4
- data/lib/fastly/api/logging_https_api.rb +18 -4
- data/lib/fastly/api/logging_kafka_api.rb +9 -2
- data/lib/fastly/api/logging_kinesis_api.rb +2 -2
- data/lib/fastly/api/logging_logentries_api.rb +18 -4
- data/lib/fastly/api/logging_loggly_api.rb +18 -4
- data/lib/fastly/api/logging_logshuttle_api.rb +18 -4
- data/lib/fastly/api/logging_newrelic_api.rb +18 -4
- data/lib/fastly/api/logging_newrelicotlp_api.rb +18 -4
- data/lib/fastly/api/logging_openstack_api.rb +18 -4
- data/lib/fastly/api/logging_papertrail_api.rb +18 -4
- data/lib/fastly/api/logging_pubsub_api.rb +18 -4
- data/lib/fastly/api/logging_s3_api.rb +18 -4
- data/lib/fastly/api/logging_scalyr_api.rb +18 -4
- data/lib/fastly/api/logging_sftp_api.rb +18 -4
- data/lib/fastly/api/logging_splunk_api.rb +18 -4
- data/lib/fastly/api/logging_sumologic_api.rb +18 -4
- data/lib/fastly/api/logging_syslog_api.rb +18 -4
- data/lib/fastly/api/ngwaf_reports_api.rb +161 -0
- data/lib/fastly/api/{observability_timeseries_for_logs_api.rb → observability_timeseries_api.rb} +38 -43
- data/lib/fastly/api/pool_api.rb +8 -8
- data/lib/fastly/api/purge_api.rb +2 -2
- data/lib/fastly/api/tls_subscriptions_api.rb +0 -3
- data/lib/fastly/configuration.rb +19 -1
- data/lib/fastly/models/attack_report.rb +359 -0
- data/lib/fastly/models/attack_signal.rb +252 -0
- data/lib/fastly/models/attack_source.rb +267 -0
- data/lib/fastly/models/backend.rb +9 -4
- data/lib/fastly/models/backend_response.rb +9 -4
- data/lib/fastly/models/ddos_protection_attribute_stats.rb +2 -1
- data/lib/fastly/models/ddos_protection_invalid_request.rb +309 -0
- data/lib/fastly/models/{log_timeseries_filter_field_item.rb → ddos_protection_not_authorized.rb} +24 -36
- data/lib/fastly/models/ddos_protection_rule.rb +2 -1
- data/lib/fastly/models/ddos_protection_rule_all_of.rb +2 -1
- data/lib/fastly/models/{log_timeseries_get_response_meta_filters.rb → ddos_protection_rule_patch.rb} +13 -14
- data/lib/fastly/models/invitation.rb +1 -1
- data/lib/fastly/models/invitation_create_data.rb +244 -0
- data/lib/fastly/models/invitation_create_data_all_of.rb +216 -0
- data/lib/fastly/models/{invitation_response.rb → invitation_create_response.rb} +4 -4
- data/lib/fastly/models/{invitation_response_all_of.rb → invitation_create_response_all_of.rb} +3 -3
- data/lib/fastly/models/invitation_data.rb +4 -13
- data/lib/fastly/models/invitation_response_data.rb +13 -13
- data/lib/fastly/models/{log_timeseries_get_response.rb → list_attack_report.rb} +5 -5
- data/lib/fastly/models/list_attack_report_meta.rb +218 -0
- data/lib/fastly/models/{log_timeseries_result_dimensions.rb → list_signal_report.rb} +12 -10
- data/lib/fastly/models/logging_azureblob_response.rb +26 -2
- data/lib/fastly/models/logging_bigquery_additional.rb +1 -1
- data/lib/fastly/models/logging_bigquery_response.rb +26 -2
- data/lib/fastly/models/logging_cloudfiles_response.rb +26 -2
- data/lib/fastly/models/logging_common.rb +29 -5
- data/lib/fastly/models/logging_common_response.rb +26 -2
- data/lib/fastly/models/logging_common_response_all_of.rb +29 -5
- data/lib/fastly/models/logging_datadog_additional.rb +1 -1
- data/lib/fastly/models/logging_datadog_response.rb +26 -2
- data/lib/fastly/models/logging_digitalocean_response.rb +26 -2
- data/lib/fastly/models/logging_elasticsearch_additional.rb +1 -1
- data/lib/fastly/models/logging_elasticsearch_response.rb +26 -2
- data/lib/fastly/models/logging_ftp_response.rb +26 -2
- data/lib/fastly/models/logging_gcs_response.rb +26 -2
- data/lib/fastly/models/logging_google_pubsub_additional.rb +1 -1
- data/lib/fastly/models/logging_google_pubsub_response.rb +26 -2
- data/lib/fastly/models/logging_grafanacloudlogs_additional.rb +1 -1
- data/lib/fastly/models/logging_grafanacloudlogs_response.rb +26 -2
- data/lib/fastly/models/logging_heroku_response.rb +26 -2
- data/lib/fastly/models/logging_honeycomb_additional.rb +1 -1
- data/lib/fastly/models/logging_honeycomb_response.rb +26 -2
- data/lib/fastly/models/logging_https_additional.rb +1 -1
- data/lib/fastly/models/logging_https_response.rb +26 -2
- data/lib/fastly/models/logging_kafka_response.rb +26 -2
- data/lib/fastly/models/logging_kafka_response_post.rb +26 -2
- data/lib/fastly/models/logging_kinesis_additional.rb +1 -1
- data/lib/fastly/models/logging_kinesis_response.rb +1 -1
- data/lib/fastly/models/logging_logentries_response.rb +26 -2
- data/lib/fastly/models/logging_loggly_response.rb +26 -2
- data/lib/fastly/models/logging_logshuttle_response.rb +26 -2
- data/lib/fastly/models/logging_newrelic_additional.rb +1 -1
- data/lib/fastly/models/logging_newrelic_response.rb +26 -2
- data/lib/fastly/models/logging_newrelicotlp_additional.rb +1 -1
- data/lib/fastly/models/logging_newrelicotlp_response.rb +26 -2
- data/lib/fastly/models/logging_openstack_response.rb +26 -2
- data/lib/fastly/models/logging_papertrail_response.rb +26 -2
- data/lib/fastly/models/logging_s3_response.rb +26 -2
- data/lib/fastly/models/logging_scalyr_response.rb +26 -2
- data/lib/fastly/models/logging_sftp_response.rb +26 -2
- data/lib/fastly/models/logging_splunk_response.rb +26 -2
- data/lib/fastly/models/logging_sumologic_response.rb +26 -2
- data/lib/fastly/models/logging_syslog_response.rb +26 -2
- data/lib/fastly/models/pool_additional.rb +1 -1
- data/lib/fastly/models/pool_response.rb +2 -2
- data/lib/fastly/models/pool_response_common.rb +1 -1
- data/lib/fastly/models/pool_response_post.rb +2 -2
- data/lib/fastly/models/relationship_service_invitations.rb +1 -0
- data/lib/fastly/models/relationship_service_invitations_service_invitations.rb +1 -0
- data/lib/fastly/models/relationships_for_invitation.rb +1 -0
- data/lib/fastly/models/signal_report.rb +249 -0
- data/lib/fastly/models/timeseries_get_response.rb +227 -0
- data/lib/fastly/models/{log_timeseries_get_response_meta.rb → timeseries_meta.rb} +23 -32
- data/lib/fastly/models/{log_timeseries_result.rb → timeseries_result.rb} +9 -5
- data/lib/fastly/models/tls_certificate_data_attributes.rb +14 -4
- data/lib/fastly/models/tls_csr_data.rb +4 -13
- data/lib/fastly/models/tls_csr_data_attributes.rb +14 -4
- data/lib/fastly/models/top_workspace.rb +238 -0
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +20 -12
- data/sig.json +1 -1
- metadata +42 -26
- data/docs/LogTimeseriesFilterFieldItem.md +0 -12
- data/docs/LogTimeseriesGetResponse.md +0 -11
- data/docs/LogTimeseriesGetResponseMeta.md +0 -14
- data/docs/LogTimeseriesGetResponseMetaFilters.md +0 -10
- data/docs/LogTimeseriesResult.md +0 -11
- data/docs/LogTimeseriesResultDimensions.md +0 -10
- data/docs/LogTimeseriesValueField.md +0 -59
- data/docs/ObservabilityTimeseriesForLogsApi.md +0 -67
- data/lib/fastly/models/ddos_protection_action.rb +0 -37
- data/lib/fastly/models/ddos_protection_traffic_attribute.rb +0 -40
- data/lib/fastly/models/log_timeseries_value_field.rb +0 -108
@@ -1,10 +0,0 @@
|
|
1
|
-
# Fastly::LogTimeseriesResultDimensions
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **time** | **String** | | [optional] |
|
8
|
-
|
9
|
-
[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
10
|
-
|
@@ -1,59 +0,0 @@
|
|
1
|
-
# Fastly::LogTimeseriesValueField
|
2
|
-
|
3
|
-
## Class instance methods
|
4
|
-
|
5
|
-
### `fastly_one_of`
|
6
|
-
|
7
|
-
Returns the list of classes defined in oneOf.
|
8
|
-
|
9
|
-
#### Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'fastly'
|
13
|
-
|
14
|
-
Fastly::LogTimeseriesValueField.fastly_one_of
|
15
|
-
# =>
|
16
|
-
# [
|
17
|
-
# :'Array<Float>',
|
18
|
-
# :'Array<Integer>',
|
19
|
-
# :'Array<String>',
|
20
|
-
# :'Boolean',
|
21
|
-
# :'Float',
|
22
|
-
# :'Integer',
|
23
|
-
# :'String'
|
24
|
-
# ]
|
25
|
-
```
|
26
|
-
|
27
|
-
### build
|
28
|
-
|
29
|
-
Find the appropriate object from the `fastly_one_of` list and casts the data into it.
|
30
|
-
|
31
|
-
#### Example
|
32
|
-
|
33
|
-
```ruby
|
34
|
-
require 'fastly'
|
35
|
-
|
36
|
-
Fastly::LogTimeseriesValueField.build(data)
|
37
|
-
# => #<Array<Float>:0x00007fdd4aab02a0>
|
38
|
-
|
39
|
-
Fastly::LogTimeseriesValueField.build(data_that_doesnt_match)
|
40
|
-
# => nil
|
41
|
-
```
|
42
|
-
|
43
|
-
#### Parameters
|
44
|
-
|
45
|
-
| Name | Type | Description |
|
46
|
-
| ---- | ---- | ----------- |
|
47
|
-
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
48
|
-
|
49
|
-
#### Return type
|
50
|
-
|
51
|
-
- `Array<Float>`
|
52
|
-
- `Array<Integer>`
|
53
|
-
- `Array<String>`
|
54
|
-
- `Boolean`
|
55
|
-
- `Float`
|
56
|
-
- `Integer`
|
57
|
-
- `String`
|
58
|
-
- `nil` (if no type matches)
|
59
|
-
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# Fastly::ObservabilityTimeseriesForLogsApi
|
2
|
-
|
3
|
-
|
4
|
-
```ruby
|
5
|
-
require 'fastly'
|
6
|
-
api_instance = Fastly::ObservabilityTimeseriesForLogsApi.new
|
7
|
-
```
|
8
|
-
|
9
|
-
## Methods
|
10
|
-
|
11
|
-
> [!NOTE]
|
12
|
-
> All URIs are relative to `https://api.fastly.com`
|
13
|
-
|
14
|
-
Method | HTTP request | Description
|
15
|
-
------ | ------------ | -----------
|
16
|
-
[**log_timeseries_get**](ObservabilityTimeseriesForLogsApi.md#log_timeseries_get) | **GET** /observability/timeseries | Retrieve log data as time series
|
17
|
-
|
18
|
-
|
19
|
-
## `log_timeseries_get()`
|
20
|
-
|
21
|
-
```ruby
|
22
|
-
log_timeseries_get(opts): <LogTimeseriesGetResponse> # Retrieve log data as time series
|
23
|
-
```
|
24
|
-
|
25
|
-
Retrieves log data as time series.
|
26
|
-
|
27
|
-
### Examples
|
28
|
-
|
29
|
-
```ruby
|
30
|
-
api_instance = Fastly::ObservabilityTimeseriesForLogsApi.new
|
31
|
-
opts = {
|
32
|
-
source: 'source_example', # String |
|
33
|
-
service_id: 'service_id_example', # String |
|
34
|
-
start: 'start_example', # String |
|
35
|
-
_end: '_end_example', # String |
|
36
|
-
granularity: 'second', # String |
|
37
|
-
series: 'series_example', # String |
|
38
|
-
filter: 'filter_example', # String |
|
39
|
-
}
|
40
|
-
|
41
|
-
begin
|
42
|
-
# Retrieve log data as time series
|
43
|
-
result = api_instance.log_timeseries_get(opts)
|
44
|
-
p result
|
45
|
-
rescue Fastly::ApiError => e
|
46
|
-
puts "Error when calling ObservabilityTimeseriesForLogsApi->log_timeseries_get: #{e}"
|
47
|
-
end
|
48
|
-
```
|
49
|
-
|
50
|
-
### Options
|
51
|
-
|
52
|
-
| Name | Type | Description | Notes |
|
53
|
-
| ---- | ---- | ----------- | ----- |
|
54
|
-
| **source** | **String** | | |
|
55
|
-
| **service_id** | **String** | | |
|
56
|
-
| **start** | **String** | | |
|
57
|
-
| **_end** | **String** | | |
|
58
|
-
| **granularity** | **String** | | |
|
59
|
-
| **filter** | **String** | | [optional] |
|
60
|
-
| **series** | **String** | | |
|
61
|
-
|
62
|
-
### Return type
|
63
|
-
|
64
|
-
[**LogTimeseriesGetResponse**](LogTimeseriesGetResponse.md)
|
65
|
-
|
66
|
-
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
67
|
-
[[Back to README]](../../README.md)
|
@@ -1,37 +0,0 @@
|
|
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 'date'
|
12
|
-
require 'time'
|
13
|
-
|
14
|
-
module Fastly
|
15
|
-
class DdosProtectionAction
|
16
|
-
DEFAULT = "default".freeze
|
17
|
-
BLOCK = "block".freeze
|
18
|
-
LOG = "log".freeze
|
19
|
-
DISABLED = "disabled".freeze
|
20
|
-
|
21
|
-
# Builds the enum from string
|
22
|
-
# @param [String] The enum value in the form of the string
|
23
|
-
# @return [String] The enum value
|
24
|
-
def self.build_from_hash(value)
|
25
|
-
new.build_from_hash(value)
|
26
|
-
end
|
27
|
-
|
28
|
-
# Builds the enum from string
|
29
|
-
# @param [String] The enum value in the form of the string
|
30
|
-
# @return [String] The enum value
|
31
|
-
def build_from_hash(value)
|
32
|
-
constantValues = DdosProtectionAction.constants.select { |c| DdosProtectionAction::const_get(c) == value }
|
33
|
-
raise "Invalid ENUM value #{value} for class #DdosProtectionAction" if constantValues.empty?
|
34
|
-
value
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,40 +0,0 @@
|
|
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 'date'
|
12
|
-
require 'time'
|
13
|
-
|
14
|
-
module Fastly
|
15
|
-
class DdosProtectionTrafficAttribute
|
16
|
-
SOURCE_IP = "source_ip".freeze
|
17
|
-
COUNTRY_CODE = "country_code".freeze
|
18
|
-
HOST = "host".freeze
|
19
|
-
ASN = "asn".freeze
|
20
|
-
SOURCE_IP_PREFIX = "source_ip_prefix".freeze
|
21
|
-
USER_AGENT = "user_agent".freeze
|
22
|
-
METHOD_PATH = "method_path".freeze
|
23
|
-
|
24
|
-
# Builds the enum from string
|
25
|
-
# @param [String] The enum value in the form of the string
|
26
|
-
# @return [String] The enum value
|
27
|
-
def self.build_from_hash(value)
|
28
|
-
new.build_from_hash(value)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Builds the enum from string
|
32
|
-
# @param [String] The enum value in the form of the string
|
33
|
-
# @return [String] The enum value
|
34
|
-
def build_from_hash(value)
|
35
|
-
constantValues = DdosProtectionTrafficAttribute.constants.select { |c| DdosProtectionTrafficAttribute::const_get(c) == value }
|
36
|
-
raise "Invalid ENUM value #{value} for class #DdosProtectionTrafficAttribute" if constantValues.empty?
|
37
|
-
value
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,108 +0,0 @@
|
|
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 'date'
|
12
|
-
require 'time'
|
13
|
-
|
14
|
-
module Fastly
|
15
|
-
module LogTimeseriesValueField
|
16
|
-
class << self
|
17
|
-
# List of class defined in oneOf (OpenAPI v3)
|
18
|
-
def fastly_one_of
|
19
|
-
[
|
20
|
-
:'Array<Float>',
|
21
|
-
:'Array<Integer>',
|
22
|
-
:'Array<String>',
|
23
|
-
:'Boolean',
|
24
|
-
:'Float',
|
25
|
-
:'Integer',
|
26
|
-
:'String'
|
27
|
-
]
|
28
|
-
end
|
29
|
-
|
30
|
-
# Builds the object
|
31
|
-
# @param [Mixed] Data to be matched against the list of oneOf items
|
32
|
-
# @return [Object] Returns the model or the data itself
|
33
|
-
def build(data)
|
34
|
-
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
35
|
-
# Note:
|
36
|
-
# - We do not attempt to check whether exactly one item matches.
|
37
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
38
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
39
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
40
|
-
# - TODO: logging when debugging is set.
|
41
|
-
fastly_one_of.each do |klass|
|
42
|
-
begin
|
43
|
-
next if klass == :AnyType # "nullable: true"
|
44
|
-
typed_data = find_and_cast_into_type(klass, data)
|
45
|
-
return typed_data if typed_data
|
46
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
fastly_one_of.include?(:AnyType) ? data : nil
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
|
55
|
-
SchemaMismatchError = Class.new(StandardError)
|
56
|
-
|
57
|
-
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
58
|
-
def find_and_cast_into_type(klass, data)
|
59
|
-
return if data.nil?
|
60
|
-
|
61
|
-
case klass.to_s
|
62
|
-
when 'Boolean'
|
63
|
-
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
64
|
-
when 'Float'
|
65
|
-
return data if data.instance_of?(Float)
|
66
|
-
when 'Integer'
|
67
|
-
return data if data.instance_of?(Integer)
|
68
|
-
when 'Time'
|
69
|
-
return Time.parse(data)
|
70
|
-
when 'Date'
|
71
|
-
return Date.parse(data)
|
72
|
-
when 'String'
|
73
|
-
return data if data.instance_of?(String)
|
74
|
-
when 'Object' # "type: object"
|
75
|
-
return data if data.instance_of?(Hash)
|
76
|
-
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
77
|
-
if data.instance_of?(Array)
|
78
|
-
sub_type = Regexp.last_match[:sub_type]
|
79
|
-
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
80
|
-
end
|
81
|
-
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
82
|
-
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
83
|
-
sub_type = Regexp.last_match[:sub_type]
|
84
|
-
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
85
|
-
end
|
86
|
-
else # model
|
87
|
-
const = Fastly.const_get(klass)
|
88
|
-
if const
|
89
|
-
if const.respond_to?(:fastly_one_of) # nested oneOf model
|
90
|
-
model = const.build(data)
|
91
|
-
return model if model
|
92
|
-
else
|
93
|
-
# raise if data contains keys that are not known to the model
|
94
|
-
raise unless (data.keys - const.acceptable_attributes).empty?
|
95
|
-
model = const.build_from_hash(data)
|
96
|
-
return model if model && model.valid?
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
raise # if no match by now, raise
|
102
|
-
rescue
|
103
|
-
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|