fastly 5.2.1 → 5.3.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 +17 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/docs/AutomationTokenCreateResponse.md +3 -3
- data/docs/AutomationTokenCreateResponseAllOf.md +3 -3
- data/docs/AutomationTokenResponse.md +2 -2
- data/docs/AutomationTokenResponseAllOf.md +2 -2
- data/docs/AutomationTokensApi.md +4 -3
- data/docs/ErrorResponse.md +13 -0
- data/docs/{HistoricalFieldResponseAllOf.md → HistoricalFieldResponseDataField.md} +1 -1
- data/docs/HistoricalFieldResultsAttributes.md +1 -1
- data/docs/HistoricalFieldResultsAttributesAllOf.md +1 -1
- data/docs/{HistoricalResponseAllOf.md → HistoricalResponseDataField.md} +1 -1
- data/docs/HistoricalService.md +10 -0
- data/docs/HistoricalUsageMonthResponse.md +1 -1
- data/docs/HistoricalUsageMonthResponseAllOf.md +1 -1
- data/docs/{HistoricalUsageMonthResponseAllOfData.md → HistoricalUsageMonthResponseData.md} +2 -2
- data/docs/RateLimiter.md +1 -1
- data/docs/RateLimiterApi.md +122 -0
- data/docs/RateLimiterResponse.md +1 -1
- data/docs/ReadOnlyCustomerId.md +9 -0
- data/docs/ReadOnlyId.md +9 -0
- data/docs/ReadOnlyIdService.md +9 -0
- data/docs/ReadOnlyUserId.md +9 -0
- data/lib/fastly/api/automation_tokens_api.rb +5 -5
- data/lib/fastly/api/rate_limiter_api.rb +345 -0
- data/lib/fastly/configuration.rb +12 -0
- data/lib/fastly/models/automation_token_create_request_attributes.rb +0 -1
- data/lib/fastly/models/automation_token_create_response.rb +3 -6
- data/lib/fastly/models/automation_token_create_response_all_of.rb +3 -6
- data/lib/fastly/models/automation_token_response.rb +2 -4
- data/lib/fastly/models/automation_token_response_all_of.rb +2 -4
- data/lib/fastly/models/{rate_limiter_response1.rb → error_response.rb} +30 -77
- data/lib/fastly/models/historical_field_response.rb +1 -1
- data/lib/fastly/models/{historical_field_response_all_of.rb → historical_field_response_data_field.rb} +3 -3
- data/lib/fastly/models/historical_field_results_attributes.rb +1 -2
- data/lib/fastly/models/historical_field_results_attributes_all_of.rb +1 -2
- data/lib/fastly/models/historical_response.rb +1 -1
- data/lib/fastly/models/{historical_response_all_of.rb → historical_response_data_field.rb} +3 -3
- data/lib/fastly/models/historical_service.rb +217 -0
- data/lib/fastly/models/historical_usage_month_response.rb +1 -1
- data/lib/fastly/models/historical_usage_month_response_all_of.rb +1 -1
- data/lib/fastly/models/{historical_usage_month_response_all_of_data.rb → historical_usage_month_response_data.rb} +4 -4
- data/lib/fastly/models/rate_limiter.rb +5 -2
- data/lib/fastly/models/rate_limiter_response.rb +5 -2
- data/lib/fastly/models/read_only_customer_id.rb +207 -0
- data/lib/fastly/models/read_only_id.rb +207 -0
- data/lib/fastly/models/read_only_id_service.rb +207 -0
- data/lib/fastly/models/read_only_user_id.rb +207 -0
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +9 -4
- data/sig.json +1 -1
- metadata +20 -10
- data/docs/RateLimiterResponse1.md +0 -12
@@ -12,23 +12,22 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
attr_accessor :
|
15
|
+
class ErrorResponse
|
16
|
+
attr_accessor :detail
|
17
|
+
|
18
|
+
attr_accessor :errors
|
19
19
|
|
20
|
-
|
21
|
-
attr_accessor :content_type
|
20
|
+
attr_accessor :status
|
22
21
|
|
23
|
-
|
24
|
-
attr_accessor :content
|
22
|
+
attr_accessor :title
|
25
23
|
|
26
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
27
25
|
def self.attribute_map
|
28
26
|
{
|
27
|
+
:'detail' => :'detail',
|
28
|
+
:'errors' => :'errors',
|
29
29
|
:'status' => :'status',
|
30
|
-
:'
|
31
|
-
:'content' => :'content'
|
30
|
+
:'title' => :'title'
|
32
31
|
}
|
33
32
|
end
|
34
33
|
|
@@ -40,9 +39,10 @@ module Fastly
|
|
40
39
|
# Attribute type mapping.
|
41
40
|
def self.fastly_types
|
42
41
|
{
|
42
|
+
:'detail' => :'String',
|
43
|
+
:'errors' => :'Array<Object>',
|
43
44
|
:'status' => :'Integer',
|
44
|
-
:'
|
45
|
-
:'content' => :'String'
|
45
|
+
:'title' => :'String'
|
46
46
|
}
|
47
47
|
end
|
48
48
|
|
@@ -56,27 +56,33 @@ 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::ErrorResponse` 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::ErrorResponse`. 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
|
}
|
69
69
|
|
70
|
-
if attributes.key?(:'
|
71
|
-
self.
|
70
|
+
if attributes.key?(:'detail')
|
71
|
+
self.detail = attributes[:'detail']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'errors')
|
75
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
76
|
+
self.errors = value
|
77
|
+
end
|
72
78
|
end
|
73
79
|
|
74
|
-
if attributes.key?(:'
|
75
|
-
self.
|
80
|
+
if attributes.key?(:'status')
|
81
|
+
self.status = attributes[:'status']
|
76
82
|
end
|
77
83
|
|
78
|
-
if attributes.key?(:'
|
79
|
-
self.
|
84
|
+
if attributes.key?(:'title')
|
85
|
+
self.title = attributes[:'title']
|
80
86
|
end
|
81
87
|
end
|
82
88
|
|
@@ -84,77 +90,24 @@ module Fastly
|
|
84
90
|
# @return Array for valid properties with the reasons
|
85
91
|
def list_invalid_properties
|
86
92
|
invalid_properties = Array.new
|
87
|
-
if !@status.nil? && @status > 999
|
88
|
-
invalid_properties.push('invalid value for "status", must be smaller than or equal to 999.')
|
89
|
-
end
|
90
|
-
|
91
|
-
if !@status.nil? && @status < 100
|
92
|
-
invalid_properties.push('invalid value for "status", must be greater than or equal to 100.')
|
93
|
-
end
|
94
|
-
|
95
|
-
if !@content_type.nil? && @content_type.to_s.length < 1
|
96
|
-
invalid_properties.push('invalid value for "content_type", the character length must be great than or equal to 1.')
|
97
|
-
end
|
98
|
-
|
99
|
-
if !@content.nil? && @content.to_s.length < 1
|
100
|
-
invalid_properties.push('invalid value for "content", the character length must be great than or equal to 1.')
|
101
|
-
end
|
102
|
-
|
103
93
|
invalid_properties
|
104
94
|
end
|
105
95
|
|
106
96
|
# Check to see if the all the properties in the model are valid
|
107
97
|
# @return true if the model is valid
|
108
98
|
def valid?
|
109
|
-
return false if !@status.nil? && @status > 999
|
110
|
-
return false if !@status.nil? && @status < 100
|
111
|
-
return false if !@content_type.nil? && @content_type.to_s.length < 1
|
112
|
-
return false if !@content.nil? && @content.to_s.length < 1
|
113
99
|
true
|
114
100
|
end
|
115
101
|
|
116
|
-
# Custom attribute writer method with validation
|
117
|
-
# @param [Object] status Value to be assigned
|
118
|
-
def status=(status)
|
119
|
-
if !status.nil? && status > 999
|
120
|
-
fail ArgumentError, 'invalid value for "status", must be smaller than or equal to 999.'
|
121
|
-
end
|
122
|
-
|
123
|
-
if !status.nil? && status < 100
|
124
|
-
fail ArgumentError, 'invalid value for "status", must be greater than or equal to 100.'
|
125
|
-
end
|
126
|
-
|
127
|
-
@status = status
|
128
|
-
end
|
129
|
-
|
130
|
-
# Custom attribute writer method with validation
|
131
|
-
# @param [Object] content_type Value to be assigned
|
132
|
-
def content_type=(content_type)
|
133
|
-
if !content_type.nil? && content_type.to_s.length < 1
|
134
|
-
fail ArgumentError, 'invalid value for "content_type", the character length must be great than or equal to 1.'
|
135
|
-
end
|
136
|
-
|
137
|
-
@content_type = content_type
|
138
|
-
end
|
139
|
-
|
140
|
-
# Custom attribute writer method with validation
|
141
|
-
# @param [Object] content Value to be assigned
|
142
|
-
def content=(content)
|
143
|
-
if !content.nil? && content.to_s.length < 1
|
144
|
-
fail ArgumentError, 'invalid value for "content", the character length must be great than or equal to 1.'
|
145
|
-
end
|
146
|
-
|
147
|
-
@content = content
|
148
|
-
end
|
149
|
-
|
150
102
|
# Checks equality by comparing each attribute.
|
151
103
|
# @param [Object] Object to be compared
|
152
104
|
def ==(o)
|
153
105
|
return true if self.equal?(o)
|
154
106
|
self.class == o.class &&
|
107
|
+
detail == o.detail &&
|
108
|
+
errors == o.errors &&
|
155
109
|
status == o.status &&
|
156
|
-
|
157
|
-
content == o.content
|
110
|
+
title == o.title
|
158
111
|
end
|
159
112
|
|
160
113
|
# @see the `==` method
|
@@ -166,7 +119,7 @@ module Fastly
|
|
166
119
|
# Calculates hash code according to all attributes.
|
167
120
|
# @return [Integer] Hash code
|
168
121
|
def hash
|
169
|
-
[
|
122
|
+
[detail, errors, status, title].hash
|
170
123
|
end
|
171
124
|
|
172
125
|
# Builds the object from hash
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
class
|
15
|
+
class HistoricalFieldResponseDataField
|
16
16
|
attr_accessor :data
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -44,13 +44,13 @@ module Fastly
|
|
44
44
|
# @param [Hash] attributes Model attributes in the form of hash
|
45
45
|
def initialize(attributes = {})
|
46
46
|
if (!attributes.is_a?(Hash))
|
47
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::HistoricalFieldResponseDataField` initialize method"
|
48
48
|
end
|
49
49
|
|
50
50
|
# check to see if the attribute exists and convert string to symbol for hash key
|
51
51
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
52
|
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::HistoricalFieldResponseDataField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
54
|
end
|
55
55
|
h[k.to_sym] = v
|
56
56
|
}
|
@@ -1113,7 +1113,7 @@ module Fastly
|
|
1113
1113
|
:'ddos_action_tarpit' => :'Integer',
|
1114
1114
|
:'ddos_action_close' => :'Integer',
|
1115
1115
|
:'ddos_action_blackhole' => :'Integer',
|
1116
|
-
:'service_id' => :'
|
1116
|
+
:'service_id' => :'ReadOnlyIdService',
|
1117
1117
|
:'start_time' => :'Integer'
|
1118
1118
|
}
|
1119
1119
|
end
|
@@ -1122,7 +1122,6 @@ module Fastly
|
|
1122
1122
|
def self.fastly_nullable
|
1123
1123
|
Set.new([
|
1124
1124
|
:'hit_ratio',
|
1125
|
-
:'service_id',
|
1126
1125
|
])
|
1127
1126
|
end
|
1128
1127
|
|
@@ -33,7 +33,7 @@ module Fastly
|
|
33
33
|
# Attribute type mapping.
|
34
34
|
def self.fastly_types
|
35
35
|
{
|
36
|
-
:'service_id' => :'
|
36
|
+
:'service_id' => :'ReadOnlyIdService',
|
37
37
|
:'start_time' => :'Integer'
|
38
38
|
}
|
39
39
|
end
|
@@ -41,7 +41,6 @@ module Fastly
|
|
41
41
|
# List of attributes with nullable: true
|
42
42
|
def self.fastly_nullable
|
43
43
|
Set.new([
|
44
|
-
:'service_id',
|
45
44
|
])
|
46
45
|
end
|
47
46
|
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
class
|
15
|
+
class HistoricalResponseDataField
|
16
16
|
# Contains the results of the query, organized by *service ID*, into arrays where each element describes one service over a *time span*.
|
17
17
|
attr_accessor :data
|
18
18
|
|
@@ -45,13 +45,13 @@ module Fastly
|
|
45
45
|
# @param [Hash] attributes Model attributes in the form of hash
|
46
46
|
def initialize(attributes = {})
|
47
47
|
if (!attributes.is_a?(Hash))
|
48
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::HistoricalResponseDataField` initialize method"
|
49
49
|
end
|
50
50
|
|
51
51
|
# check to see if the attribute exists and convert string to symbol for hash key
|
52
52
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
53
|
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::HistoricalResponseDataField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
55
|
end
|
56
56
|
h[k.to_sym] = v
|
57
57
|
}
|
@@ -0,0 +1,217 @@
|
|
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 HistoricalService
|
16
|
+
# The name of the service.
|
17
|
+
attr_accessor :name
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'name' => :'name'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns all the JSON keys this model knows about
|
27
|
+
def self.acceptable_attributes
|
28
|
+
attribute_map.values
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.fastly_types
|
33
|
+
{
|
34
|
+
:'name' => :'String'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.fastly_nullable
|
40
|
+
Set.new([
|
41
|
+
])
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
if (!attributes.is_a?(Hash))
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::HistoricalService` initialize method"
|
49
|
+
end
|
50
|
+
|
51
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::HistoricalService`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
|
+
end
|
56
|
+
h[k.to_sym] = v
|
57
|
+
}
|
58
|
+
|
59
|
+
if attributes.key?(:'name')
|
60
|
+
self.name = attributes[:'name']
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
65
|
+
# @return Array for valid properties with the reasons
|
66
|
+
def list_invalid_properties
|
67
|
+
invalid_properties = Array.new
|
68
|
+
invalid_properties
|
69
|
+
end
|
70
|
+
|
71
|
+
# Check to see if the all the properties in the model are valid
|
72
|
+
# @return true if the model is valid
|
73
|
+
def valid?
|
74
|
+
true
|
75
|
+
end
|
76
|
+
|
77
|
+
# Checks equality by comparing each attribute.
|
78
|
+
# @param [Object] Object to be compared
|
79
|
+
def ==(o)
|
80
|
+
return true if self.equal?(o)
|
81
|
+
self.class == o.class &&
|
82
|
+
name == o.name
|
83
|
+
end
|
84
|
+
|
85
|
+
# @see the `==` method
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def eql?(o)
|
88
|
+
self == o
|
89
|
+
end
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Integer] Hash code
|
93
|
+
def hash
|
94
|
+
[name].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def self.build_from_hash(attributes)
|
101
|
+
new.build_from_hash(attributes)
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.fastly_types.each_pair do |key, type|
|
110
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
111
|
+
self.send("#{key}=", nil)
|
112
|
+
elsif type =~ /\AArray<(.*)>/i
|
113
|
+
# check to ensure the input is an array given that the attribute
|
114
|
+
# is documented as an array but the input is not
|
115
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
117
|
+
end
|
118
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
119
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
self
|
124
|
+
end
|
125
|
+
|
126
|
+
# Deserializes the data based on type
|
127
|
+
# @param string type Data type
|
128
|
+
# @param string value Value to be deserialized
|
129
|
+
# @return [Object] Deserialized data
|
130
|
+
def _deserialize(type, value)
|
131
|
+
case type.to_sym
|
132
|
+
when :Time
|
133
|
+
Time.parse(value)
|
134
|
+
when :Date
|
135
|
+
Date.parse(value)
|
136
|
+
when :String
|
137
|
+
value.to_s
|
138
|
+
when :Integer
|
139
|
+
value.to_i
|
140
|
+
when :Float
|
141
|
+
value.to_f
|
142
|
+
when :Boolean
|
143
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
144
|
+
true
|
145
|
+
else
|
146
|
+
false
|
147
|
+
end
|
148
|
+
when :Object
|
149
|
+
# generic object (usually a Hash), return directly
|
150
|
+
value
|
151
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
152
|
+
inner_type = Regexp.last_match[:inner_type]
|
153
|
+
value.map { |v| _deserialize(inner_type, v) }
|
154
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
155
|
+
k_type = Regexp.last_match[:k_type]
|
156
|
+
v_type = Regexp.last_match[:v_type]
|
157
|
+
{}.tap do |hash|
|
158
|
+
value.each do |k, v|
|
159
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
else # model
|
163
|
+
# models (e.g. Pet) or oneOf
|
164
|
+
klass = Fastly.const_get(type)
|
165
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the string representation of the object
|
170
|
+
# @return [String] String presentation of the object
|
171
|
+
def to_s
|
172
|
+
to_hash.to_s
|
173
|
+
end
|
174
|
+
|
175
|
+
# to_body is an alias to to_hash (backward compatibility)
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
177
|
+
def to_body
|
178
|
+
to_hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the object in the form of hash
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_hash
|
184
|
+
hash = {}
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
186
|
+
value = self.send(attr)
|
187
|
+
if value.nil?
|
188
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
190
|
+
end
|
191
|
+
|
192
|
+
hash[param] = _to_hash(value)
|
193
|
+
end
|
194
|
+
hash
|
195
|
+
end
|
196
|
+
|
197
|
+
# Outputs non-array value in the form of hash
|
198
|
+
# For object, use to_hash. Otherwise, just return the value
|
199
|
+
# @param [Object] value Any valid value
|
200
|
+
# @return [Hash] Returns the value in the form of hash
|
201
|
+
def _to_hash(value)
|
202
|
+
if value.is_a?(Array)
|
203
|
+
value.compact.map { |v| _to_hash(v) }
|
204
|
+
elsif value.is_a?(Hash)
|
205
|
+
{}.tap do |hash|
|
206
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
207
|
+
end
|
208
|
+
elsif value.respond_to? :to_hash
|
209
|
+
value.to_hash
|
210
|
+
else
|
211
|
+
value
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
class
|
15
|
+
class HistoricalUsageMonthResponseData
|
16
16
|
attr_accessor :customer_id
|
17
17
|
|
18
18
|
attr_accessor :services
|
@@ -37,7 +37,7 @@ module Fastly
|
|
37
37
|
def self.fastly_types
|
38
38
|
{
|
39
39
|
:'customer_id' => :'String',
|
40
|
-
:'services' => :'Hash<String,
|
40
|
+
:'services' => :'Hash<String, HistoricalService>',
|
41
41
|
:'total' => :'HistoricalUsageResults'
|
42
42
|
}
|
43
43
|
end
|
@@ -52,13 +52,13 @@ module Fastly
|
|
52
52
|
# @param [Hash] attributes Model attributes in the form of hash
|
53
53
|
def initialize(attributes = {})
|
54
54
|
if (!attributes.is_a?(Hash))
|
55
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::HistoricalUsageMonthResponseData` initialize method"
|
56
56
|
end
|
57
57
|
|
58
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
59
59
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
60
|
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::HistoricalUsageMonthResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
62
|
end
|
63
63
|
h[k.to_sym] = v
|
64
64
|
}
|
@@ -37,6 +37,7 @@ module Fastly
|
|
37
37
|
# The action to take when a rate limiter violation is detected.
|
38
38
|
attr_accessor :action
|
39
39
|
|
40
|
+
# Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`.
|
40
41
|
attr_accessor :response
|
41
42
|
|
42
43
|
# Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration.
|
@@ -104,7 +105,7 @@ module Fastly
|
|
104
105
|
:'client_key' => :'Array<String>',
|
105
106
|
:'penalty_box_duration' => :'Integer',
|
106
107
|
:'action' => :'String',
|
107
|
-
:'response' => :'
|
108
|
+
:'response' => :'Hash<String, String>',
|
108
109
|
:'response_object_name' => :'String',
|
109
110
|
:'logger_type' => :'String',
|
110
111
|
:'feature_revision' => :'Integer'
|
@@ -172,7 +173,9 @@ module Fastly
|
|
172
173
|
end
|
173
174
|
|
174
175
|
if attributes.key?(:'response')
|
175
|
-
|
176
|
+
if (value = attributes[:'response']).is_a?(Hash)
|
177
|
+
self.response = value
|
178
|
+
end
|
176
179
|
end
|
177
180
|
|
178
181
|
if attributes.key?(:'response_object_name')
|
@@ -37,6 +37,7 @@ module Fastly
|
|
37
37
|
# The action to take when a rate limiter violation is detected.
|
38
38
|
attr_accessor :action
|
39
39
|
|
40
|
+
# Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`.
|
40
41
|
attr_accessor :response
|
41
42
|
|
42
43
|
# Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration.
|
@@ -126,7 +127,7 @@ module Fastly
|
|
126
127
|
:'client_key' => :'Array<String>',
|
127
128
|
:'penalty_box_duration' => :'Integer',
|
128
129
|
:'action' => :'String',
|
129
|
-
:'response' => :'
|
130
|
+
:'response' => :'Hash<String, String>',
|
130
131
|
:'response_object_name' => :'String',
|
131
132
|
:'logger_type' => :'String',
|
132
133
|
:'feature_revision' => :'Integer',
|
@@ -213,7 +214,9 @@ module Fastly
|
|
213
214
|
end
|
214
215
|
|
215
216
|
if attributes.key?(:'response')
|
216
|
-
|
217
|
+
if (value = attributes[:'response']).is_a?(Hash)
|
218
|
+
self.response = value
|
219
|
+
end
|
217
220
|
end
|
218
221
|
|
219
222
|
if attributes.key?(:'response_object_name')
|