fastly 8.5.0 → 8.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +15 -2
  5. data/docs/{RelationshipTlsDnsRecord.md → AsyncResponse.md} +3 -2
  6. data/docs/BillingInvoicesApi.md +37 -4
  7. data/docs/BillingUsageMetricsApi.md +111 -0
  8. data/docs/CreateDashboardRequest.md +12 -0
  9. data/docs/Dashboard.md +17 -0
  10. data/docs/DashboardItem.md +15 -0
  11. data/docs/DashboardItemPropertyDataSource.md +11 -0
  12. data/docs/DashboardItemPropertyDataSourcePropertyConfig.md +10 -0
  13. data/docs/DashboardItemPropertyVisualization.md +11 -0
  14. data/docs/DashboardItemPropertyVisualizationPropertyConfig.md +12 -0
  15. data/docs/{RelationshipTlsDnsRecords.md → DashboardPropertyCreatedBy.md} +1 -2
  16. data/docs/{RelationshipTlsDnsRecordDnsRecord.md → DashboardPropertyUpdatedBy.md} +1 -2
  17. data/docs/DomainInspectorMeasurements.md +1 -1
  18. data/docs/{InvoiceResponse.md → EomInvoiceResponse.md} +1 -1
  19. data/docs/GetServiceLevelUsageResponse.md +10 -0
  20. data/docs/GetServiceLevelUsageTypesResponse.md +10 -0
  21. data/docs/IncludedWithTlsConfiguration.md +10 -0
  22. data/docs/IncludedWithTlsConfigurationItem.md +12 -0
  23. data/docs/ListDashboardsResponse.md +11 -0
  24. data/docs/{ListInvoicesResponse.md → ListEomInvoicesResponse.md} +1 -1
  25. data/docs/MtdInvoiceResponse.md +15 -0
  26. data/docs/Mtdinvoice.md +15 -0
  27. data/docs/Mtdlineitems.md +18 -0
  28. data/docs/ObservabilityCustomDashboardsApi.md +203 -0
  29. data/docs/RealtimeEntryAggregated.md +1 -0
  30. data/docs/RealtimeMeasurements.md +1 -0
  31. data/docs/RelationshipDefaultEcdsaTlsCertificate.md +10 -0
  32. data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md +10 -0
  33. data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md +11 -0
  34. data/docs/RelationshipDefaultTlsCertificate.md +10 -0
  35. data/docs/RelationshipDefaultTlsCertificateDefaultCertificate.md +10 -0
  36. data/docs/RelationshipDefaultTlsCertificateDefaultCertificateData.md +11 -0
  37. data/docs/RelationshipTlsDnsRecordsRequest.md +10 -0
  38. data/docs/RelationshipTlsDnsRecordsRequestDnsRecords.md +10 -0
  39. data/docs/RelationshipTlsDnsRecordsRequestDnsRecordsData.md +11 -0
  40. data/docs/RelationshipTlsDnsRecordsResponse.md +10 -0
  41. data/docs/RelationshipTlsDnsRecordsResponseDnsRecords.md +10 -0
  42. data/docs/{RelationshipMemberTlsDnsRecord.md → RelationshipTlsDnsRecordsResponseDnsRecordsData.md} +1 -1
  43. data/docs/Results.md +1 -0
  44. data/docs/Serviceusagemetric.md +13 -0
  45. data/docs/Serviceusagemetrics.md +10 -0
  46. data/docs/ServiceusagemetricsData.md +16 -0
  47. data/docs/Serviceusagetype.md +11 -0
  48. data/docs/Serviceusagetypes.md +10 -0
  49. data/docs/TlsCertificateBlobResponse.md +10 -0
  50. data/docs/TlsCertificatesApi.md +38 -0
  51. data/docs/TlsDnsRecord.md +1 -2
  52. data/docs/UpdateDashboardRequest.md +12 -0
  53. data/docs/Values.md +1 -1
  54. data/lib/fastly/api/billing_invoices_api.rb +62 -6
  55. data/lib/fastly/api/billing_usage_metrics_api.rb +213 -0
  56. data/lib/fastly/api/observability_custom_dashboards_api.rb +333 -0
  57. data/lib/fastly/api/tls_certificates_api.rb +63 -0
  58. data/lib/fastly/configuration.rb +54 -0
  59. data/lib/fastly/models/async_response.rb +225 -0
  60. data/lib/fastly/models/create_dashboard_request.rb +245 -0
  61. data/lib/fastly/models/dashboard.rb +290 -0
  62. data/lib/fastly/models/dashboard_item.rb +368 -0
  63. data/lib/fastly/models/dashboard_item_property_data_source.rb +271 -0
  64. data/lib/fastly/models/dashboard_item_property_data_source_property_config.rb +244 -0
  65. data/lib/fastly/models/dashboard_item_property_visualization.rb +271 -0
  66. data/lib/fastly/models/dashboard_item_property_visualization_property_config.rb +303 -0
  67. data/lib/fastly/models/dashboard_property_created_by.rb +208 -0
  68. data/lib/fastly/models/dashboard_property_updated_by.rb +208 -0
  69. data/lib/fastly/models/domain_inspector_measurements.rb +1 -1
  70. data/lib/fastly/models/{invoice_response.rb → eom_invoice_response.rb} +3 -3
  71. data/lib/fastly/models/get_service_level_usage_response.rb +223 -0
  72. data/lib/fastly/models/get_service_level_usage_types_response.rb +225 -0
  73. data/lib/fastly/models/included_with_tls_configuration.rb +218 -0
  74. data/lib/fastly/models/included_with_tls_configuration_item.rb +237 -0
  75. data/lib/fastly/models/invoicelineitems.rb +5 -5
  76. data/lib/fastly/models/list_dashboards_response.rb +229 -0
  77. data/lib/fastly/models/{list_invoices_response.rb → list_eom_invoices_response.rb} +3 -3
  78. data/lib/fastly/models/mtd_invoice_response.rb +275 -0
  79. data/lib/fastly/models/mtdinvoice.rb +268 -0
  80. data/lib/fastly/models/mtdlineitems.rb +297 -0
  81. data/lib/fastly/models/realtime_entry_aggregated.rb +14 -4
  82. data/lib/fastly/models/realtime_measurements.rb +14 -4
  83. data/lib/fastly/models/relationship_default_ecdsa_tls_certificate.rb +216 -0
  84. data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate.rb +216 -0
  85. data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate_data.rb +228 -0
  86. data/lib/fastly/models/relationship_default_tls_certificate.rb +216 -0
  87. data/lib/fastly/models/relationship_default_tls_certificate_default_certificate.rb +216 -0
  88. data/lib/fastly/models/relationship_default_tls_certificate_default_certificate_data.rb +228 -0
  89. data/lib/fastly/models/{relationship_tls_dns_records.rb → relationship_tls_dns_records_request.rb} +4 -4
  90. data/lib/fastly/models/relationship_tls_dns_records_request_dns_records.rb +218 -0
  91. data/lib/fastly/models/{relationship_member_tls_dns_record.rb → relationship_tls_dns_records_request_dns_records_data.rb} +3 -3
  92. data/lib/fastly/models/relationship_tls_dns_records_response.rb +216 -0
  93. data/lib/fastly/models/relationship_tls_dns_records_response_dns_records.rb +218 -0
  94. data/lib/fastly/models/relationship_tls_dns_records_response_dns_records_data.rb +227 -0
  95. data/lib/fastly/models/relationships_for_tls_configuration.rb +1 -1
  96. data/lib/fastly/models/results.rb +11 -1
  97. data/lib/fastly/models/serviceusagemetric.rb +246 -0
  98. data/lib/fastly/models/{relationship_tls_dns_record.rb → serviceusagemetrics.rb} +10 -10
  99. data/lib/fastly/models/serviceusagemetrics_data.rb +276 -0
  100. data/lib/fastly/models/serviceusagetype.rb +227 -0
  101. data/lib/fastly/models/{relationship_tls_dns_record_dns_record.rb → serviceusagetypes.rb} +4 -4
  102. data/lib/fastly/models/tls_certificate_blob_response.rb +217 -0
  103. data/lib/fastly/models/tls_dns_record.rb +48 -12
  104. data/lib/fastly/models/update_dashboard_request.rb +240 -0
  105. data/lib/fastly/models/values.rb +1 -1
  106. data/lib/fastly/version.rb +1 -1
  107. data/lib/fastly.rb +41 -6
  108. data/sig.json +1 -1
  109. metadata +84 -14
