fastly 5.3.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +62 -0
- data/Gemfile.lock +1 -1
- data/README.md +86 -63
- data/docs/AclEntry.md +1 -1
- data/docs/AclEntryApi.md +176 -0
- data/docs/AclEntryResponse.md +1 -1
- data/docs/ApexRedirectApi.md +56 -0
- data/docs/Batch.md +12 -0
- data/docs/BatchErrors.md +13 -0
- data/docs/BulkUpdateAclEntry.md +1 -1
- data/docs/ClientKey.md +12 -0
- data/docs/ContactApi.md +50 -0
- data/docs/Content.md +2 -2
- data/docs/ContentApi.md +52 -0
- data/docs/DirectorApi.md +42 -0
- data/docs/DomainInspector.md +12 -0
- data/docs/DomainInspectorEntry.md +11 -0
- data/docs/DomainInspectorEntryDimensions.md +12 -0
- data/docs/DomainInspectorHistoricalApi.md +72 -0
- data/docs/DomainInspectorMeasurements.md +71 -0
- data/docs/DomainInspectorRealtimeApi.md +132 -0
- data/docs/DomainInspectorRealtimeEntry.md +12 -0
- data/docs/EventAttributes.md +1 -1
- data/docs/{EventsResponseAllOf.md → EventData.md} +1 -1
- data/docs/HistoricalDomains.md +13 -0
- data/docs/HistoricalDomainsData.md +11 -0
- data/docs/HistoricalDomainsMeta.md +18 -0
- data/docs/HistoricalDomainsMetaFilters.md +12 -0
- data/docs/HistoricalDomainsResponse.md +13 -0
- data/docs/HistoricalDomainsResponseAllOf.md +10 -0
- data/docs/{HistoricalFieldResultsAttributesAllOf.md → HistoricalFieldResultsAttributesAdditional.md} +1 -1
- data/docs/HistoricalOriginsResponse.md +13 -0
- data/docs/HistoricalOriginsResponseAllOf.md +10 -0
- data/docs/IamRolesApi.md +157 -0
- data/docs/IamServiceGroupsApi.md +157 -0
- data/docs/IamUserGroupsApi.md +315 -0
- data/docs/InlineResponse2005.md +11 -0
- data/docs/InlineResponse2006.md +11 -0
- data/docs/InlineResponse2007.md +10 -0
- data/docs/InlineResponse400.md +10 -0
- data/docs/LegacyWafConfigurationSet.md +11 -0
- data/docs/LegacyWafConfigurationSetsApi.md +125 -0
- data/docs/LegacyWafFirewall.md +18 -0
- data/docs/LegacyWafFirewallApi.md +352 -0
- data/docs/LegacyWafOwasp.md +38 -0
- data/docs/LegacyWafOwaspApi.md +138 -0
- data/docs/LegacyWafRule.md +14 -0
- data/docs/LegacyWafRuleApi.md +184 -0
- data/docs/LegacyWafRuleStatus.md +12 -0
- data/docs/LegacyWafRuleStatusApi.md +202 -0
- data/docs/LegacyWafRuleset.md +11 -0
- data/docs/LegacyWafRulesetApi.md +136 -0
- data/docs/LegacyWafTag.md +10 -0
- data/docs/LegacyWafTagApi.md +58 -0
- data/docs/LegacyWafUpdateStatus.md +15 -0
- data/docs/LegacyWafUpdateStatusApi.md +102 -0
- data/docs/LoggingKafkaApi.md +42 -0
- data/docs/LoggingKinesisApi.md +42 -0
- data/docs/OriginInspector.md +12 -0
- data/docs/OriginInspectorDimensions.md +12 -0
- data/docs/OriginInspectorEntry.md +11 -0
- data/docs/OriginInspectorHistorical.md +13 -0
- data/docs/OriginInspectorHistoricalApi.md +72 -0
- data/docs/OriginInspectorHistoricalData.md +11 -0
- data/docs/OriginInspectorHistoricalMeta.md +18 -0
- data/docs/OriginInspectorHistoricalMetaFilters.md +12 -0
- data/docs/OriginInspectorMeasurements.md +161 -0
- data/docs/OriginInspectorRealtimeApi.md +132 -0
- data/docs/OriginInspectorRealtimeEntry.md +12 -0
- data/docs/OriginInspectorRealtimeEntryRecorded.md +9 -0
- data/docs/OriginInspectorSubsequentRequestTimestamp.md +9 -0
- data/docs/OriginInspectorValues.md +161 -0
- data/docs/PaginationCursorMeta.md +11 -0
- data/docs/ReadOnlyServiceId.md +9 -0
- data/docs/ReadOnlyVersion.md +9 -0
- data/docs/RealtimeEntry.md +2 -2
- data/docs/RealtimeEntryAggregated.md +227 -0
- data/docs/RealtimeEntryRecorded.md +9 -0
- data/docs/RealtimeMeasurements.md +1 -1
- data/docs/RecordedTimestamp.md +9 -0
- data/docs/RequestSettingsApi.md +40 -0
- data/docs/ResponseObjectApi.md +82 -0
- data/docs/SchemasSnippetResponse.md +1 -1
- data/docs/Secret.md +12 -0
- data/docs/SecretResponse.md +13 -0
- data/docs/SecretStore.md +10 -0
- data/docs/SecretStoreApi.md +233 -0
- data/docs/SecretStoreItemApi.md +255 -0
- data/docs/SecretStoreResponse.md +12 -0
- data/docs/ServiceAuthorizationsApi.md +76 -0
- data/docs/SigningKey.md +10 -0
- data/docs/Snippet.md +1 -1
- data/docs/SnippetApi.md +46 -4
- data/docs/SnippetResponse.md +1 -1
- data/docs/SubsequentRequestTimestamp.md +9 -0
- data/docs/SudoApi.md +52 -0
- data/docs/SudoGenericTokenError.md +10 -0
- data/docs/SudoRequest.md +12 -0
- data/docs/SudoResponse.md +10 -0
- data/docs/TokensAdditionalProps.md +9 -0
- data/docs/TokensApi.md +70 -0
- data/docs/ValidatorResult.md +1 -5
- data/docs/ValidatorResultData.md +12 -0
- data/docs/ValidatorResultDataAttributes.md +14 -0
- data/docs/{ValidatorResultMessages.md → ValidatorResultDataAttributesMessages.md} +2 -2
- data/docs/Values.md +71 -0
- data/docs/VclApi.md +8 -6
- data/docs/VclSyntaxHighlightingResponse.md +10 -0
- data/docs/WafActiveRulesApi.md +41 -0
- data/lib/fastly/api/acl_entry_api.rb +332 -0
- data/lib/fastly/api/apex_redirect_api.rb +111 -0
- data/lib/fastly/api/contact_api.rb +90 -0
- data/lib/fastly/api/content_api.rb +79 -0
- data/lib/fastly/api/director_api.rb +82 -0
- data/lib/fastly/api/domain_inspector_historical_api.rb +125 -0
- data/lib/fastly/api/domain_inspector_realtime_api.rb +223 -0
- data/lib/fastly/api/iam_roles_api.rb +271 -0
- data/lib/fastly/api/iam_service_groups_api.rb +271 -0
- data/lib/fastly/api/iam_user_groups_api.rb +547 -0
- data/lib/fastly/api/legacy_waf_configuration_sets_api.rb +209 -0
- data/lib/fastly/api/legacy_waf_firewall_api.rb +627 -0
- data/lib/fastly/api/legacy_waf_owasp_api.rb +244 -0
- data/lib/fastly/api/legacy_waf_rule_api.rb +307 -0
- data/lib/fastly/api/legacy_waf_rule_status_api.rb +366 -0
- data/lib/fastly/api/legacy_waf_ruleset_api.rb +237 -0
- data/lib/fastly/api/legacy_waf_tag_api.rb +96 -0
- data/lib/fastly/api/legacy_waf_update_status_api.rb +184 -0
- data/lib/fastly/api/logging_kafka_api.rb +82 -0
- data/lib/fastly/api/logging_kinesis_api.rb +82 -0
- data/lib/fastly/api/origin_inspector_historical_api.rb +125 -0
- data/lib/fastly/api/origin_inspector_realtime_api.rb +223 -0
- data/lib/fastly/api/request_settings_api.rb +75 -0
- data/lib/fastly/api/response_object_api.rb +157 -0
- data/lib/fastly/api/secret_store_api.rb +381 -0
- data/lib/fastly/api/secret_store_item_api.rb +437 -0
- data/lib/fastly/api/service_authorizations_api.rb +126 -0
- data/lib/fastly/api/snippet_api.rb +88 -6
- data/lib/fastly/api/sudo_api.rb +83 -0
- data/lib/fastly/api/tokens_api.rb +122 -0
- data/lib/fastly/api/vcl_api.rb +10 -10
- data/lib/fastly/api/waf_active_rules_api.rb +75 -0
- data/lib/fastly/configuration.rb +504 -0
- data/lib/fastly/models/acl_entry.rb +1 -1
- data/lib/fastly/models/acl_entry_response.rb +1 -1
- data/lib/fastly/models/batch.rb +239 -0
- data/lib/fastly/models/batch_errors.rb +247 -0
- data/lib/fastly/models/bulk_update_acl_entry.rb +1 -1
- data/lib/fastly/models/client_key.rb +239 -0
- data/lib/fastly/models/content.rb +8 -4
- data/lib/fastly/models/domain.rb +1 -0
- data/lib/fastly/models/domain_inspector.rb +238 -0
- data/lib/fastly/models/domain_inspector_entry.rb +228 -0
- data/lib/fastly/models/domain_inspector_entry_dimensions.rb +238 -0
- data/lib/fastly/models/domain_inspector_measurements.rb +828 -0
- data/lib/fastly/models/domain_inspector_realtime_entry.rb +241 -0
- data/lib/fastly/models/event_attributes.rb +4 -2
- data/lib/fastly/models/{events_response_all_of.rb → event_data.rb} +3 -3
- data/lib/fastly/models/events_response.rb +1 -1
- data/lib/fastly/models/historical_domains.rb +249 -0
- data/lib/fastly/models/historical_domains_data.rb +228 -0
- data/lib/fastly/models/historical_domains_meta.rb +297 -0
- data/lib/fastly/models/historical_domains_meta_filters.rb +235 -0
- data/lib/fastly/models/historical_domains_response.rb +257 -0
- data/lib/fastly/models/historical_domains_response_all_of.rb +219 -0
- data/lib/fastly/models/historical_field_results_attributes.rb +1 -1
- data/lib/fastly/models/{historical_field_results_attributes_all_of.rb → historical_field_results_attributes_additional.rb} +3 -3
- data/lib/fastly/models/historical_origins_response.rb +257 -0
- data/lib/fastly/models/historical_origins_response_all_of.rb +219 -0
- data/lib/fastly/models/inline_response2005.rb +227 -0
- data/lib/fastly/models/inline_response2006.rb +227 -0
- data/lib/fastly/models/inline_response2007.rb +218 -0
- data/lib/fastly/models/inline_response400.rb +250 -0
- data/lib/fastly/models/legacy_waf_configuration_set.rb +227 -0
- data/lib/fastly/models/legacy_waf_firewall.rb +297 -0
- data/lib/fastly/models/legacy_waf_owasp.rb +527 -0
- data/lib/fastly/models/legacy_waf_rule.rb +257 -0
- data/lib/fastly/models/legacy_waf_rule_status.rb +237 -0
- data/lib/fastly/models/legacy_waf_ruleset.rb +227 -0
- data/lib/fastly/models/legacy_waf_tag.rb +217 -0
- data/lib/fastly/models/legacy_waf_update_status.rb +267 -0
- data/lib/fastly/models/origin_inspector.rb +238 -0
- data/lib/fastly/models/origin_inspector_dimensions.rb +238 -0
- data/lib/fastly/models/origin_inspector_entry.rb +228 -0
- data/lib/fastly/models/origin_inspector_historical.rb +249 -0
- data/lib/fastly/models/origin_inspector_historical_data.rb +225 -0
- data/lib/fastly/models/origin_inspector_historical_meta.rb +297 -0
- data/lib/fastly/models/origin_inspector_historical_meta_filters.rb +235 -0
- data/lib/fastly/models/origin_inspector_measurements.rb +1728 -0
- data/lib/fastly/models/origin_inspector_realtime_entry.rb +241 -0
- data/lib/fastly/models/origin_inspector_realtime_entry_recorded.rb +208 -0
- data/lib/fastly/models/origin_inspector_subsequent_request_timestamp.rb +208 -0
- data/lib/fastly/models/origin_inspector_values.rb +1728 -0
- data/lib/fastly/models/pagination_cursor_meta.rb +227 -0
- data/lib/fastly/models/read_only_service_id.rb +207 -0
- data/lib/fastly/models/read_only_version.rb +207 -0
- data/lib/fastly/models/realtime_entry.rb +2 -7
- data/lib/fastly/models/realtime_entry_aggregated.rb +2397 -0
- data/lib/fastly/models/realtime_entry_recorded.rb +208 -0
- data/lib/fastly/models/realtime_measurements.rb +4 -2
- data/lib/fastly/models/recorded_timestamp.rb +208 -0
- data/lib/fastly/models/schemas_snippet_response.rb +3 -3
- data/lib/fastly/models/secret.rb +238 -0
- data/lib/fastly/models/secret_response.rb +249 -0
- data/lib/fastly/models/secret_store.rb +217 -0
- data/lib/fastly/models/secret_store_response.rb +238 -0
- data/lib/fastly/models/signing_key.rb +218 -0
- data/lib/fastly/models/snippet.rb +3 -3
- data/lib/fastly/models/snippet_response.rb +3 -3
- data/lib/fastly/models/subsequent_request_timestamp.rb +208 -0
- data/lib/fastly/models/sudo_generic_token_error.rb +216 -0
- data/lib/fastly/models/sudo_request.rb +244 -0
- data/lib/fastly/models/sudo_response.rb +217 -0
- data/lib/fastly/models/tokens_additional_props.rb +227 -0
- data/lib/fastly/models/validator_result.rb +7 -84
- data/lib/fastly/models/validator_result_data.rb +234 -0
- data/lib/fastly/models/validator_result_data_attributes.rb +293 -0
- data/lib/fastly/models/{validator_result_messages.rb → validator_result_data_attributes_messages.rb} +4 -4
- data/lib/fastly/models/values.rb +828 -0
- data/lib/fastly/models/vcl_syntax_highlighting_response.rb +217 -0
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +79 -3
- data/sig.json +1 -1
- metadata +160 -8
@@ -14,46 +14,12 @@ require 'time'
|
|
14
14
|
module Fastly
|
15
15
|
# Results from VCL linting
|
16
16
|
class ValidatorResult
|
17
|
-
attr_accessor :
|
18
|
-
|
19
|
-
attr_accessor :status
|
20
|
-
|
21
|
-
attr_accessor :errors
|
22
|
-
|
23
|
-
attr_accessor :warnings
|
24
|
-
|
25
|
-
attr_accessor :messages
|
26
|
-
|
27
|
-
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
29
|
-
attr_reader :allowable_values
|
30
|
-
|
31
|
-
def initialize(datatype, allowable_values)
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
33
|
-
case datatype.to_s
|
34
|
-
when /Integer/i
|
35
|
-
value.to_i
|
36
|
-
when /Float/i
|
37
|
-
value.to_f
|
38
|
-
else
|
39
|
-
value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def valid?(value)
|
45
|
-
!value || allowable_values.include?(value)
|
46
|
-
end
|
47
|
-
end
|
17
|
+
attr_accessor :data
|
48
18
|
|
49
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
20
|
def self.attribute_map
|
51
21
|
{
|
52
|
-
:'
|
53
|
-
:'status' => :'status',
|
54
|
-
:'errors' => :'errors',
|
55
|
-
:'warnings' => :'warnings',
|
56
|
-
:'messages' => :'messages'
|
22
|
+
:'data' => :'data'
|
57
23
|
}
|
58
24
|
end
|
59
25
|
|
@@ -65,18 +31,13 @@ module Fastly
|
|
65
31
|
# Attribute type mapping.
|
66
32
|
def self.fastly_types
|
67
33
|
{
|
68
|
-
:'
|
69
|
-
:'status' => :'String',
|
70
|
-
:'errors' => :'Array<String>',
|
71
|
-
:'warnings' => :'Array<String>',
|
72
|
-
:'messages' => :'Array<ValidatorResultMessages>'
|
34
|
+
:'data' => :'ValidatorResultData'
|
73
35
|
}
|
74
36
|
end
|
75
37
|
|
76
38
|
# List of attributes with nullable: true
|
77
39
|
def self.fastly_nullable
|
78
40
|
Set.new([
|
79
|
-
:'msg',
|
80
41
|
])
|
81
42
|
end
|
82
43
|
|
@@ -95,30 +56,8 @@ module Fastly
|
|
95
56
|
h[k.to_sym] = v
|
96
57
|
}
|
97
58
|
|
98
|
-
if attributes.key?(:'
|
99
|
-
self.
|
100
|
-
end
|
101
|
-
|
102
|
-
if attributes.key?(:'status')
|
103
|
-
self.status = attributes[:'status']
|
104
|
-
end
|
105
|
-
|
106
|
-
if attributes.key?(:'errors')
|
107
|
-
if (value = attributes[:'errors']).is_a?(Array)
|
108
|
-
self.errors = value
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
if attributes.key?(:'warnings')
|
113
|
-
if (value = attributes[:'warnings']).is_a?(Array)
|
114
|
-
self.warnings = value
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
if attributes.key?(:'messages')
|
119
|
-
if (value = attributes[:'messages']).is_a?(Array)
|
120
|
-
self.messages = value
|
121
|
-
end
|
59
|
+
if attributes.key?(:'data')
|
60
|
+
self.data = attributes[:'data']
|
122
61
|
end
|
123
62
|
end
|
124
63
|
|
@@ -132,31 +71,15 @@ module Fastly
|
|
132
71
|
# Check to see if the all the properties in the model are valid
|
133
72
|
# @return true if the model is valid
|
134
73
|
def valid?
|
135
|
-
status_validator = EnumAttributeValidator.new('String', ["error", "ok"])
|
136
|
-
return false unless status_validator.valid?(@status)
|
137
74
|
true
|
138
75
|
end
|
139
76
|
|
140
|
-
# Custom attribute writer method checking allowed values (enum).
|
141
|
-
# @param [Object] status Object to be assigned
|
142
|
-
def status=(status)
|
143
|
-
validator = EnumAttributeValidator.new('String', ["error", "ok"])
|
144
|
-
unless validator.valid?(status)
|
145
|
-
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
146
|
-
end
|
147
|
-
@status = status
|
148
|
-
end
|
149
|
-
|
150
77
|
# Checks equality by comparing each attribute.
|
151
78
|
# @param [Object] Object to be compared
|
152
79
|
def ==(o)
|
153
80
|
return true if self.equal?(o)
|
154
81
|
self.class == o.class &&
|
155
|
-
|
156
|
-
status == o.status &&
|
157
|
-
errors == o.errors &&
|
158
|
-
warnings == o.warnings &&
|
159
|
-
messages == o.messages
|
82
|
+
data == o.data
|
160
83
|
end
|
161
84
|
|
162
85
|
# @see the `==` method
|
@@ -168,7 +91,7 @@ module Fastly
|
|
168
91
|
# Calculates hash code according to all attributes.
|
169
92
|
# @return [Integer] Hash code
|
170
93
|
def hash
|
171
|
-
[
|
94
|
+
[data].hash
|
172
95
|
end
|
173
96
|
|
174
97
|
# Builds the object from hash
|
@@ -0,0 +1,234 @@
|
|
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 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module Fastly
|
15
|
+
class ValidatorResultData
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
attr_accessor :type
|
19
|
+
|
20
|
+
attr_accessor :attributes
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'id' => :'id',
|
26
|
+
:'type' => :'type',
|
27
|
+
:'attributes' => :'attributes'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.fastly_types
|
38
|
+
{
|
39
|
+
:'id' => :'String',
|
40
|
+
:'type' => :'String',
|
41
|
+
:'attributes' => :'ValidatorResultDataAttributes'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.fastly_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ValidatorResultData` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ValidatorResultData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'id')
|
67
|
+
self.id = attributes[:'id']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'type')
|
71
|
+
self.type = attributes[:'type']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'attributes')
|
75
|
+
self.attributes = attributes[:'attributes']
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properties with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks equality by comparing each attribute.
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def ==(o)
|
95
|
+
return true if self.equal?(o)
|
96
|
+
self.class == o.class &&
|
97
|
+
id == o.id &&
|
98
|
+
type == o.type &&
|
99
|
+
attributes == o.attributes
|
100
|
+
end
|
101
|
+
|
102
|
+
# @see the `==` method
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def eql?(o)
|
105
|
+
self == o
|
106
|
+
end
|
107
|
+
|
108
|
+
# Calculates hash code according to all attributes.
|
109
|
+
# @return [Integer] Hash code
|
110
|
+
def hash
|
111
|
+
[id, type, attributes].hash
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def self.build_from_hash(attributes)
|
118
|
+
new.build_from_hash(attributes)
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.fastly_types.each_pair do |key, type|
|
127
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
128
|
+
self.send("#{key}=", nil)
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :Time
|
150
|
+
Time.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
# models (e.g. Pet) or oneOf
|
181
|
+
klass = Fastly.const_get(type)
|
182
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
if value.nil?
|
205
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
+
end
|
208
|
+
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -0,0 +1,293 @@
|
|
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 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module Fastly
|
15
|
+
class ValidatorResultDataAttributes
|
16
|
+
attr_accessor :msg
|
17
|
+
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
attr_accessor :errors
|
21
|
+
|
22
|
+
attr_accessor :warnings
|
23
|
+
|
24
|
+
attr_accessor :messages
|
25
|
+
|
26
|
+
class EnumAttributeValidator
|
27
|
+
attr_reader :datatype
|
28
|
+
attr_reader :allowable_values
|
29
|
+
|
30
|
+
def initialize(datatype, allowable_values)
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
32
|
+
case datatype.to_s
|
33
|
+
when /Integer/i
|
34
|
+
value.to_i
|
35
|
+
when /Float/i
|
36
|
+
value.to_f
|
37
|
+
else
|
38
|
+
value
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def valid?(value)
|
44
|
+
!value || allowable_values.include?(value)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
49
|
+
def self.attribute_map
|
50
|
+
{
|
51
|
+
:'msg' => :'msg',
|
52
|
+
:'status' => :'status',
|
53
|
+
:'errors' => :'errors',
|
54
|
+
:'warnings' => :'warnings',
|
55
|
+
:'messages' => :'messages'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Returns all the JSON keys this model knows about
|
60
|
+
def self.acceptable_attributes
|
61
|
+
attribute_map.values
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute type mapping.
|
65
|
+
def self.fastly_types
|
66
|
+
{
|
67
|
+
:'msg' => :'String',
|
68
|
+
:'status' => :'String',
|
69
|
+
:'errors' => :'Array<String>',
|
70
|
+
:'warnings' => :'Array<String>',
|
71
|
+
:'messages' => :'Array<ValidatorResultDataAttributesMessages>'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.fastly_nullable
|
77
|
+
Set.new([
|
78
|
+
:'msg',
|
79
|
+
])
|
80
|
+
end
|
81
|
+
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
def initialize(attributes = {})
|
85
|
+
if (!attributes.is_a?(Hash))
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ValidatorResultDataAttributes` initialize method"
|
87
|
+
end
|
88
|
+
|
89
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ValidatorResultDataAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
|
+
end
|
94
|
+
h[k.to_sym] = v
|
95
|
+
}
|
96
|
+
|
97
|
+
if attributes.key?(:'msg')
|
98
|
+
self.msg = attributes[:'msg']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'status')
|
102
|
+
self.status = attributes[:'status']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'errors')
|
106
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
107
|
+
self.errors = value
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'warnings')
|
112
|
+
if (value = attributes[:'warnings']).is_a?(Array)
|
113
|
+
self.warnings = value
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'messages')
|
118
|
+
if (value = attributes[:'messages']).is_a?(Array)
|
119
|
+
self.messages = value
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
125
|
+
# @return Array for valid properties with the reasons
|
126
|
+
def list_invalid_properties
|
127
|
+
invalid_properties = Array.new
|
128
|
+
invalid_properties
|
129
|
+
end
|
130
|
+
|
131
|
+
# Check to see if the all the properties in the model are valid
|
132
|
+
# @return true if the model is valid
|
133
|
+
def valid?
|
134
|
+
status_validator = EnumAttributeValidator.new('String', ["error", "ok"])
|
135
|
+
return false unless status_validator.valid?(@status)
|
136
|
+
true
|
137
|
+
end
|
138
|
+
|
139
|
+
# Custom attribute writer method checking allowed values (enum).
|
140
|
+
# @param [Object] status Object to be assigned
|
141
|
+
def status=(status)
|
142
|
+
validator = EnumAttributeValidator.new('String', ["error", "ok"])
|
143
|
+
unless validator.valid?(status)
|
144
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
145
|
+
end
|
146
|
+
@status = status
|
147
|
+
end
|
148
|
+
|
149
|
+
# Checks equality by comparing each attribute.
|
150
|
+
# @param [Object] Object to be compared
|
151
|
+
def ==(o)
|
152
|
+
return true if self.equal?(o)
|
153
|
+
self.class == o.class &&
|
154
|
+
msg == o.msg &&
|
155
|
+
status == o.status &&
|
156
|
+
errors == o.errors &&
|
157
|
+
warnings == o.warnings &&
|
158
|
+
messages == o.messages
|
159
|
+
end
|
160
|
+
|
161
|
+
# @see the `==` method
|
162
|
+
# @param [Object] Object to be compared
|
163
|
+
def eql?(o)
|
164
|
+
self == o
|
165
|
+
end
|
166
|
+
|
167
|
+
# Calculates hash code according to all attributes.
|
168
|
+
# @return [Integer] Hash code
|
169
|
+
def hash
|
170
|
+
[msg, status, errors, warnings, messages].hash
|
171
|
+
end
|
172
|
+
|
173
|
+
# Builds the object from hash
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
175
|
+
# @return [Object] Returns the model itself
|
176
|
+
def self.build_from_hash(attributes)
|
177
|
+
new.build_from_hash(attributes)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Builds the object from hash
|
181
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
182
|
+
# @return [Object] Returns the model itself
|
183
|
+
def build_from_hash(attributes)
|
184
|
+
return nil unless attributes.is_a?(Hash)
|
185
|
+
self.class.fastly_types.each_pair do |key, type|
|
186
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
187
|
+
self.send("#{key}=", nil)
|
188
|
+
elsif type =~ /\AArray<(.*)>/i
|
189
|
+
# check to ensure the input is an array given that the attribute
|
190
|
+
# is documented as an array but the input is not
|
191
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
192
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
193
|
+
end
|
194
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
195
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
self
|
200
|
+
end
|
201
|
+
|
202
|
+
# Deserializes the data based on type
|
203
|
+
# @param string type Data type
|
204
|
+
# @param string value Value to be deserialized
|
205
|
+
# @return [Object] Deserialized data
|
206
|
+
def _deserialize(type, value)
|
207
|
+
case type.to_sym
|
208
|
+
when :Time
|
209
|
+
Time.parse(value)
|
210
|
+
when :Date
|
211
|
+
Date.parse(value)
|
212
|
+
when :String
|
213
|
+
value.to_s
|
214
|
+
when :Integer
|
215
|
+
value.to_i
|
216
|
+
when :Float
|
217
|
+
value.to_f
|
218
|
+
when :Boolean
|
219
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
220
|
+
true
|
221
|
+
else
|
222
|
+
false
|
223
|
+
end
|
224
|
+
when :Object
|
225
|
+
# generic object (usually a Hash), return directly
|
226
|
+
value
|
227
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
228
|
+
inner_type = Regexp.last_match[:inner_type]
|
229
|
+
value.map { |v| _deserialize(inner_type, v) }
|
230
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
231
|
+
k_type = Regexp.last_match[:k_type]
|
232
|
+
v_type = Regexp.last_match[:v_type]
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each do |k, v|
|
235
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
else # model
|
239
|
+
# models (e.g. Pet) or oneOf
|
240
|
+
klass = Fastly.const_get(type)
|
241
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
# Returns the string representation of the object
|
246
|
+
# @return [String] String presentation of the object
|
247
|
+
def to_s
|
248
|
+
to_hash.to_s
|
249
|
+
end
|
250
|
+
|
251
|
+
# to_body is an alias to to_hash (backward compatibility)
|
252
|
+
# @return [Hash] Returns the object in the form of hash
|
253
|
+
def to_body
|
254
|
+
to_hash
|
255
|
+
end
|
256
|
+
|
257
|
+
# Returns the object in the form of hash
|
258
|
+
# @return [Hash] Returns the object in the form of hash
|
259
|
+
def to_hash
|
260
|
+
hash = {}
|
261
|
+
self.class.attribute_map.each_pair do |attr, param|
|
262
|
+
value = self.send(attr)
|
263
|
+
if value.nil?
|
264
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
265
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
266
|
+
end
|
267
|
+
|
268
|
+
hash[param] = _to_hash(value)
|
269
|
+
end
|
270
|
+
hash
|
271
|
+
end
|
272
|
+
|
273
|
+
# Outputs non-array value in the form of hash
|
274
|
+
# For object, use to_hash. Otherwise, just return the value
|
275
|
+
# @param [Object] value Any valid value
|
276
|
+
# @return [Hash] Returns the value in the form of hash
|
277
|
+
def _to_hash(value)
|
278
|
+
if value.is_a?(Array)
|
279
|
+
value.compact.map { |v| _to_hash(v) }
|
280
|
+
elsif value.is_a?(Hash)
|
281
|
+
{}.tap do |hash|
|
282
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
283
|
+
end
|
284
|
+
elsif value.respond_to? :to_hash
|
285
|
+
value.to_hash
|
286
|
+
else
|
287
|
+
value
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
data/lib/fastly/models/{validator_result_messages.rb → validator_result_data_attributes_messages.rb}
RENAMED
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
class
|
15
|
+
class ValidatorResultDataAttributesMessages
|
16
16
|
attr_accessor :type
|
17
17
|
|
18
18
|
attr_accessor :warning
|
@@ -42,7 +42,7 @@ module Fastly
|
|
42
42
|
:'type' => :'String',
|
43
43
|
:'warning' => :'Boolean',
|
44
44
|
:'message' => :'String',
|
45
|
-
:'tokens' => :'Array<Hash<String,
|
45
|
+
:'tokens' => :'Array<Hash<String, TokensAdditionalProps>>'
|
46
46
|
}
|
47
47
|
end
|
48
48
|
|
@@ -56,13 +56,13 @@ module Fastly
|
|
56
56
|
# @param [Hash] attributes Model attributes in the form of hash
|
57
57
|
def initialize(attributes = {})
|
58
58
|
if (!attributes.is_a?(Hash))
|
59
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ValidatorResultDataAttributesMessages` initialize method"
|
60
60
|
end
|
61
61
|
|
62
62
|
# check to see if the attribute exists and convert string to symbol for hash key
|
63
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
64
64
|
if (!self.class.attribute_map.key?(k.to_sym))
|
65
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ValidatorResultDataAttributesMessages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
66
|
end
|
67
67
|
h[k.to_sym] = v
|
68
68
|
}
|