fastly 8.0.1 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +198 -130
  3. data/Gemfile.lock +1 -1
  4. data/README.md +13 -7
  5. data/docs/{ErrorResponse.md → AutomationTokenErrorResponse.md} +1 -1
  6. data/docs/AutomationTokensApi.md +2 -2
  7. data/docs/Backend.md +1 -1
  8. data/docs/BackendApi.md +4 -4
  9. data/docs/BackendResponse.md +1 -1
  10. data/docs/BillingInvoicesApi.md +96 -0
  11. data/docs/Director.md +1 -1
  12. data/docs/DirectorApi.md +2 -2
  13. data/docs/DirectorResponse.md +1 -1
  14. data/docs/DomainInspectorHistoricalApi.md +4 -4
  15. data/docs/DomainInspectorRealtimeEntry.md +1 -1
  16. data/docs/Error.md +13 -0
  17. data/docs/ErrorResponseData.md +11 -0
  18. data/docs/Invoice.md +18 -0
  19. data/docs/InvoiceResponse.md +18 -0
  20. data/docs/Invoicelineitems.md +18 -0
  21. data/docs/KvStoreApi.md +1 -1
  22. data/docs/ListInvoicesResponse.md +11 -0
  23. data/docs/Listinvoices.md +11 -0
  24. data/docs/LoggingScalyrAdditional.md +1 -1
  25. data/docs/LoggingScalyrApi.md +4 -4
  26. data/docs/LoggingScalyrResponse.md +1 -1
  27. data/docs/Metadata.md +13 -0
  28. data/docs/OriginInspectorHistoricalApi.md +4 -4
  29. data/docs/OriginInspectorRealtimeEntry.md +1 -1
  30. data/docs/PoolAdditional.md +1 -1
  31. data/docs/PoolApi.md +4 -4
  32. data/docs/PoolResponse.md +1 -1
  33. data/docs/PoolResponsePost.md +1 -1
  34. data/docs/Pop.md +2 -2
  35. data/docs/PublishApi.md +1 -1
  36. data/docs/RealtimeEntry.md +1 -1
  37. data/docs/Results.md +2 -0
  38. data/docs/SecretStoreApi.md +4 -2
  39. data/docs/SecretStoreItemApi.md +2 -2
  40. data/docs/ServiceDetail.md +1 -1
  41. data/docs/ServiceListResponse.md +2 -2
  42. data/docs/ServiceListResponseAllOf.md +2 -2
  43. data/docs/ServiceResponse.md +1 -1
  44. data/docs/ServiceResponseAllOf.md +1 -1
  45. data/docs/TlsConfigurationResponseAttributes.md +1 -1
  46. data/docs/TlsConfigurationResponseAttributesAllOf.md +1 -1
  47. data/docs/TlsCsr.md +10 -0
  48. data/docs/TlsCsrData.md +12 -0
  49. data/docs/TlsCsrDataAttributes.md +20 -0
  50. data/docs/TlsCsrErrorResponse.md +10 -0
  51. data/docs/TlsCsrResponse.md +10 -0
  52. data/docs/TlsCsrResponseAttributes.md +10 -0
  53. data/docs/TlsCsrResponseData.md +13 -0
  54. data/docs/TlsCsrsApi.md +52 -0
  55. data/docs/TlsSubscriptionResponseAttributes.md +1 -0
  56. data/docs/TlsSubscriptionResponseAttributesAllOf.md +1 -0
  57. data/docs/TokensApi.md +1 -1
  58. data/docs/TypeTlsCsr.md +9 -0
  59. data/docs/VclApi.md +1 -1
  60. data/docs/WafActiveRulesApi.md +1 -1
  61. data/lib/fastly/api/automation_tokens_api.rb +3 -3
  62. data/lib/fastly/api/backend_api.rb +4 -4
  63. data/lib/fastly/api/billing_invoices_api.rb +151 -0
  64. data/lib/fastly/api/director_api.rb +2 -2
  65. data/lib/fastly/api/domain_inspector_historical_api.rb +4 -4
  66. data/lib/fastly/api/kv_store_api.rb +2 -2
  67. data/lib/fastly/api/logging_scalyr_api.rb +4 -4
  68. data/lib/fastly/api/origin_inspector_historical_api.rb +4 -4
  69. data/lib/fastly/api/pool_api.rb +4 -4
  70. data/lib/fastly/api/publish_api.rb +2 -2
  71. data/lib/fastly/api/secret_store_api.rb +5 -2
  72. data/lib/fastly/api/secret_store_item_api.rb +2 -2
  73. data/lib/fastly/api/tls_csrs_api.rb +83 -0
  74. data/lib/fastly/api/tokens_api.rb +2 -2
  75. data/lib/fastly/api/vcl_api.rb +2 -2
  76. data/lib/fastly/api/waf_active_rules_api.rb +2 -2
  77. data/lib/fastly/configuration.rb +18 -0
  78. data/lib/fastly/models/{error_response.rb → automation_token_error_response.rb} +3 -3
  79. data/lib/fastly/models/backend.rb +1 -1
  80. data/lib/fastly/models/backend_response.rb +1 -1
  81. data/lib/fastly/models/director.rb +1 -1
  82. data/lib/fastly/models/director_response.rb +1 -1
  83. data/lib/fastly/models/domain_inspector_realtime_entry.rb +1 -1
  84. data/lib/fastly/models/error.rb +243 -0
  85. data/lib/fastly/models/error_response_data.rb +225 -0
  86. data/lib/fastly/models/event_attributes.rb +2 -2
  87. data/lib/fastly/models/invoice.rb +298 -0
  88. data/lib/fastly/models/invoice_response.rb +305 -0
  89. data/lib/fastly/models/invoicelineitems.rb +297 -0
  90. data/lib/fastly/models/list_invoices_response.rb +234 -0
  91. data/lib/fastly/models/listinvoices.rb +227 -0
  92. data/lib/fastly/models/logging_scalyr_additional.rb +1 -1
  93. data/lib/fastly/models/logging_scalyr_response.rb +1 -1
  94. data/lib/fastly/models/metadata.rb +250 -0
  95. data/lib/fastly/models/origin_inspector_realtime_entry.rb +1 -1
  96. data/lib/fastly/models/pool_additional.rb +1 -1
  97. data/lib/fastly/models/pool_response.rb +1 -1
  98. data/lib/fastly/models/pool_response_post.rb +1 -1
  99. data/lib/fastly/models/pop.rb +2 -2
  100. data/lib/fastly/models/realtime_entry.rb +1 -1
  101. data/lib/fastly/models/relationship_tls_certificate.rb +1 -1
  102. data/lib/fastly/models/relationship_tls_configuration.rb +1 -1
  103. data/lib/fastly/models/results.rb +21 -1
  104. data/lib/fastly/models/service_detail.rb +1 -1
  105. data/lib/fastly/models/service_list_response.rb +2 -2
  106. data/lib/fastly/models/service_list_response_all_of.rb +2 -2
  107. data/lib/fastly/models/service_response.rb +1 -1
  108. data/lib/fastly/models/service_response_all_of.rb +1 -1
  109. data/lib/fastly/models/tls_configuration_response_attributes.rb +1 -1
  110. data/lib/fastly/models/tls_configuration_response_attributes_all_of.rb +1 -1
  111. data/lib/fastly/models/tls_csr.rb +216 -0
  112. data/lib/fastly/models/tls_csr_data.rb +236 -0
  113. data/lib/fastly/models/tls_csr_data_attributes.rb +358 -0
  114. data/lib/fastly/models/tls_csr_error_response.rb +218 -0
  115. data/lib/fastly/models/tls_csr_response.rb +216 -0
  116. data/lib/fastly/models/tls_csr_response_attributes.rb +217 -0
  117. data/lib/fastly/models/tls_csr_response_data.rb +245 -0
  118. data/lib/fastly/models/tls_subscription_data_attributes.rb +2 -2
  119. data/lib/fastly/models/tls_subscription_response_attributes.rb +14 -4
  120. data/lib/fastly/models/tls_subscription_response_attributes_all_of.rb +14 -4
  121. data/lib/fastly/models/type_tls_csr.rb +34 -0
  122. data/lib/fastly/version.rb +1 -1
  123. data/lib/fastly.rb +19 -1
  124. data/sig.json +1 -1
  125. metadata +40 -4
