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
data/lib/fastly/configuration.rb
CHANGED
@@ -482,12 +482,30 @@ module Fastly
|
|
482
482
|
description: "No description provided",
|
483
483
|
}
|
484
484
|
],
|
485
|
+
"BillingInvoicesApi.get_month_to_date_invoice": [
|
486
|
+
{
|
487
|
+
url: "https://api.fastly.com",
|
488
|
+
description: "No description provided",
|
489
|
+
}
|
490
|
+
],
|
485
491
|
"BillingInvoicesApi.list_invoices": [
|
486
492
|
{
|
487
493
|
url: "https://api.fastly.com",
|
488
494
|
description: "No description provided",
|
489
495
|
}
|
490
496
|
],
|
497
|
+
"BillingUsageMetricsApi.get_service_level_usage": [
|
498
|
+
{
|
499
|
+
url: "https://api.fastly.com",
|
500
|
+
description: "No description provided",
|
501
|
+
}
|
502
|
+
],
|
503
|
+
"BillingUsageMetricsApi.get_service_level_usage_types": [
|
504
|
+
{
|
505
|
+
url: "https://api.fastly.com",
|
506
|
+
description: "No description provided",
|
507
|
+
}
|
508
|
+
],
|
491
509
|
"CacheSettingsApi.create_cache_settings": [
|
492
510
|
{
|
493
511
|
url: "https://api.fastly.com",
|
@@ -2354,6 +2372,36 @@ module Fastly
|
|
2354
2372
|
description: "No description provided",
|
2355
2373
|
}
|
2356
2374
|
],
|
2375
|
+
"ObservabilityCustomDashboardsApi.create_dashboard": [
|
2376
|
+
{
|
2377
|
+
url: "https://api.fastly.com",
|
2378
|
+
description: "No description provided",
|
2379
|
+
}
|
2380
|
+
],
|
2381
|
+
"ObservabilityCustomDashboardsApi.delete_dashboard": [
|
2382
|
+
{
|
2383
|
+
url: "https://api.fastly.com",
|
2384
|
+
description: "No description provided",
|
2385
|
+
}
|
2386
|
+
],
|
2387
|
+
"ObservabilityCustomDashboardsApi.get_dashboard": [
|
2388
|
+
{
|
2389
|
+
url: "https://api.fastly.com",
|
2390
|
+
description: "No description provided",
|
2391
|
+
}
|
2392
|
+
],
|
2393
|
+
"ObservabilityCustomDashboardsApi.list_dashboards": [
|
2394
|
+
{
|
2395
|
+
url: "https://api.fastly.com",
|
2396
|
+
description: "No description provided",
|
2397
|
+
}
|
2398
|
+
],
|
2399
|
+
"ObservabilityCustomDashboardsApi.update_dashboard": [
|
2400
|
+
{
|
2401
|
+
url: "https://api.fastly.com",
|
2402
|
+
description: "No description provided",
|
2403
|
+
}
|
2404
|
+
],
|
2357
2405
|
"OriginInspectorHistoricalApi.get_origin_inspector_historical": [
|
2358
2406
|
{
|
2359
2407
|
url: "https://api.fastly.com",
|
@@ -2960,6 +3008,12 @@ module Fastly
|
|
2960
3008
|
description: "No description provided",
|
2961
3009
|
}
|
2962
3010
|
],
|
3011
|
+
"TlsCertificatesApi.get_tls_cert_blob": [
|
3012
|
+
{
|
3013
|
+
url: "https://api.fastly.com",
|
3014
|
+
description: "No description provided",
|
3015
|
+
}
|
3016
|
+
],
|
2963
3017
|
"TlsCertificatesApi.list_tls_certs": [
|
2964
3018
|
{
|
2965
3019
|
url: "https://api.fastly.com",
|
@@ -0,0 +1,225 @@
|
|
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 AsyncResponse
|
16
|
+
attr_accessor :title
|
17
|
+
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'title' => :'title',
|
24
|
+
:'status' => :'status'
|
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
|
+
:'title' => :'String',
|
37
|
+
:'status' => :'String'
|
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::AsyncResponse` 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::AsyncResponse`. 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?(:'title')
|
63
|
+
self.title = attributes[:'title']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'status')
|
67
|
+
self.status = attributes[:'status']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
72
|
+
# @return Array for valid properties with the reasons
|
73
|
+
def list_invalid_properties
|
74
|
+
invalid_properties = Array.new
|
75
|
+
invalid_properties
|
76
|
+
end
|
77
|
+
|
78
|
+
# Check to see if the all the properties in the model are valid
|
79
|
+
# @return true if the model is valid
|
80
|
+
def valid?
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
# Checks equality by comparing each attribute.
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def ==(o)
|
87
|
+
return true if self.equal?(o)
|
88
|
+
self.class == o.class &&
|
89
|
+
title == o.title &&
|
90
|
+
status == o.status
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Integer] Hash code
|
101
|
+
def hash
|
102
|
+
[title, status].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def self.build_from_hash(attributes)
|
109
|
+
new.build_from_hash(attributes)
|
110
|
+
end
|
111
|
+
|
112
|
+
# Builds the object from hash
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
# @return [Object] Returns the model itself
|
115
|
+
def build_from_hash(attributes)
|
116
|
+
return nil unless attributes.is_a?(Hash)
|
117
|
+
self.class.fastly_types.each_pair do |key, type|
|
118
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
119
|
+
self.send("#{key}=", nil)
|
120
|
+
elsif type =~ /\AArray<(.*)>/i
|
121
|
+
# check to ensure the input is an array given that the attribute
|
122
|
+
# is documented as an array but the input is not
|
123
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
124
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
125
|
+
end
|
126
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
127
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
self
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
# @param string type Data type
|
136
|
+
# @param string value Value to be deserialized
|
137
|
+
# @return [Object] Deserialized data
|
138
|
+
def _deserialize(type, value)
|
139
|
+
case type.to_sym
|
140
|
+
when :Time
|
141
|
+
Time.parse(value)
|
142
|
+
when :Date
|
143
|
+
Date.parse(value)
|
144
|
+
when :String
|
145
|
+
value.to_s
|
146
|
+
when :Integer
|
147
|
+
value.to_i
|
148
|
+
when :Float
|
149
|
+
value.to_f
|
150
|
+
when :Boolean
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
+
true
|
153
|
+
else
|
154
|
+
false
|
155
|
+
end
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
else # model
|
171
|
+
# models (e.g. Pet) or oneOf
|
172
|
+
klass = Fastly.const_get(type)
|
173
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
if value.nil?
|
196
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
197
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
198
|
+
end
|
199
|
+
|
200
|
+
hash[param] = _to_hash(value)
|
201
|
+
end
|
202
|
+
hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Outputs non-array value in the form of hash
|
206
|
+
# For object, use to_hash. Otherwise, just return the value
|
207
|
+
# @param [Object] value Any valid value
|
208
|
+
# @return [Hash] Returns the value in the form of hash
|
209
|
+
def _to_hash(value)
|
210
|
+
if value.is_a?(Array)
|
211
|
+
value.compact.map { |v| _to_hash(v) }
|
212
|
+
elsif value.is_a?(Hash)
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
215
|
+
end
|
216
|
+
elsif value.respond_to? :to_hash
|
217
|
+
value.to_hash
|
218
|
+
else
|
219
|
+
value
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
@@ -0,0 +1,245 @@
|
|
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 CreateDashboardRequest
|
16
|
+
# A human-readable name
|
17
|
+
attr_accessor :name
|
18
|
+
|
19
|
+
# A short description of the dashboard
|
20
|
+
attr_accessor :description
|
21
|
+
|
22
|
+
# A list of [dashboard items](#dashboard-item).
|
23
|
+
attr_accessor :items
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'name' => :'name',
|
29
|
+
:'description' => :'description',
|
30
|
+
:'items' => :'items'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns all the JSON keys this model knows about
|
35
|
+
def self.acceptable_attributes
|
36
|
+
attribute_map.values
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.fastly_types
|
41
|
+
{
|
42
|
+
:'name' => :'String',
|
43
|
+
:'description' => :'String',
|
44
|
+
:'items' => :'Array<DashboardItem>'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# List of attributes with nullable: true
|
49
|
+
def self.fastly_nullable
|
50
|
+
Set.new([
|
51
|
+
:'items'
|
52
|
+
])
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
if (!attributes.is_a?(Hash))
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::CreateDashboardRequest` initialize method"
|
60
|
+
end
|
61
|
+
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
64
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::CreateDashboardRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
|
+
end
|
67
|
+
h[k.to_sym] = v
|
68
|
+
}
|
69
|
+
|
70
|
+
if attributes.key?(:'name')
|
71
|
+
self.name = attributes[:'name']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'description')
|
75
|
+
self.description = attributes[:'description']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'items')
|
79
|
+
if (value = attributes[:'items']).is_a?(Array)
|
80
|
+
self.items = value
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
if @name.nil?
|
90
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
return false if @name.nil?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
name == o.name &&
|
109
|
+
description == o.description &&
|
110
|
+
items == o.items
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(o)
|
116
|
+
self == o
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Integer] Hash code
|
121
|
+
def hash
|
122
|
+
[name, description, items].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def self.build_from_hash(attributes)
|
129
|
+
new.build_from_hash(attributes)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.fastly_types.each_pair do |key, type|
|
138
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
139
|
+
self.send("#{key}=", nil)
|
140
|
+
elsif type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def _deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :Time
|
161
|
+
Time.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :Boolean
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
# models (e.g. Pet) or oneOf
|
192
|
+
klass = Fastly.const_get(type)
|
193
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|