fastly 8.0.1 → 8.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +223 -130
  3. data/Gemfile.lock +1 -1
  4. data/README.md +19 -7
  5. data/docs/{ErrorResponse.md → AutomationTokenErrorResponse.md} +1 -1
  6. data/docs/AutomationTokensApi.md +2 -2
  7. data/docs/Backend.md +5 -1
  8. data/docs/BackendApi.md +20 -4
  9. data/docs/BackendResponse.md +5 -1
  10. data/docs/BillingInvoicesApi.md +96 -0
  11. data/docs/Director.md +1 -1
  12. data/docs/DirectorApi.md +2 -2
  13. data/docs/DirectorResponse.md +1 -1
  14. data/docs/DomainInspectorHistoricalApi.md +4 -4
  15. data/docs/DomainInspectorRealtimeEntry.md +1 -1
  16. data/docs/Error.md +13 -0
  17. data/docs/ErrorResponseData.md +11 -0
  18. data/docs/Invoice.md +18 -0
  19. data/docs/InvoiceResponse.md +18 -0
  20. data/docs/Invoicelineitems.md +18 -0
  21. data/docs/KvStoreApi.md +1 -1
  22. data/docs/ListInvoicesResponse.md +11 -0
  23. data/docs/Listinvoices.md +11 -0
  24. data/docs/LoggingScalyrAdditional.md +1 -1
  25. data/docs/LoggingScalyrApi.md +4 -4
  26. data/docs/LoggingScalyrResponse.md +1 -1
  27. data/docs/Metadata.md +13 -0
  28. data/docs/OriginInspectorHistoricalApi.md +4 -4
  29. data/docs/OriginInspectorRealtimeEntry.md +1 -1
  30. data/docs/PoolAdditional.md +1 -1
  31. data/docs/PoolApi.md +4 -4
  32. data/docs/PoolResponse.md +1 -1
  33. data/docs/PoolResponsePost.md +1 -1
  34. data/docs/Pop.md +2 -2
  35. data/docs/PublishApi.md +1 -1
  36. data/docs/RealtimeEntry.md +1 -1
  37. data/docs/RealtimeEntryAggregated.md +22 -1
  38. data/docs/RealtimeMeasurements.md +22 -1
  39. data/docs/RelationshipCustomerCustomer.md +1 -1
  40. data/docs/Results.md +23 -0
  41. data/docs/SecretStoreApi.md +4 -2
  42. data/docs/SecretStoreItemApi.md +2 -2
  43. data/docs/ServiceDetail.md +1 -1
  44. data/docs/ServiceListResponse.md +2 -2
  45. data/docs/ServiceListResponseAllOf.md +2 -2
  46. data/docs/ServiceResponse.md +1 -1
  47. data/docs/ServiceResponseAllOf.md +1 -1
  48. data/docs/TlsConfigurationResponseAttributes.md +1 -1
  49. data/docs/TlsConfigurationResponseAttributesAllOf.md +1 -1
  50. data/docs/TlsCsr.md +10 -0
  51. data/docs/TlsCsrData.md +12 -0
  52. data/docs/TlsCsrDataAttributes.md +20 -0
  53. data/docs/TlsCsrErrorResponse.md +10 -0
  54. data/docs/TlsCsrResponse.md +10 -0
  55. data/docs/TlsCsrResponseAttributes.md +10 -0
  56. data/docs/TlsCsrResponseData.md +13 -0
  57. data/docs/TlsCsrsApi.md +52 -0
  58. data/docs/TlsSubscriptionResponseAttributes.md +1 -0
  59. data/docs/TlsSubscriptionResponseAttributesAllOf.md +1 -0
  60. data/docs/TokensApi.md +1 -1
  61. data/docs/TypeTlsCsr.md +9 -0
  62. data/docs/VclApi.md +1 -1
  63. data/docs/WafActiveRulesApi.md +1 -1
  64. data/lib/fastly/api/automation_tokens_api.rb +3 -3
  65. data/lib/fastly/api/backend_api.rb +28 -4
  66. data/lib/fastly/api/billing_invoices_api.rb +151 -0
  67. data/lib/fastly/api/director_api.rb +2 -2
  68. data/lib/fastly/api/domain_inspector_historical_api.rb +4 -4
  69. data/lib/fastly/api/kv_store_api.rb +2 -2
  70. data/lib/fastly/api/logging_scalyr_api.rb +4 -4
  71. data/lib/fastly/api/origin_inspector_historical_api.rb +4 -4
  72. data/lib/fastly/api/pool_api.rb +4 -4
  73. data/lib/fastly/api/publish_api.rb +2 -2
  74. data/lib/fastly/api/secret_store_api.rb +5 -2
  75. data/lib/fastly/api/secret_store_item_api.rb +2 -2
  76. data/lib/fastly/api/tls_csrs_api.rb +83 -0
  77. data/lib/fastly/api/tokens_api.rb +2 -2
  78. data/lib/fastly/api/vcl_api.rb +2 -2
  79. data/lib/fastly/api/waf_active_rules_api.rb +2 -2
  80. data/lib/fastly/configuration.rb +18 -0
  81. data/lib/fastly/models/{error_response.rb → automation_token_error_response.rb} +3 -3
  82. data/lib/fastly/models/backend.rb +45 -2
  83. data/lib/fastly/models/backend_response.rb +45 -2
  84. data/lib/fastly/models/director.rb +1 -1
  85. data/lib/fastly/models/director_response.rb +1 -1
  86. data/lib/fastly/models/domain_inspector_realtime_entry.rb +1 -1
  87. data/lib/fastly/models/error.rb +243 -0
  88. data/lib/fastly/models/error_response_data.rb +225 -0
  89. data/lib/fastly/models/event_attributes.rb +2 -2
  90. data/lib/fastly/models/invoice.rb +298 -0
  91. data/lib/fastly/models/invoice_response.rb +305 -0
  92. data/lib/fastly/models/invoicelineitems.rb +297 -0
  93. data/lib/fastly/models/list_invoices_response.rb +234 -0
  94. data/lib/fastly/models/listinvoices.rb +227 -0
  95. data/lib/fastly/models/logging_scalyr_additional.rb +1 -1
  96. data/lib/fastly/models/logging_scalyr_response.rb +1 -1
  97. data/lib/fastly/models/metadata.rb +250 -0
  98. data/lib/fastly/models/origin_inspector_realtime_entry.rb +1 -1
  99. data/lib/fastly/models/pool_additional.rb +1 -1
  100. data/lib/fastly/models/pool_response.rb +1 -1
  101. data/lib/fastly/models/pool_response_post.rb +1 -1
  102. data/lib/fastly/models/pop.rb +2 -2
  103. data/lib/fastly/models/realtime_entry.rb +1 -1
  104. data/lib/fastly/models/realtime_entry_aggregated.rb +215 -5
  105. data/lib/fastly/models/realtime_measurements.rb +215 -5
  106. data/lib/fastly/models/relationship_customer_customer.rb +2 -4
  107. data/lib/fastly/models/relationship_tls_certificate.rb +1 -1
  108. data/lib/fastly/models/relationship_tls_configuration.rb +1 -1
  109. data/lib/fastly/models/request_settings_additional.rb +1 -0
  110. data/lib/fastly/models/request_settings_response.rb +6 -0
  111. data/lib/fastly/models/request_settings_response_all_of.rb +5 -0
  112. data/lib/fastly/models/results.rb +231 -1
  113. data/lib/fastly/models/service_detail.rb +1 -1
  114. data/lib/fastly/models/service_list_response.rb +2 -2
  115. data/lib/fastly/models/service_list_response_all_of.rb +2 -2
  116. data/lib/fastly/models/service_response.rb +1 -1
  117. data/lib/fastly/models/service_response_all_of.rb +1 -1
  118. data/lib/fastly/models/tls_configuration_response_attributes.rb +1 -1
  119. data/lib/fastly/models/tls_configuration_response_attributes_all_of.rb +1 -1
  120. data/lib/fastly/models/tls_csr.rb +216 -0
  121. data/lib/fastly/models/tls_csr_data.rb +236 -0
  122. data/lib/fastly/models/tls_csr_data_attributes.rb +358 -0
  123. data/lib/fastly/models/tls_csr_error_response.rb +218 -0
  124. data/lib/fastly/models/tls_csr_response.rb +216 -0
  125. data/lib/fastly/models/tls_csr_response_attributes.rb +217 -0
  126. data/lib/fastly/models/tls_csr_response_data.rb +245 -0
  127. data/lib/fastly/models/tls_subscription_data_attributes.rb +2 -2
  128. data/lib/fastly/models/tls_subscription_response_attributes.rb +14 -4
  129. data/lib/fastly/models/tls_subscription_response_attributes_all_of.rb +14 -4
  130. data/lib/fastly/models/type_tls_csr.rb +34 -0
  131. data/lib/fastly/version.rb +1 -1
  132. data/lib/fastly.rb +19 -1
  133. data/sig.json +1 -1
  134. metadata +41 -5
