fastly 4.1.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +93 -11
  5. data/docs/Backend.md +1 -1
  6. data/docs/BackendApi.md +4 -4
  7. data/docs/BackendResponse.md +1 -1
  8. data/docs/DomainOwnershipsApi.md +47 -0
  9. data/docs/EnabledProductResponse.md +12 -0
  10. data/docs/EnabledProductResponseLinks.md +11 -0
  11. data/docs/{EnabledProductProduct.md → EnabledProductResponseProduct.md} +3 -3
  12. data/docs/EnabledProductResponseService.md +11 -0
  13. data/docs/EnabledProductsApi.md +7 -7
  14. data/docs/EventsApi.md +2 -0
  15. data/docs/HistoricalApi.md +10 -10
  16. data/docs/{EnabledProductLinks.md → InlineResponse2002.md} +2 -3
  17. data/docs/{GetStoresResponse.md → InlineResponse2003.md} +2 -2
  18. data/docs/{GetStoresResponseMeta.md → InlineResponse2003Meta.md} +1 -1
  19. data/docs/{KeyResponse.md → InlineResponse2004.md} +2 -2
  20. data/docs/{ResourceCreateAllOf.md → InlineResponse2004Meta.md} +3 -2
  21. data/docs/ObjectStoreApi.md +3 -166
  22. data/docs/ObjectStoreItemApi.md +177 -0
  23. data/docs/Pop.md +7 -4
  24. data/docs/PopCoordinates.md +2 -4
  25. data/docs/RealtimeMeasurements.md +10 -2
  26. data/docs/Resource.md +2 -1
  27. data/docs/ResourceApi.md +34 -32
  28. data/docs/ResourceResponse.md +3 -3
  29. data/docs/ResourceResponseAllOf.md +1 -1
  30. data/docs/Results.md +11 -3
  31. data/docs/TlsSubscriptionResponseAttributes.md +1 -1
  32. data/docs/TlsSubscriptionResponseAttributesAllOf.md +1 -1
  33. data/docs/TlsSubscriptionsApi.md +3 -3
  34. data/lib/fastly/api/backend_api.rb +4 -4
  35. data/lib/fastly/api/domain_ownerships_api.rb +76 -0
  36. data/lib/fastly/api/enabled_products_api.rb +12 -12
  37. data/lib/fastly/api/events_api.rb +3 -0
  38. data/lib/fastly/api/historical_api.rb +10 -10
  39. data/lib/fastly/api/object_store_api.rb +5 -289
  40. data/lib/fastly/api/object_store_item_api.rb +304 -0
  41. data/lib/fastly/api/purge_api.rb +2 -2
  42. data/lib/fastly/api/resource_api.rb +51 -48
  43. data/lib/fastly/api/tls_subscriptions_api.rb +4 -4
  44. data/lib/fastly/models/backend.rb +1 -1
  45. data/lib/fastly/models/backend_response.rb +1 -1
  46. data/lib/fastly/models/{enabled_product.rb → enabled_product_response.rb} +6 -6
  47. data/lib/fastly/models/{enabled_product_links.rb → enabled_product_response_links.rb} +5 -3
  48. data/lib/fastly/models/{enabled_product_product.rb → enabled_product_response_product.rb} +5 -3
  49. data/lib/fastly/models/enabled_product_response_service.rb +227 -0
  50. data/lib/fastly/models/{resource_create_all_of.rb → inline_response2002.rb} +11 -11
  51. data/lib/fastly/models/{get_stores_response.rb → inline_response2003.rb} +4 -4
  52. data/lib/fastly/models/{get_stores_response_meta.rb → inline_response2003_meta.rb} +3 -3
  53. data/lib/fastly/models/{key_response.rb → inline_response2004.rb} +4 -4
  54. data/lib/fastly/models/inline_response2004_meta.rb +225 -0
  55. data/lib/fastly/models/pop.rb +121 -1
  56. data/lib/fastly/models/pop_coordinates.rb +12 -19
  57. data/lib/fastly/models/realtime_measurements.rb +86 -6
  58. data/lib/fastly/models/resource.rb +12 -2
  59. data/lib/fastly/models/resource_response.rb +23 -23
  60. data/lib/fastly/models/resource_response_all_of.rb +1 -1
  61. data/lib/fastly/models/results.rb +87 -7
  62. data/lib/fastly/models/tls_subscription_response_attributes.rb +2 -2
  63. data/lib/fastly/models/tls_subscription_response_attributes_all_of.rb +2 -2
  64. data/lib/fastly/models/type_resource.rb +2 -0
  65. data/lib/fastly/version.rb +1 -1
  66. data/lib/fastly.rb +11 -8
  67. data/sig.json +1 -1
  68. metadata +24 -18
  69. data/docs/EnabledProduct.md +0 -12
  70. data/docs/ResourceCreate.md +0 -11
  71. data/lib/fastly/models/resource_create.rb +0 -235
