fastly 8.5.0 → 8.6.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 +10 -0
- data/Gemfile.lock +1 -1
- data/README.md +15 -2
- data/docs/{RelationshipTlsDnsRecord.md → AsyncResponse.md} +3 -2
- data/docs/BillingInvoicesApi.md +37 -4
- data/docs/BillingUsageMetricsApi.md +111 -0
- data/docs/CreateDashboardRequest.md +12 -0
- data/docs/Dashboard.md +17 -0
- data/docs/DashboardItem.md +15 -0
- data/docs/DashboardItemPropertyDataSource.md +11 -0
- data/docs/DashboardItemPropertyDataSourcePropertyConfig.md +10 -0
- data/docs/DashboardItemPropertyVisualization.md +11 -0
- data/docs/DashboardItemPropertyVisualizationPropertyConfig.md +12 -0
- data/docs/{RelationshipTlsDnsRecords.md → DashboardPropertyCreatedBy.md} +1 -2
- data/docs/{RelationshipTlsDnsRecordDnsRecord.md → DashboardPropertyUpdatedBy.md} +1 -2
- data/docs/DomainInspectorMeasurements.md +1 -1
- data/docs/{InvoiceResponse.md → EomInvoiceResponse.md} +1 -1
- data/docs/GetServiceLevelUsageResponse.md +10 -0
- data/docs/GetServiceLevelUsageTypesResponse.md +10 -0
- data/docs/IncludedWithTlsConfiguration.md +10 -0
- data/docs/IncludedWithTlsConfigurationItem.md +12 -0
- data/docs/ListDashboardsResponse.md +11 -0
- data/docs/{ListInvoicesResponse.md → ListEomInvoicesResponse.md} +1 -1
- data/docs/MtdInvoiceResponse.md +15 -0
- data/docs/Mtdinvoice.md +15 -0
- data/docs/Mtdlineitems.md +18 -0
- data/docs/ObservabilityCustomDashboardsApi.md +203 -0
- data/docs/RealtimeEntryAggregated.md +1 -0
- data/docs/RealtimeMeasurements.md +1 -0
- data/docs/RelationshipDefaultEcdsaTlsCertificate.md +10 -0
- data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md +10 -0
- data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md +11 -0
- data/docs/RelationshipDefaultTlsCertificate.md +10 -0
- data/docs/RelationshipDefaultTlsCertificateDefaultCertificate.md +10 -0
- data/docs/RelationshipDefaultTlsCertificateDefaultCertificateData.md +11 -0
- data/docs/RelationshipTlsDnsRecordsRequest.md +10 -0
- data/docs/RelationshipTlsDnsRecordsRequestDnsRecords.md +10 -0
- data/docs/RelationshipTlsDnsRecordsRequestDnsRecordsData.md +11 -0
- data/docs/RelationshipTlsDnsRecordsResponse.md +10 -0
- data/docs/RelationshipTlsDnsRecordsResponseDnsRecords.md +10 -0
- data/docs/{RelationshipMemberTlsDnsRecord.md → RelationshipTlsDnsRecordsResponseDnsRecordsData.md} +1 -1
- data/docs/Results.md +1 -0
- data/docs/Serviceusagemetric.md +13 -0
- data/docs/Serviceusagemetrics.md +10 -0
- data/docs/ServiceusagemetricsData.md +16 -0
- data/docs/Serviceusagetype.md +11 -0
- data/docs/Serviceusagetypes.md +10 -0
- data/docs/TlsCertificateBlobResponse.md +10 -0
- data/docs/TlsCertificatesApi.md +38 -0
- data/docs/TlsDnsRecord.md +1 -2
- data/docs/UpdateDashboardRequest.md +12 -0
- data/docs/Values.md +1 -1
- data/lib/fastly/api/billing_invoices_api.rb +62 -6
- data/lib/fastly/api/billing_usage_metrics_api.rb +213 -0
- data/lib/fastly/api/observability_custom_dashboards_api.rb +333 -0
- data/lib/fastly/api/tls_certificates_api.rb +63 -0
- data/lib/fastly/configuration.rb +54 -0
- data/lib/fastly/models/async_response.rb +225 -0
- data/lib/fastly/models/create_dashboard_request.rb +245 -0
- data/lib/fastly/models/dashboard.rb +290 -0
- data/lib/fastly/models/dashboard_item.rb +368 -0
- data/lib/fastly/models/dashboard_item_property_data_source.rb +271 -0
- data/lib/fastly/models/dashboard_item_property_data_source_property_config.rb +244 -0
- data/lib/fastly/models/dashboard_item_property_visualization.rb +271 -0
- data/lib/fastly/models/dashboard_item_property_visualization_property_config.rb +303 -0
- data/lib/fastly/models/dashboard_property_created_by.rb +208 -0
- data/lib/fastly/models/dashboard_property_updated_by.rb +208 -0
- data/lib/fastly/models/domain_inspector_measurements.rb +1 -1
- data/lib/fastly/models/{invoice_response.rb → eom_invoice_response.rb} +3 -3
- data/lib/fastly/models/get_service_level_usage_response.rb +223 -0
- data/lib/fastly/models/get_service_level_usage_types_response.rb +225 -0
- data/lib/fastly/models/included_with_tls_configuration.rb +218 -0
- data/lib/fastly/models/included_with_tls_configuration_item.rb +237 -0
- data/lib/fastly/models/invoicelineitems.rb +5 -5
- data/lib/fastly/models/list_dashboards_response.rb +229 -0
- data/lib/fastly/models/{list_invoices_response.rb → list_eom_invoices_response.rb} +3 -3
- data/lib/fastly/models/mtd_invoice_response.rb +275 -0
- data/lib/fastly/models/mtdinvoice.rb +268 -0
- data/lib/fastly/models/mtdlineitems.rb +297 -0
- data/lib/fastly/models/realtime_entry_aggregated.rb +14 -4
- data/lib/fastly/models/realtime_measurements.rb +14 -4
- data/lib/fastly/models/relationship_default_ecdsa_tls_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate_data.rb +228 -0
- data/lib/fastly/models/relationship_default_tls_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_tls_certificate_default_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_tls_certificate_default_certificate_data.rb +228 -0
- data/lib/fastly/models/{relationship_tls_dns_records.rb → relationship_tls_dns_records_request.rb} +4 -4
- data/lib/fastly/models/relationship_tls_dns_records_request_dns_records.rb +218 -0
- data/lib/fastly/models/{relationship_member_tls_dns_record.rb → relationship_tls_dns_records_request_dns_records_data.rb} +3 -3
- data/lib/fastly/models/relationship_tls_dns_records_response.rb +216 -0
- data/lib/fastly/models/relationship_tls_dns_records_response_dns_records.rb +218 -0
- data/lib/fastly/models/relationship_tls_dns_records_response_dns_records_data.rb +227 -0
- data/lib/fastly/models/relationships_for_tls_configuration.rb +1 -1
- data/lib/fastly/models/results.rb +11 -1
- data/lib/fastly/models/serviceusagemetric.rb +246 -0
- data/lib/fastly/models/{relationship_tls_dns_record.rb → serviceusagemetrics.rb} +10 -10
- data/lib/fastly/models/serviceusagemetrics_data.rb +276 -0
- data/lib/fastly/models/serviceusagetype.rb +227 -0
- data/lib/fastly/models/{relationship_tls_dns_record_dns_record.rb → serviceusagetypes.rb} +4 -4
- data/lib/fastly/models/tls_certificate_blob_response.rb +217 -0
- data/lib/fastly/models/tls_dns_record.rb +48 -12
- data/lib/fastly/models/update_dashboard_request.rb +240 -0
- data/lib/fastly/models/values.rb +1 -1
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +41 -6
- data/sig.json +1 -1
- metadata +84 -14
@@ -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://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 Serviceusagetype
|
16
|
+
# The product identifier associated with the usage type. This corresponds to a Fastly product offering.
|
17
|
+
attr_accessor :product_id
|
18
|
+
|
19
|
+
# Full name of the product usage type as it might appear on a customer's invoice.
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'product_id' => :'product_id',
|
26
|
+
:'name' => :'name'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.fastly_types
|
37
|
+
{
|
38
|
+
:'product_id' => :'String',
|
39
|
+
:'name' => :'String'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.fastly_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Serviceusagetype` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Serviceusagetype`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'product_id')
|
65
|
+
self.product_id = attributes[:'product_id']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'name')
|
69
|
+
self.name = attributes[:'name']
|
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
|
+
product_id == o.product_id &&
|
92
|
+
name == o.name
|
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
|
+
[product_id, name].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
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
class
|
15
|
+
class Serviceusagetypes
|
16
16
|
attr_accessor :data
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -30,7 +30,7 @@ module Fastly
|
|
30
30
|
# Attribute type mapping.
|
31
31
|
def self.fastly_types
|
32
32
|
{
|
33
|
-
:'data' => :'Array<
|
33
|
+
:'data' => :'Array<Serviceusagetype>'
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -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::Serviceusagetypes` 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::Serviceusagetypes`. 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
|
}
|
@@ -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://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 TlsCertificateBlobResponse
|
16
|
+
# A certificate blob
|
17
|
+
attr_accessor :cert_blob
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'cert_blob' => :'cert_blob'
|
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
|
+
:'cert_blob' => :'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::TlsCertificateBlobResponse` 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::TlsCertificateBlobResponse`. 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?(:'cert_blob')
|
60
|
+
self.cert_blob = attributes[:'cert_blob']
|
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
|
+
cert_blob == o.cert_blob
|
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
|
+
[cert_blob].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
|
@@ -13,19 +13,37 @@ require 'time'
|
|
13
13
|
|
14
14
|
module Fastly
|
15
15
|
class TlsDnsRecord
|
16
|
-
#
|
17
|
-
attr_accessor :id
|
18
|
-
|
19
|
-
# Specifies the regions that will be used to route traffic. Select DNS Records with a `global` region to route traffic to the most performant point of presence (POP) worldwide (global pricing will apply). Select DNS records with a `us-eu` region to exclusively land traffic on North American and European POPs.
|
16
|
+
# Specifies the regions that will be used to route traffic. Select DNS records with a `global` region to route traffic to the most performant point of presence (POP) worldwide (global pricing will apply). Select DNS records with a `na/eu` region to exclusively land traffic on North American and European POPs.
|
20
17
|
attr_accessor :region
|
21
18
|
|
22
19
|
# The type of the DNS record. `A` specifies an IPv4 address to be used for an A record to be used for apex domains (e.g., `example.com`). `AAAA` specifies an IPv6 address for use in an A record for apex domains. `CNAME` specifies the hostname to be used for a CNAME record for subdomains or wildcard domains (e.g., `www.example.com` or `*.example.com`).
|
23
20
|
attr_accessor :record_type
|
24
21
|
|
22
|
+
class EnumAttributeValidator
|
23
|
+
attr_reader :datatype
|
24
|
+
attr_reader :allowable_values
|
25
|
+
|
26
|
+
def initialize(datatype, allowable_values)
|
27
|
+
@allowable_values = allowable_values.map do |value|
|
28
|
+
case datatype.to_s
|
29
|
+
when /Integer/i
|
30
|
+
value.to_i
|
31
|
+
when /Float/i
|
32
|
+
value.to_f
|
33
|
+
else
|
34
|
+
value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def valid?(value)
|
40
|
+
!value || allowable_values.include?(value)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
25
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
45
|
def self.attribute_map
|
27
46
|
{
|
28
|
-
:'id' => :'id',
|
29
47
|
:'region' => :'region',
|
30
48
|
:'record_type' => :'record_type'
|
31
49
|
}
|
@@ -39,7 +57,6 @@ module Fastly
|
|
39
57
|
# Attribute type mapping.
|
40
58
|
def self.fastly_types
|
41
59
|
{
|
42
|
-
:'id' => :'String',
|
43
60
|
:'region' => :'String',
|
44
61
|
:'record_type' => :'String'
|
45
62
|
}
|
@@ -66,10 +83,6 @@ module Fastly
|
|
66
83
|
h[k.to_sym] = v
|
67
84
|
}
|
68
85
|
|
69
|
-
if attributes.key?(:'id')
|
70
|
-
self.id = attributes[:'id']
|
71
|
-
end
|
72
|
-
|
73
86
|
if attributes.key?(:'region')
|
74
87
|
self.region = attributes[:'region']
|
75
88
|
end
|
@@ -89,15 +102,38 @@ module Fastly
|
|
89
102
|
# Check to see if the all the properties in the model are valid
|
90
103
|
# @return true if the model is valid
|
91
104
|
def valid?
|
105
|
+
region_validator = EnumAttributeValidator.new('String', ["custom", "global", "na/eu"])
|
106
|
+
return false unless region_validator.valid?(@region)
|
107
|
+
record_type_validator = EnumAttributeValidator.new('String', ["CNAME", "A", "AAAA"])
|
108
|
+
return false unless record_type_validator.valid?(@record_type)
|
92
109
|
true
|
93
110
|
end
|
94
111
|
|
112
|
+
# Custom attribute writer method checking allowed values (enum).
|
113
|
+
# @param [Object] region Object to be assigned
|
114
|
+
def region=(region)
|
115
|
+
validator = EnumAttributeValidator.new('String', ["custom", "global", "na/eu"])
|
116
|
+
unless validator.valid?(region)
|
117
|
+
fail ArgumentError, "invalid value for \"region\", must be one of #{validator.allowable_values}."
|
118
|
+
end
|
119
|
+
@region = region
|
120
|
+
end
|
121
|
+
|
122
|
+
# Custom attribute writer method checking allowed values (enum).
|
123
|
+
# @param [Object] record_type Object to be assigned
|
124
|
+
def record_type=(record_type)
|
125
|
+
validator = EnumAttributeValidator.new('String', ["CNAME", "A", "AAAA"])
|
126
|
+
unless validator.valid?(record_type)
|
127
|
+
fail ArgumentError, "invalid value for \"record_type\", must be one of #{validator.allowable_values}."
|
128
|
+
end
|
129
|
+
@record_type = record_type
|
130
|
+
end
|
131
|
+
|
95
132
|
# Checks equality by comparing each attribute.
|
96
133
|
# @param [Object] Object to be compared
|
97
134
|
def ==(o)
|
98
135
|
return true if self.equal?(o)
|
99
136
|
self.class == o.class &&
|
100
|
-
id == o.id &&
|
101
137
|
region == o.region &&
|
102
138
|
record_type == o.record_type
|
103
139
|
end
|
@@ -111,7 +147,7 @@ module Fastly
|
|
111
147
|
# Calculates hash code according to all attributes.
|
112
148
|
# @return [Integer] Hash code
|
113
149
|
def hash
|
114
|
-
[
|
150
|
+
[region, record_type].hash
|
115
151
|
end
|
116
152
|
|
117
153
|
# Builds the object from hash
|