@@ -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://developer.fastly.com/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module Fastly
15
+ class ErrorResponseData
16
+ attr_accessor :title
17
+
18
+ attr_accessor :detail
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'title' => :'title',
24
+ :'detail' => :'detail'
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
+ :'detail' => :'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::ErrorResponseData` 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::ErrorResponseData`. 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?(:'detail')
67
+ self.detail = attributes[:'detail']
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
+ detail == o.detail
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, detail].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
@@ -173,7 +173,7 @@ module Fastly
173
173
  # Check to see if the all the properties in the model are valid
174
174
  # @return true if the model is valid
175
175
  def valid?
176
- event_type_validator = EnumAttributeValidator.new('String', ["api_key.create", "acl.create", "acl.delete", "acl.update", "address.create", "address.delete", "address.update", "backend.create", "backend.delete", "backend.update", "billing.contact_update", "cache_settings.create", "cache_settings.delete", "cache_settings.update", "customer.create", "customer.pricing", "customer.update", "customer_feature.create", "customer_feature.delete", "director.create", "director.delete", "director.update", "director_backend.create", "director_backend.delete", "domain.create", "domain.delete", "domain.update", "gzip.create", "gzip.delete", "gzip.update", "header.create", "header.delete", "header.update", "healthcheck.create", "healthcheck.delete", "healthcheck.update", "invitation.accept", "invitation.sent", "invoice.failed_payment", "invoice.payment", "io_settings.create", "io_settings.delete", "io_settings.update", "logging.create", "logging.delete", "logging.update", "pool.create", "pool.delete", "pool.update", "request_settings.create", "request_settings.delete", "request_settings.update", "response_object.create", "response_object.delete", "response_object.update", "rule_status.update", "rule_status.upsert", "server.create", "server.delete", "server.update", "service.create", "service.delete", "service.move", "service.move_destination", "service.move_source", "service.purge_all", "service.update", "service_authorization.create", "service_authorization.delete", "service_authorization.update", "tls.bulk_certificate.create", "tls.bulk_certificate.delete", "tls.bulk_certificate.update", "tls.certificate.create", "tls.certificate.expiration_email", "tls.certificate.update", "tls.certificate.delete", "tls.configuration.update", "tls.private_key.create", "tls.private_key.delete", "tls.activation.enable", "tls.activation.update", "tls.activation.disable", "tls.globalsign.domain.create", "tls.globalsign.domain.verify", "tls.globalsign.domain.delete", "tls.subscription.create", "tls.subscription.delete", "tls.subscription.dns_check_email", "token.create", "token.destroy", "two_factor_auth.disable", "two_factor_auth.enable", "user.create", "user.destroy", "user.lock", "user.login", "user.login_failure", "user.logout", "user.password_update", "user.unlock", "user.update", "vcl.create", "vcl.delete", "vcl.update", "version.activate", "version.clone", "version.copy", "version.copy_destination", "version.copy_source", "version.create", "version.deactivate", "version.lock", "version.update", "waf.configuration_set_update", "waf.create", "waf.delete", "waf.update", "waf.enable", "waf.disable", "waf.owasp.create", "waf.owasp.update", "waf.ruleset.deploy", "waf.ruleset.deploy_failure", "wordpress.create", "wordpress.delete", "wordpress.update"])
176
+ event_type_validator = EnumAttributeValidator.new('String', ["api_key.create", "acl.create", "acl.delete", "acl.update", "address.create", "address.delete", "address.update", "alerts.definition.create", "alerts.definition.delete", "alerts.definition.test", "alerts.definition.update", "backend.create", "backend.delete", "backend.update", "billing.contact_update", "cache_settings.create", "cache_settings.delete", "cache_settings.update", "customer.create", "customer.pricing", "customer.update", "customer_feature.create", "customer_feature.delete", "director.create", "director.delete", "director.update", "director_backend.create", "director_backend.delete", "domain.create", "domain.delete", "domain.update", "gzip.create", "gzip.delete", "gzip.update", "header.create", "header.delete", "header.update", "healthcheck.create", "healthcheck.delete", "healthcheck.update", "invitation.accept", "invitation.sent", "invoice.failed_payment", "invoice.payment", "io_settings.create", "io_settings.delete", "io_settings.update", "logging.create", "logging.delete", "logging.update", "pool.create", "pool.delete", "pool.update", "request_settings.create", "request_settings.delete", "request_settings.update", "response_object.create", "response_object.delete", "response_object.update", "rule_status.update", "rule_status.upsert", "server.create", "server.delete", "server.update", "service.create", "service.delete", "service.move", "service.move_destination", "service.move_source", "service.purge_all", "service.update", "service_authorization.create", "service_authorization.delete", "service_authorization.update", "tls.bulk_certificate.create", "tls.bulk_certificate.delete", "tls.bulk_certificate.update", "tls.certificate.create", "tls.certificate.expiration_email", "tls.certificate.update", "tls.certificate.delete", "tls.configuration.update", "tls.private_key.create", "tls.private_key.delete", "tls.activation.enable", "tls.activation.update", "tls.activation.disable", "tls.globalsign.domain.create", "tls.globalsign.domain.verify", "tls.globalsign.domain.delete", "tls.subscription.create", "tls.subscription.delete", "tls.subscription.dns_check_email", "token.create", "token.destroy", "two_factor_auth.disable", "two_factor_auth.enable", "user.create", "user.destroy", "user.lock", "user.login", "user.login_failure", "user.logout", "user.password_update", "user.unlock", "user.update", "vcl.create", "vcl.delete", "vcl.update", "version.activate", "version.clone", "version.copy", "version.copy_destination", "version.copy_source", "version.create", "version.deactivate", "version.lock", "version.update", "waf.configuration_set_update", "waf.create", "waf.delete", "waf.update", "waf.enable", "waf.disable", "waf.owasp.create", "waf.owasp.update", "waf.ruleset.deploy", "waf.ruleset.deploy_failure", "wordpress.create", "wordpress.delete", "wordpress.update"])
177
177
  return false unless event_type_validator.valid?(@event_type)
