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,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 GetServiceLevelUsageTypesResponse
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<Serviceusagetype>'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.fastly_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # List of class defined in allOf (OpenAPI v3)
44
+ def self.fastly_all_of
45
+ [
46
+ :'Serviceusagetypes'
47
+ ]
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::GetServiceLevelUsageTypesResponse` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::GetServiceLevelUsageTypesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'data')
66
+ if (value = attributes[:'data']).is_a?(Array)
67
+ self.data = value
68
+ end
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ data == o.data
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
+ [data].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,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 IncludedWithTlsConfiguration
16
+ attr_accessor :included
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'included' => :'included'
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
+ :'included' => :'Array<IncludedWithTlsConfigurationItem>'
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::IncludedWithTlsConfiguration` 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::IncludedWithTlsConfiguration`. 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?(:'included')
59
+ if (value = attributes[:'included']).is_a?(Array)
60
+ self.included = 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
+ included == o.included
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
+ [included].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
@@ -0,0 +1,237 @@
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 IncludedWithTlsConfigurationItem
16
+ # The IP address or hostname of the DNS record.
17
+ attr_accessor :id
18
+
19
+ attr_accessor :type
20
+
21
+ attr_accessor :attributes
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'id' => :'id',
27
+ :'type' => :'type',
28
+ :'attributes' => :'attributes'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.fastly_types
39
+ {
40
+ :'id' => :'String',
41
+ :'type' => :'TypeTlsDnsRecord',
42
+ :'attributes' => :'TlsDnsRecord'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.fastly_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::IncludedWithTlsConfigurationItem` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::IncludedWithTlsConfigurationItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'id')
68
+ self.id = attributes[:'id']
69
+ end
70
+
71
+ if attributes.key?(:'type')
72
+ self.type = attributes[:'type']
73
+ else
74
+ self.type = 'dns_record'
75
+ end
76
+
77
+ if attributes.key?(:'attributes')
78
+ self.attributes = attributes[:'attributes']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ id == o.id &&
101
+ type == o.type &&
102
+ attributes == o.attributes
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [id, type, attributes].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.fastly_types.each_pair do |key, type|
130
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
131
+ self.send("#{key}=", nil)
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = Fastly.const_get(type)
185
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.fastly_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -51,11 +51,11 @@ module Fastly
51
51
  :'credit_coupon_code' => :'credit_coupon_code',
52
52
  :'rate' => :'rate',
53
53
  :'units' => :'units',
54
- :'product_name' => :'ProductName',
55
- :'product_group' => :'ProductGroup',
56
- :'product_line' => :'ProductLine',
57
- :'region' => :'Region',
58
- :'usage_type' => :'UsageType'
54
+ :'product_name' => :'product_name',
55
+ :'product_group' => :'product_group',
56
+ :'product_line' => :'product_line',
57
+ :'region' => :'region',
58
+ :'usage_type' => :'usage_type'
59
59
  }
60
60
  end
61
61