@@ -0,0 +1,227 @@
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 Listinvoices
16
+ attr_accessor :data
17
+
18
+ attr_accessor :meta
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data',
24
+ :'meta' => :'meta'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.fastly_types
35
+ {
36
+ :'data' => :'Array<Invoice>',
37
+ :'meta' => :'Metadata'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.fastly_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Listinvoices` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Listinvoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'data')
63
+ if (value = attributes[:'data']).is_a?(Array)
64
+ self.data = value
65
+ end
66
+ end
67
+
68
+ if attributes.key?(:'meta')
69
+ self.meta = attributes[:'meta']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ data == o.data &&
92
+ meta == o.meta
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [data, meta].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.fastly_types.each_pair do |key, type|
120
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = Fastly.const_get(type)
175
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.fastly_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -16,7 +16,7 @@ module Fastly
16
16
  # The region that log data will be sent to.
17
17
  attr_accessor :region
18
18
 
19
- # The token to use for authentication ([https://www.scalyr.com/keys](https://www.scalyr.com/keys)).
19
+ # The token to use for authentication.
20
20
  attr_accessor :token
21
21
 
22
22
  # The name of the logfile within Scalyr.
@@ -31,7 +31,7 @@ module Fastly
31
31
  # The region that log data will be sent to.
32
32
  attr_accessor :region
33
33
 
34
- # The token to use for authentication ([https://www.scalyr.com/keys](https://www.scalyr.com/keys)).
34
+ # The token to use for authentication.
35
35
  attr_accessor :token
36
36
 
37
37
  # The name of the logfile within Scalyr.
@@ -0,0 +1,250 @@
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
+ # Pagination metadata
16
+ class Metadata
17
+ # The token used to request the next set of results.
18
+ attr_accessor :next_cursor
19
+
20
+ # The number of invoices included in the response.
21
+ attr_accessor :limit
22
+
23
+ # The sort order of the invoices in the response.
24
+ attr_accessor :sort
25
+
26
+ # Total number of records available on the backend.
27
+ attr_accessor :total
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'next_cursor' => :'next_cursor',
33
+ :'limit' => :'limit',
34
+ :'sort' => :'sort',
35
+ :'total' => :'total'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.fastly_types
46
+ {
47
+ :'next_cursor' => :'String',
48
+ :'limit' => :'Integer',
49
+ :'sort' => :'String',
50
+ :'total' => :'Integer'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.fastly_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Metadata` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Metadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'next_cursor')
76
+ self.next_cursor = attributes[:'next_cursor']
77
+ end
78
+
79
+ if attributes.key?(:'limit')
80
+ self.limit = attributes[:'limit']
81
+ end
82
+
83
+ if attributes.key?(:'sort')
84
+ self.sort = attributes[:'sort']
85
+ else
86
+ self.sort = 'billing_start_date'
87
+ end
88
+
89
+ if attributes.key?(:'total')
90
+ self.total = attributes[:'total']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ next_cursor == o.next_cursor &&
113
+ limit == o.limit &&
114
+ sort == o.sort &&
115
+ total == o.total
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [next_cursor, limit, sort, total].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ new.build_from_hash(attributes)
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ self.class.fastly_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = Fastly.const_get(type)
198
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.fastly_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -19,7 +19,7 @@ module Fastly
19
19
  # Groups [measurements](#measurements-data-model) by backend name.