178
178
  true
179
179
  end
@@ -181,7 +181,7 @@ module Fastly
181
181
  # Custom attribute writer method checking allowed values (enum).
182
182
  # @param [Object] event_type Object to be assigned
183
183
  def event_type=(event_type)
184
- validator = EnumAttributeValidator.new('String', ["api_key.create", "acl.create", "acl.delete", "acl.update", "address.create", "address.delete", "address.update", "backend.create", "backend.delete", "backend.update", "billing.contact_update", "cache_settings.create", "cache_settings.delete", "cache_settings.update", "customer.create", "customer.pricing", "customer.update", "customer_feature.create", "customer_feature.delete", "director.create", "director.delete", "director.update", "director_backend.create", "director_backend.delete", "domain.create", "domain.delete", "domain.update", "gzip.create", "gzip.delete", "gzip.update", "header.create", "header.delete", "header.update", "healthcheck.create", "healthcheck.delete", "healthcheck.update", "invitation.accept", "invitation.sent", "invoice.failed_payment", "invoice.payment", "io_settings.create", "io_settings.delete", "io_settings.update", "logging.create", "logging.delete", "logging.update", "pool.create", "pool.delete", "pool.update", "request_settings.create", "request_settings.delete", "request_settings.update", "response_object.create", "response_object.delete", "response_object.update", "rule_status.update", "rule_status.upsert", "server.create", "server.delete", "server.update", "service.create", "service.delete", "service.move", "service.move_destination", "service.move_source", "service.purge_all", "service.update", "service_authorization.create", "service_authorization.delete", "service_authorization.update", "tls.bulk_certificate.create", "tls.bulk_certificate.delete", "tls.bulk_certificate.update", "tls.certificate.create", "tls.certificate.expiration_email", "tls.certificate.update", "tls.certificate.delete", "tls.configuration.update", "tls.private_key.create", "tls.private_key.delete", "tls.activation.enable", "tls.activation.update", "tls.activation.disable", "tls.globalsign.domain.create", "tls.globalsign.domain.verify", "tls.globalsign.domain.delete", "tls.subscription.create", "tls.subscription.delete", "tls.subscription.dns_check_email", "token.create", "token.destroy", "two_factor_auth.disable", "two_factor_auth.enable", "user.create", "user.destroy", "user.lock", "user.login", "user.login_failure", "user.logout", "user.password_update", "user.unlock", "user.update", "vcl.create", "vcl.delete", "vcl.update", "version.activate", "version.clone", "version.copy", "version.copy_destination", "version.copy_source", "version.create", "version.deactivate", "version.lock", "version.update", "waf.configuration_set_update", "waf.create", "waf.delete", "waf.update", "waf.enable", "waf.disable", "waf.owasp.create", "waf.owasp.update", "waf.ruleset.deploy", "waf.ruleset.deploy_failure", "wordpress.create", "wordpress.delete", "wordpress.update"])
184
+ validator = EnumAttributeValidator.new('String', ["api_key.create", "acl.create", "acl.delete", "acl.update", "address.create", "address.delete", "address.update", "alerts.definition.create", "alerts.definition.delete", "alerts.definition.test", "alerts.definition.update", "backend.create", "backend.delete", "backend.update", "billing.contact_update", "cache_settings.create", "cache_settings.delete", "cache_settings.update", "customer.create", "customer.pricing", "customer.update", "customer_feature.create", "customer_feature.delete", "director.create", "director.delete", "director.update", "director_backend.create", "director_backend.delete", "domain.create", "domain.delete", "domain.update", "gzip.create", "gzip.delete", "gzip.update", "header.create", "header.delete", "header.update", "healthcheck.create", "healthcheck.delete", "healthcheck.update", "invitation.accept", "invitation.sent", "invoice.failed_payment", "invoice.payment", "io_settings.create", "io_settings.delete", "io_settings.update", "logging.create", "logging.delete", "logging.update", "pool.create", "pool.delete", "pool.update", "request_settings.create", "request_settings.delete", "request_settings.update", "response_object.create", "response_object.delete", "response_object.update", "rule_status.update", "rule_status.upsert", "server.create", "server.delete", "server.update", "service.create", "service.delete", "service.move", "service.move_destination", "service.move_source", "service.purge_all", "service.update", "service_authorization.create", "service_authorization.delete", "service_authorization.update", "tls.bulk_certificate.create", "tls.bulk_certificate.delete", "tls.bulk_certificate.update", "tls.certificate.create", "tls.certificate.expiration_email", "tls.certificate.update", "tls.certificate.delete", "tls.configuration.update", "tls.private_key.create", "tls.private_key.delete", "tls.activation.enable", "tls.activation.update", "tls.activation.disable", "tls.globalsign.domain.create", "tls.globalsign.domain.verify", "tls.globalsign.domain.delete", "tls.subscription.create", "tls.subscription.delete", "tls.subscription.dns_check_email", "token.create", "token.destroy", "two_factor_auth.disable", "two_factor_auth.enable", "user.create", "user.destroy", "user.lock", "user.login", "user.login_failure", "user.logout", "user.password_update", "user.unlock", "user.update", "vcl.create", "vcl.delete", "vcl.update", "version.activate", "version.clone", "version.copy", "version.copy_destination", "version.copy_source", "version.create", "version.deactivate", "version.lock", "version.update", "waf.configuration_set_update", "waf.create", "waf.delete", "waf.update", "waf.enable", "waf.disable", "waf.owasp.create", "waf.owasp.update", "waf.ruleset.deploy", "waf.ruleset.deploy_failure", "wordpress.create", "wordpress.delete", "wordpress.update"])
185
185
  unless validator.valid?(event_type)