@@ -12,14 +12,14 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class ResourceCreateAllOf
16
- # The ID of the linked resource.
17
- attr_accessor :resource_id
15
+ class InlineResponse2002
16
+ # Time-stamp (GMT) when the domain_ownership validation will expire.
17
+ attr_accessor :expires_at
18
18
 
19
19
  # Attribute mapping from ruby-style variable name to JSON key.
20
20
  def self.attribute_map
21
21
  {
22
- :'resource_id' => :'resource_id'
22
+ :'expires_at' => :'expires_at'
23
23
  }
24
24
  end
25
25
 
@@ -31,7 +31,7 @@ module Fastly
31
31
  # Attribute type mapping.
32
32
  def self.fastly_types
33
33
  {
34
- :'resource_id' => :'String'
34
+ :'expires_at' => :'String'
35
35
  }
36
36
  end
37
37
 
@@ -45,19 +45,19 @@ module Fastly
45
45
  # @param [Hash] attributes Model attributes in the form of hash
46
46
  def initialize(attributes = {})
47
47
  if (!attributes.is_a?(Hash))
48
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ResourceCreateAllOf` initialize method"
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::InlineResponse2002` initialize method"
49
49
  end
50
50
 
51
51
  # check to see if the attribute exists and convert string to symbol for hash key