20
20
  attr_accessor :aggregated
21
21
 
22
- # Groups [measurements](#measurements-data-model) by POP, then backend name. See the [POPs API](/reference/api/utils/pops/) for details about POP identifiers.
22
+ # Groups [measurements](#measurements-data-model) by POP, then backend name. See the [POPs API](https://www.fastly.com/documentation/reference/api/utils/pops/) for details about POP identifiers.
23
23
  attr_accessor :datacenter
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -16,7 +16,7 @@ module Fastly
16
16
  # Name for the Pool.
17
17
  attr_accessor :name
18
18
 
19
- # Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](/reference/api/utils/pops/) to get a list of available POPs used for shielding.
19
+ # Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](https://www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding.
20
20
  attr_accessor :shield
21
21
 
22
22
  # Condition which, if met, will select this configuration during a request. Optional.
@@ -44,7 +44,7 @@ module Fastly
44
44
  # Name for the Pool.
45
45
  attr_accessor :name
46
46
 
47
- # Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](/reference/api/utils/pops/) to get a list of available POPs used for shielding.
47
+ # Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](https://www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding.
48
48
  attr_accessor :shield
49
49
 
50
50
  # Condition which, if met, will select this configuration during a request. Optional.
@@ -44,7 +44,7 @@ module Fastly
44
44
  # Name for the Pool.