@@ -0,0 +1,228 @@
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 RelationshipDefaultTlsCertificateDefaultCertificateData
16
+ attr_accessor :type
17
+
18
+ # Alphanumeric string identifying the default TLS certificate.
19
+ attr_accessor :id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'type' => :'type',
25
+ :'id' => :'id'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.fastly_types
36
+ {
37
+ :'type' => :'TypeTlsCertificate',
38
+ :'id' => :'String'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.fastly_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RelationshipDefaultTlsCertificateDefaultCertificateData` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RelationshipDefaultTlsCertificateDefaultCertificateData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'type')
64
+ self.type = attributes[:'type']
65
+ else
66
+ self.type = 'tls_certificate'
67
+ end
68
+
69
+ if attributes.key?(:'id')
70
+ self.id = attributes[:'id']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ type == o.type &&
93
+ id == o.id
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [type, id].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.fastly_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = Fastly.const_get(type)
176
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.fastly_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class RelationshipTlsDnsRecords
15
+ class RelationshipTlsDnsRecordsRequest
16
16
  attr_accessor :dns_records
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
- :'dns_records' => :'RelationshipTlsDnsRecordDnsRecord'
33
+ :'dns_records' => :'RelationshipTlsDnsRecordsRequestDnsRecords'
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::RelationshipTlsDnsRecords` initialize method"
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RelationshipTlsDnsRecordsRequest` 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::RelationshipTlsDnsRecords`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RelationshipTlsDnsRecordsRequest`. 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,218 @@
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 RelationshipTlsDnsRecordsRequestDnsRecords
16
+ attr_accessor :data
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'data' => :'data'
22
+ }
23
+ end
24
+
25
+ # Returns all the JSON keys this model knows about
26
+ def self.acceptable_attributes
27
+ attribute_map.values
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.fastly_types
32
+ {
33
+ :'data' => :'Array<RelationshipTlsDnsRecordsRequestDnsRecordsData>'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.fastly_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RelationshipTlsDnsRecordsRequestDnsRecords` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RelationshipTlsDnsRecordsRequestDnsRecords`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'data')
59
+ if (value = attributes[:'data']).is_a?(Array)
60
+ self.data = value
61
+ end
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ data == o.data
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [data].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.fastly_types.each_pair do |key, type|
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :Time
134
+ Time.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ # models (e.g. Pet) or oneOf
165
+ klass = Fastly.const_get(type)
166
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.fastly_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class RelationshipMemberTlsDnsRecord
15
+ class RelationshipTlsDnsRecordsRequestDnsRecordsData
16
16
  attr_accessor :type
17
17
 
18
18
  attr_accessor :id
@@ -48,13 +48,13 @@ module Fastly
48
48
  # @param [Hash] attributes Model attributes in the form of hash
49
49
  def initialize(attributes = {})
50
50
  if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RelationshipMemberTlsDnsRecord` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RelationshipTlsDnsRecordsRequestDnsRecordsData` initialize method"
52
52
  end
53
53
 
54
54
  # check to see if the attribute exists and convert string to symbol for hash key
55
55
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
56
  if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RelationshipMemberTlsDnsRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RelationshipTlsDnsRecordsRequestDnsRecordsData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
58
  end
59
59
  h[k.to_sym] = v
60
60
  }