186
186
  fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
187
187
  end
@@ -0,0 +1,298 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module Fastly
15
+ class Invoice
16
+ # Customer ID associated with the invoice.
17
+ attr_accessor :customer_id
18
+
19
+ # Alphanumeric string identifying the invoice.
20
+ attr_accessor :invoice_id
21
+
22
+ # Date and time invoice was posted on, in ISO 8601 format.
23
+ attr_accessor :invoice_posted_on
24
+
25
+ # Date and time (in ISO 8601 format) for initiation point of a billing cycle, signifying the start of charges for a service or subscription.
26
+ attr_accessor :billing_start_date
27
+
28
+ # Date and time (in ISO 8601 format) for termination point of a billing cycle, signifying the end of charges for a service or subscription.
29
+ attr_accessor :billing_end_date
30
+
31
+ # Alphanumeric string identifying the statement number.
32
+ attr_accessor :statement_number
33
+
34
+ # Three-letter code representing a specific currency used for financial transactions.
35
+ attr_accessor :currency_code
36
+
37
+ # Total billable amount for invoiced services charged within a single month.
38
+ attr_accessor :monthly_transaction_amount
39
+
40
+ attr_accessor :transaction_line_items
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'customer_id' => :'customer_id',
46
+ :'invoice_id' => :'invoice_id',
47
+ :'invoice_posted_on' => :'invoice_posted_on',
48
+ :'billing_start_date' => :'billing_start_date',
49
+ :'billing_end_date' => :'billing_end_date',
50
+ :'statement_number' => :'statement_number',
51
+ :'currency_code' => :'currency_code',
52
+ :'monthly_transaction_amount' => :'monthly_transaction_amount',
53
+ :'transaction_line_items' => :'transaction_line_items'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.fastly_types
64
+ {
65
+ :'customer_id' => :'String',
66
+ :'invoice_id' => :'String',
67
+ :'invoice_posted_on' => :'Time',
68
+ :'billing_start_date' => :'Time',
69
+ :'billing_end_date' => :'Time',
70
+ :'statement_number' => :'String',
71
+ :'currency_code' => :'String',
72
+ :'monthly_transaction_amount' => :'Float',
73
+ :'transaction_line_items' => :'Array<Invoicelineitems>'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.fastly_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Invoice` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Invoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'customer_id')
99
+ self.customer_id = attributes[:'customer_id']
100
+ end
101
+
102
+ if attributes.key?(:'invoice_id')
103
+ self.invoice_id = attributes[:'invoice_id']
104
+ end
105
+
106
+ if attributes.key?(:'invoice_posted_on')
107
+ self.invoice_posted_on = attributes[:'invoice_posted_on']
108
+ end
109
+
110
+ if attributes.key?(:'billing_start_date')
111
+ self.billing_start_date = attributes[:'billing_start_date']
112
+ end
113
+
114
+ if attributes.key?(:'billing_end_date')
115
+ self.billing_end_date = attributes[:'billing_end_date']
116
+ end
117
+
118
+ if attributes.key?(:'statement_number')
119
+ self.statement_number = attributes[:'statement_number']
120
+ end
121
+
122
+ if attributes.key?(:'currency_code')
123
+ self.currency_code = attributes[:'currency_code']
124
+ end
125
+
126
+ if attributes.key?(:'monthly_transaction_amount')
127
+ self.monthly_transaction_amount = attributes[:'monthly_transaction_amount']
128
+ end
129
+
130
+ if attributes.key?(:'transaction_line_items')
131
+ if (value = attributes[:'transaction_line_items']).is_a?(Array)
132
+ self.transaction_line_items = value
133
+ end
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ customer_id == o.customer_id &&
156
+ invoice_id == o.invoice_id &&
157
+ invoice_posted_on == o.invoice_posted_on &&
158
+ billing_start_date == o.billing_start_date &&
159
+ billing_end_date == o.billing_end_date &&
160
+ statement_number == o.statement_number &&
161
+ currency_code == o.currency_code &&
162
+ monthly_transaction_amount == o.monthly_transaction_amount &&
163
+ transaction_line_items == o.transaction_line_items
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [customer_id, invoice_id, invoice_posted_on, billing_start_date, billing_end_date, statement_number, currency_code, monthly_transaction_amount, transaction_line_items].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ new.build_from_hash(attributes)
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ self.class.fastly_types.each_pair do |key, type|
191
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
192
+ self.send("#{key}=", nil)
193
+ elsif type =~ /\AArray<(.*)>/i
194
+ # check to ensure the input is an array given that the attribute
195
+ # is documented as an array but the input is not
196
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
197
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
198
+ end
199
+ elsif !attributes[self.class.attribute_map[key]].nil?
200
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
201
+ end
202
+ end
203
+
204
+ self
205
+ end
206
+
207
+ # Deserializes the data based on type
208
+ # @param string type Data type
209
+ # @param string value Value to be deserialized
210
+ # @return [Object] Deserialized data
211
+ def _deserialize(type, value)
212
+ case type.to_sym
213
+ when :Time
214
+ Time.parse(value)
215
+ when :Date
216
+ Date.parse(value)
217
+ when :String
218
+ value.to_s
219
+ when :Integer
220
+ value.to_i
221
+ when :Float
222
+ value.to_f
223
+ when :Boolean
224
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
+ true
226
+ else
227
+ false
228
+ end
229
+ when :Object
230
+ # generic object (usually a Hash), return directly
231
+ value
232
+ when /\AArray<(?<inner_type>.+)>\z/
233
+ inner_type = Regexp.last_match[:inner_type]
234
+ value.map { |v| _deserialize(inner_type, v) }
235
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
236
+ k_type = Regexp.last_match[:k_type]
237
+ v_type = Regexp.last_match[:v_type]
238
+ {}.tap do |hash|
239
+ value.each do |k, v|
240
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
241
+ end
242
+ end
243
+ else # model
244
+ # models (e.g. Pet) or oneOf
245
+ klass = Fastly.const_get(type)
246
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
247
+ end
248
+ end
249
+
250
+ # Returns the string representation of the object
251
+ # @return [String] String presentation of the object
252
+ def to_s
253
+ to_hash.to_s
254
+ end
255
+
256
+ # to_body is an alias to to_hash (backward compatibility)
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_body
259
+ to_hash
260
+ end
261
+
262
+ # Returns the object in the form of hash
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_hash
265
+ hash = {}
266
+ self.class.attribute_map.each_pair do |attr, param|
267
+ value = self.send(attr)
268
+ if value.nil?
269
+ is_nullable = self.class.fastly_nullable.include?(attr)
270
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
271
+ end
272
+
273
+ hash[param] = _to_hash(value)
274
+ end
275
+ hash
276
+ end
277
+
278
+ # Outputs non-array value in the form of hash
279
+ # For object, use to_hash. Otherwise, just return the value
280
+ # @param [Object] value Any valid value
281
+ # @return [Hash] Returns the value in the form of hash
282
+ def _to_hash(value)
283
+ if value.is_a?(Array)
284
+ value.compact.map { |v| _to_hash(v) }
285
+ elsif value.is_a?(Hash)
286
+ {}.tap do |hash|
287
+ value.each { |k, v| hash[k] = _to_hash(v) }
288
+ end
289
+ elsif value.respond_to? :to_hash
290
+ value.to_hash
291
+ else
292
+ value
293
+ end
294
+ end
295
+
296
+ end
297
+
298
+ end