45
45
  attr_accessor :name
46
46
 
47
- # Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](/reference/api/utils/pops/) to get a list of available POPs used for shielding.
47
+ # Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](https://www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding.
48
48
  attr_accessor :shield
49
49
 
50
50
  # Condition which, if met, will select this configuration during a request. Optional.
@@ -13,7 +13,7 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class Pop
16
- # the three-letter code for the [POP](https://developer.fastly.com/learning/concepts/pop/)
16
+ # the three-letter code for the [POP](https://www.fastly.com/documentation/learning/concepts/pop/)
17
17
  attr_accessor :code
18
18
 
19
19
  # the name of the POP
@@ -31,7 +31,7 @@ module Fastly
31
31
 
32
32
  attr_accessor :coordinates
33
33
 
34
- # the name of the [shield code](https://developer.fastly.com/learning/concepts/shielding/#choosing-a-shield-location) if this POP is suitable for shielding
34
+ # the name of the [shield code](https://www.fastly.com/documentation/learning/concepts/shielding/#choosing-a-shield-location) if this POP is suitable for shielding
35
35
  attr_accessor :shield
36
36
 
37
37
  class EnumAttributeValidator
@@ -18,7 +18,7 @@ module Fastly
18
18
 
19
19
  attr_accessor :aggregated
20
20
 
21
- # Groups [measurements](#measurements-data-model) by POP. See the [POPs API](/reference/api/utils/pops/) for details of POP identifiers.
21
+ # Groups [measurements](#measurements-data-model) by POP. See the [POPs API](https://www.fastly.com/documentation/reference/api/utils/pops/) for details of POP identifiers.
22
22
  attr_accessor :datacenter
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- # The [TLS certificate](/reference/api/tls/custom-certs/certificates/) being used to terminate TLS traffic for a domain. Required.
15
+ # The [TLS certificate](https://www.fastly.com/documentation/reference/api/tls/custom-certs/certificates/) being used to terminate TLS traffic for a domain. Required.
16
16
  class RelationshipTlsCertificate
17
17
  attr_accessor :tls_certificate
18
18
 
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- # The [TLS configuration](/reference/api/tls/custom-certs/configuration/) being used to terminate TLS traffic. Optional.
15
+ # The [TLS configuration](https://www.fastly.com/documentation/reference/api/tls/custom-certs/configuration/) being used to terminate TLS traffic. Optional.
16
16
  class RelationshipTlsConfiguration
17
17
  attr_accessor :tls_configuration
18
18