52
52
  attributes = attributes.each_with_object({}) { |(k, v), h|
53
53
  if (!self.class.attribute_map.key?(k.to_sym))
54
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ResourceCreateAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::InlineResponse2002`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
55
  end
56
56
  h[k.to_sym] = v
57
57
  }
58
58
 
59
- if attributes.key?(:'resource_id')
60
- self.resource_id = attributes[:'resource_id']
59
+ if attributes.key?(:'expires_at')
60
+ self.expires_at = attributes[:'expires_at']
61
61
  end
62
62
  end
63
63
 
@@ -79,7 +79,7 @@ module Fastly
79
79
  def ==(o)
80
80
  return true if self.equal?(o)
81
81
  self.class == o.class &&
82
- resource_id == o.resource_id
82
+ expires_at == o.expires_at
83
83
  end
84
84
 
85
85
  # @see the `==` method
@@ -91,7 +91,7 @@ module Fastly
91
91
  # Calculates hash code according to all attributes.
92
92
  # @return [Integer] Hash code
93
93
  def hash
94
- [resource_id].hash
94
+ [expires_at].hash
95
95
  end
96
96
 
97
97
  # Builds the object from hash
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class GetStoresResponse
15
+ class InlineResponse2003
16
16
  attr_accessor :data
17
17
 
18
18
  attr_accessor :meta
@@ -34,7 +34,7 @@ module Fastly
34
34
  def self.fastly_types
35
35
  {
36
36
  :'data' => :'Array<StoreResponse>',
37
- :'meta' => :'GetStoresResponseMeta'
37
+ :'meta' => :'InlineResponse2003Meta'
38
38
  }
39
39
  end
40
40
 
@@ -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::GetStoresResponse` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::InlineResponse2003` 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::GetStoresResponse`. 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::InlineResponse2003`. 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
  }
@@ -13,7 +13,7 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  # Meta for the pagination.
16
- class GetStoresResponseMeta
16
+ class InlineResponse2003Meta
17
17
  # Cursor for the next page.
18
18
  attr_accessor :next_cursor
19
19
 
@@ -51,13 +51,13 @@ module Fastly
51
51
  # @param [Hash] attributes Model attributes in the form of hash
52
52
  def initialize(attributes = {})
53
53
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::GetStoresResponseMeta` initialize method"
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::InlineResponse2003Meta` initialize method"
55
55
  end
56
56
 
57
57
  # check to see if the attribute exists and convert string to symbol for hash key
58
58
  attributes = attributes.each_with_object({}) { |(k, v), h|
59
59
  if (!self.class.attribute_map.key?(k.to_sym))
60
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::GetStoresResponseMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::InlineResponse2003Meta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
61
  end
62
62
  h[k.to_sym] = v
63
63
  }
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class KeyResponse
15
+ class InlineResponse2004
16
16
  attr_accessor :data
17
17
 
18
18
  attr_accessor :meta
@@ -34,7 +34,7 @@ module Fastly
34
34
  def self.fastly_types
35
35
  {
36
36
  :'data' => :'Array<String>',
37
- :'meta' => :'GetStoresResponseMeta'
37
+ :'meta' => :'InlineResponse2004Meta'
38
38
  }
39
39
  end
40
40
 
@@ -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::KeyResponse` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::InlineResponse2004` 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::KeyResponse`. 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::InlineResponse2004`. 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
  }
@@ -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 InlineResponse2004Meta
16
+ attr_accessor :next_cursor
17
+
18
+ attr_accessor :limit
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'next_cursor' => :'next_cursor',
24
+ :'limit' => :'limit'
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
+ :'next_cursor' => :'String',
37
+ :'limit' => :'Integer'
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::InlineResponse2004Meta` 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::InlineResponse2004Meta`. 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?(:'next_cursor')
63
+ self.next_cursor = attributes[:'next_cursor']
64
+ end
65
+
66
+ if attributes.key?(:'limit')
67
+ self.limit = attributes[:'limit']
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
+ next_cursor == o.next_cursor &&
90
+ limit == o.limit
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
+ [next_cursor, limit].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
@@ -13,22 +13,58 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class Pop
16
+ # the three-letter code for the [POP](https://developer.fastly.com/learning/concepts/pop/)
16
17
  attr_accessor :code
17
18
 
19
+ # the name of the POP
18
20
  attr_accessor :name
19
21
 
20
22
  attr_accessor :group
21
23
 
24
+ attr_accessor :region
25
+
26
+ # the region used for stats reporting
27
+ attr_accessor :stats_region
28
+
29
+ # the region used for billing
30
+ attr_accessor :billing_region
31
+
22
32
  attr_accessor :coordinates
23
33
 
34
+ # the name of the [shield code](https://developer.fastly.com/learning/concepts/shielding/#choosing-a-shield-location) if this POP is suitable for shielding
24
35
  attr_accessor :shield
25
36
 
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
26
59
  # Attribute mapping from ruby-style variable name to JSON key.
27
60
  def self.attribute_map
28
61
  {
29
62
  :'code' => :'code',
30
63
  :'name' => :'name',
31
64
  :'group' => :'group',
65
+ :'region' => :'region',
66
+ :'stats_region' => :'stats_region',
67
+ :'billing_region' => :'billing_region',
32
68
  :'coordinates' => :'coordinates',
33
69
  :'shield' => :'shield'
34
70
  }
@@ -45,6 +81,9 @@ module Fastly
45
81
  :'code' => :'String',
46
82
  :'name' => :'String',
47
83
  :'group' => :'String',
84
+ :'region' => :'String',
85
+ :'stats_region' => :'String',
86
+ :'billing_region' => :'String',
48
87
  :'coordinates' => :'PopCoordinates',
49
88
  :'shield' => :'String'
50
89
  }
@@ -83,6 +122,18 @@ module Fastly
83
122
  self.group = attributes[:'group']
84
123
  end
85
124
 
125
+ if attributes.key?(:'region')
126
+ self.region = attributes[:'region']
127
+ end
128
+
129
+ if attributes.key?(:'stats_region')
130
+ self.stats_region = attributes[:'stats_region']
131
+ end
132
+
133
+ if attributes.key?(:'billing_region')
134
+ self.billing_region = attributes[:'billing_region']
135
+ end
136
+
86
137
  if attributes.key?(:'coordinates')
87
138
  self.coordinates = attributes[:'coordinates']
88
139
  end
@@ -96,15 +147,81 @@ module Fastly
96
147
  # @return Array for valid properties with the reasons
97
148
  def list_invalid_properties
98
149
  invalid_properties = Array.new
150
+ if @code.nil?
151
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
152
+ end
153
+
154
+ if @name.nil?
155
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
156
+ end
157
+
158
+ if @group.nil?
159
+ invalid_properties.push('invalid value for "group", group cannot be nil.')
160
+ end
161
+
162
+ if @region.nil?
163
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
164
+ end
165
+
166
+ if @stats_region.nil?
167
+ invalid_properties.push('invalid value for "stats_region", stats_region cannot be nil.')
168
+ end
169
+
170
+ if @billing_region.nil?
171
+ invalid_properties.push('invalid value for "billing_region", billing_region cannot be nil.')
172
+ end
173
+
99
174
  invalid_properties
100
175
  end
101
176
 
102
177
  # Check to see if the all the properties in the model are valid
103
178
  # @return true if the model is valid
104
179
  def valid?
180
+ return false if @code.nil?
181
+ return false if @name.nil?
182
+ return false if @group.nil?
183
+ return false if @region.nil?
184
+ region_validator = EnumAttributeValidator.new('String', ["APAC", "Asia", "AF-West", "EU-Central", "EU-East", "EU-West", "Middle-East", "North-America", "SA-South", "SA-East", "SA-West", "SA-North", "South-Africa", "South-America", "US-Central", "US-East", "US-West", "Asia-South"])
185
+ return false unless region_validator.valid?(@region)
186
+ return false if @stats_region.nil?
187
+ stats_region_validator = EnumAttributeValidator.new('String', ["southamerica_std", "africa_std", "anzac", "asia", "europe", "usa", "asia_india", "asia_southkorea"])
188
+ return false unless stats_region_validator.valid?(@stats_region)
189
+ return false if @billing_region.nil?
190
+ billing_region_validator = EnumAttributeValidator.new('String', ["Africa", "Australia", "Asia", "Europe", "India", "North America", "South Korea", "South America"])
191
+ return false unless billing_region_validator.valid?(@billing_region)
105
192
  true
106
193
  end
107
194
 
195
+ # Custom attribute writer method checking allowed values (enum).
196
+ # @param [Object] region Object to be assigned
197
+ def region=(region)
198
+ validator = EnumAttributeValidator.new('String', ["APAC", "Asia", "AF-West", "EU-Central", "EU-East", "EU-West", "Middle-East", "North-America", "SA-South", "SA-East", "SA-West", "SA-North", "South-Africa", "South-America", "US-Central", "US-East", "US-West", "Asia-South"])
199
+ unless validator.valid?(region)
200
+ fail ArgumentError, "invalid value for \"region\", must be one of #{validator.allowable_values}."
201
+ end
202
+ @region = region
203
+ end
204
+
205
+ # Custom attribute writer method checking allowed values (enum).
206
+ # @param [Object] stats_region Object to be assigned
207
+ def stats_region=(stats_region)
208
+ validator = EnumAttributeValidator.new('String', ["southamerica_std", "africa_std", "anzac", "asia", "europe", "usa", "asia_india", "asia_southkorea"])
209
+ unless validator.valid?(stats_region)
210
+ fail ArgumentError, "invalid value for \"stats_region\", must be one of #{validator.allowable_values}."
211
+ end
212
+ @stats_region = stats_region
213
+ end
214
+
215
+ # Custom attribute writer method checking allowed values (enum).
216
+ # @param [Object] billing_region Object to be assigned
217
+ def billing_region=(billing_region)
218
+ validator = EnumAttributeValidator.new('String', ["Africa", "Australia", "Asia", "Europe", "India", "North America", "South Korea", "South America"])
219
+ unless validator.valid?(billing_region)
220
+ fail ArgumentError, "invalid value for \"billing_region\", must be one of #{validator.allowable_values}."
221
+ end
222
+ @billing_region = billing_region
223
+ end
224
+
108
225
  # Checks equality by comparing each attribute.
109
226
  # @param [Object] Object to be compared
110
227
  def ==(o)
@@ -113,6 +230,9 @@ module Fastly
113
230
  code == o.code &&
114
231
  name == o.name &&
115
232
  group == o.group &&
233
+ region == o.region &&
234
+ stats_region == o.stats_region &&
235
+ billing_region == o.billing_region &&
116
236
  coordinates == o.coordinates &&
117
237
  shield == o.shield
118
238
  end
@@ -126,7 +246,7 @@ module Fastly
126
246
  # Calculates hash code according to all attributes.
127
247
  # @return [Integer] Hash code
128
248
  def hash
129
- [code, name, group, coordinates, shield].hash
249
+ [code, name, group, region, stats_region, billing_region, coordinates, shield].hash
130
250
  end
131
251
 
132
252
  # Builds the object from hash
@@ -12,11 +12,8 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
+ # the geographic location of the POP
15
16
  class PopCoordinates
16
- attr_accessor :x
17
-
18
- attr_accessor :y
19
-
20
17
  attr_accessor :latitude
21
18
 
22
19
  attr_accessor :longitude
@@ -24,8 +21,6 @@ module Fastly
24
21
  # Attribute mapping from ruby-style variable name to JSON key.
25
22
  def self.attribute_map
26
23
  {
27
- :'x' => :'x',
28
- :'y' => :'y',
29
24
  :'latitude' => :'latitude',
30
25
  :'longitude' => :'longitude'
31
26
  }
@@ -39,8 +34,6 @@ module Fastly
39
34
  # Attribute type mapping.
40
35
  def self.fastly_types
41
36
  {
42
- :'x' => :'Float',
43
- :'y' => :'Float',
44
37
  :'latitude' => :'Float',
45
38
  :'longitude' => :'Float'
46
39
  }
@@ -67,14 +60,6 @@ module Fastly
67
60
  h[k.to_sym] = v
68
61
  }
69
62
 
70
- if attributes.key?(:'x')
71
- self.x = attributes[:'x']
72
- end
73
-
74
- if attributes.key?(:'y')
75
- self.y = attributes[:'y']
76
- end
77
-
78
63
  if attributes.key?(:'latitude')
79
64
  self.latitude = attributes[:'latitude']
80
65
  end
@@ -88,12 +73,22 @@ module Fastly
88
73
  # @return Array for valid properties with the reasons
89
74
  def list_invalid_properties
90
75
  invalid_properties = Array.new
76
+ if @latitude.nil?
77
+ invalid_properties.push('invalid value for "latitude", latitude cannot be nil.')
78
+ end
79
+
80
+ if @longitude.nil?
81
+ invalid_properties.push('invalid value for "longitude", longitude cannot be nil.')
82
+ end
83
+
91
84
  invalid_properties
92
85
  end
93
86
 
94
87
  # Check to see if the all the properties in the model are valid
95
88
  # @return true if the model is valid
96
89
  def valid?
90
+ return false if @latitude.nil?
91
+ return false if @longitude.nil?
97
92
  true
98
93
  end
99
94
 
@@ -102,8 +97,6 @@ module Fastly
102
97
  def ==(o)
103
98
  return true if self.equal?(o)
104
99
  self.class == o.class &&
105
- x == o.x &&
106
- y == o.y &&
107
100
  latitude == o.latitude &&
108
101
  longitude == o.longitude
109
102
  end
@@ -117,7 +110,7 @@ module Fastly
117
110
  # Calculates hash code according to all attributes.
118
111
  # @return [Integer] Hash code
119
112
  def hash
120
- [x, y, latitude, longitude].hash
113
+ [latitude, longitude].hash
121
114
  end
122
115
 
123
116
  # Builds the object from hash