fastly 15.0.0 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -1
  3. data/Gemfile.lock +3 -3
  4. data/README.md +32 -3
  5. data/docs/ApisecurityOperationsApi.md +465 -0
  6. data/docs/AutomationTokensApi.md +2 -2
  7. data/docs/Backend.md +1 -0
  8. data/docs/BackendApi.md +4 -0
  9. data/docs/BackendResponse.md +1 -0
  10. data/docs/DdosProtectionApi.md +4 -4
  11. data/docs/DdosProtectionEvent.md +2 -0
  12. data/docs/DdosProtectionEventAllOf.md +2 -0
  13. data/docs/DdosProtectionRequestEnableMode.md +10 -0
  14. data/docs/DiscoveredOperationBase.md +12 -0
  15. data/docs/DiscoveredOperationGet.md +15 -0
  16. data/docs/DiscoveredOperationGetExtra.md +12 -0
  17. data/docs/DmDomainsApi.md +2 -2
  18. data/docs/DomainInspectorHistoricalApi.md +1 -1
  19. data/docs/DomainInspectorMeasurements.md +63 -0
  20. data/docs/DomainOwnershipsApi.md +2 -2
  21. data/docs/DomainResearchApi.md +103 -0
  22. data/docs/DomainResearchResponseBodyEnable.md +12 -0
  23. data/docs/DomainResearchResponseCustomer.md +10 -0
  24. data/docs/DomainResearchResponseLinks.md +10 -0
  25. data/docs/DomainResearchResponseLinksLinks.md +10 -0
  26. data/docs/DomainResearchResponseProduct.md +10 -0
  27. data/docs/DomainResearchResponseProductProduct.md +11 -0
  28. data/docs/HistoricalApi.md +8 -0
  29. data/docs/HistoricalMeta.md +1 -0
  30. data/docs/IamV1RoleResponse.md +1 -0
  31. data/docs/InlineResponse2001.md +2 -1
  32. data/docs/InlineResponse20010.md +2 -1
  33. data/docs/InlineResponse20011.md +11 -0
  34. data/docs/InlineResponse20012.md +11 -0
  35. data/docs/InlineResponse20013.md +11 -0
  36. data/docs/InlineResponse20014.md +10 -0
  37. data/docs/InlineResponse2002.md +2 -2
  38. data/docs/InlineResponse2003.md +2 -2
  39. data/docs/InlineResponse2004.md +1 -2
  40. data/docs/InlineResponse2005.md +2 -1
  41. data/docs/InlineResponse2006.md +2 -2
  42. data/docs/InlineResponse2007.md +2 -2
  43. data/docs/InlineResponse2008.md +1 -2
  44. data/docs/InlineResponse2009.md +1 -2
  45. data/docs/InsightsApi.md +3 -3
  46. data/docs/KvStoreApi.md +43 -4
  47. data/docs/KvStoreDetails.md +2 -0
  48. data/docs/KvStoreItemApi.md +2 -2
  49. data/docs/{KvStoreRequestCreate.md → KvStoreRequestCreateOrUpdate.md} +1 -1
  50. data/docs/LogInsights.md +1 -1
  51. data/docs/Meta.md +11 -0
  52. data/docs/MetricsPlatformApi.md +75 -0
  53. data/docs/NgwafRequestEnable.md +1 -0
  54. data/docs/Offer.md +12 -0
  55. data/docs/OfferAllOf.md +12 -0
  56. data/docs/OperationBase.md +14 -0
  57. data/docs/OperationCreate.md +14 -0
  58. data/docs/OperationGet.md +18 -0
  59. data/docs/OperationGetExtra.md +13 -0
  60. data/docs/OperationUpdate.md +14 -0
  61. data/docs/OriginInspectorHistoricalApi.md +1 -1
  62. data/docs/PackageMetadata.md +2 -2
  63. data/docs/PlatformMetadata.md +14 -0
  64. data/docs/PlatformMetricsResponse.md +11 -0
  65. data/docs/PlatformValues.md +25 -0
  66. data/docs/ProductDdosProtectionApi.md +3 -1
  67. data/docs/ProductDomainResearchApi.md +115 -0
  68. data/docs/RealtimeEntryAggregated.md +25 -0
  69. data/docs/RealtimeMeasurements.md +25 -0
  70. data/docs/Results.md +25 -0
  71. data/docs/SecretStoreApi.md +2 -2
  72. data/docs/SecretStoreItemApi.md +2 -2
  73. data/docs/ServiceAuthorizationsApi.md +2 -2
  74. data/docs/Status.md +15 -0
  75. data/docs/StatusAllOf.md +15 -0
  76. data/docs/Suggestion.md +13 -0
  77. data/docs/SuggestionAllOf.md +13 -0
  78. data/docs/TagBase.md +11 -0
  79. data/docs/TagCreate.md +11 -0
  80. data/docs/TagGet.md +15 -0
  81. data/docs/TagGetExtra.md +13 -0
  82. data/docs/Values.md +63 -0
  83. data/lib/fastly/api/apisecurity_operations_api.rb +829 -0
  84. data/lib/fastly/api/automation_tokens_api.rb +3 -3
  85. data/lib/fastly/api/backend_api.rb +6 -0
  86. data/lib/fastly/api/ddos_protection_api.rb +6 -6
  87. data/lib/fastly/api/dm_domains_api.rb +3 -3
  88. data/lib/fastly/api/domain_inspector_historical_api.rb +1 -1
  89. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  90. data/lib/fastly/api/domain_research_api.rb +163 -0
  91. data/lib/fastly/api/historical_api.rb +12 -0
  92. data/lib/fastly/api/kv_store_api.rb +74 -6
  93. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  94. data/lib/fastly/api/metrics_platform_api.rb +134 -0
  95. data/lib/fastly/api/origin_inspector_historical_api.rb +1 -1
  96. data/lib/fastly/api/product_ddos_protection_api.rb +10 -3
  97. data/lib/fastly/api/product_domain_research_api.rb +186 -0
  98. data/lib/fastly/api/secret_store_api.rb +3 -3
  99. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  100. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  101. data/lib/fastly/configuration.rb +108 -0
  102. data/lib/fastly/models/backend.rb +11 -1
  103. data/lib/fastly/models/backend_response.rb +11 -1
  104. data/lib/fastly/models/ddos_protection_event.rb +21 -1
  105. data/lib/fastly/models/ddos_protection_event_all_of.rb +21 -1
  106. data/lib/fastly/models/ddos_protection_request_enable_mode.rb +251 -0
  107. data/lib/fastly/models/discovered_operation_base.rb +271 -0
  108. data/lib/fastly/models/discovered_operation_get.rb +336 -0
  109. data/lib/fastly/models/discovered_operation_get_extra.rb +271 -0
  110. data/lib/fastly/models/domain_inspector_measurements.rb +634 -4
  111. data/lib/fastly/models/domain_research_response_body_enable.rb +243 -0
  112. data/lib/fastly/models/domain_research_response_customer.rb +216 -0
  113. data/lib/fastly/models/domain_research_response_links.rb +216 -0
  114. data/lib/fastly/models/domain_research_response_links_links.rb +217 -0
  115. data/lib/fastly/models/domain_research_response_product.rb +216 -0
  116. data/lib/fastly/models/domain_research_response_product_product.rb +227 -0
  117. data/lib/fastly/models/historical_meta.rb +13 -4
  118. data/lib/fastly/models/iam_v1_role_response.rb +10 -1
  119. data/lib/fastly/models/inline_response2001.rb +12 -3
  120. data/lib/fastly/models/inline_response20010.rb +13 -4
  121. data/lib/fastly/models/inline_response20011.rb +227 -0
  122. data/lib/fastly/models/inline_response20012.rb +227 -0
  123. data/lib/fastly/models/inline_response20013.rb +227 -0
  124. data/lib/fastly/models/inline_response20014.rb +218 -0
  125. data/lib/fastly/models/inline_response2002.rb +14 -13
  126. data/lib/fastly/models/inline_response2003.rb +14 -23
  127. data/lib/fastly/models/inline_response2004.rb +5 -15
  128. data/lib/fastly/models/inline_response2005.rb +18 -8
  129. data/lib/fastly/models/inline_response2006.rb +11 -1
  130. data/lib/fastly/models/inline_response2007.rb +4 -2
  131. data/lib/fastly/models/inline_response2008.rb +8 -18
  132. data/lib/fastly/models/inline_response2009.rb +8 -17
  133. data/lib/fastly/models/kv_store_details.rb +24 -4
  134. data/lib/fastly/models/{kv_store_request_create.rb → kv_store_request_create_or_update.rb} +3 -3
  135. data/lib/fastly/models/log_insights.rb +4 -2
  136. data/lib/fastly/models/meta.rb +266 -0
  137. data/lib/fastly/models/ngwaf_request_enable.rb +14 -4
  138. data/lib/fastly/models/offer.rb +245 -0
  139. data/lib/fastly/models/offer_all_of.rb +237 -0
  140. data/lib/fastly/models/operation_base.rb +308 -0
  141. data/lib/fastly/models/operation_create.rb +315 -0
  142. data/lib/fastly/models/operation_get.rb +381 -0
  143. data/lib/fastly/models/operation_get_extra.rb +257 -0
  144. data/lib/fastly/models/operation_update.rb +308 -0
  145. data/lib/fastly/models/package_metadata.rb +2 -2
  146. data/lib/fastly/models/platform_metadata.rb +258 -0
  147. data/lib/fastly/models/platform_metrics_response.rb +228 -0
  148. data/lib/fastly/models/platform_values.rb +368 -0
  149. data/lib/fastly/models/realtime_entry_aggregated.rb +254 -4
  150. data/lib/fastly/models/realtime_measurements.rb +254 -4
  151. data/lib/fastly/models/results.rb +251 -1
  152. data/lib/fastly/models/status.rb +276 -0
  153. data/lib/fastly/models/status_all_of.rb +268 -0
  154. data/lib/fastly/models/suggestion.rb +255 -0
  155. data/lib/fastly/models/suggestion_all_of.rb +247 -0
  156. data/lib/fastly/models/tag_base.rb +275 -0
  157. data/lib/fastly/models/tag_create.rb +282 -0
  158. data/lib/fastly/models/tag_get.rb +352 -0
  159. data/lib/fastly/models/tag_get_extra.rb +267 -0
  160. data/lib/fastly/models/values.rb +634 -4
  161. data/lib/fastly/version.rb +1 -1
  162. data/lib/fastly.rb +38 -1
  163. data/sig.json +1 -1
  164. metadata +78 -4
@@ -13,13 +13,15 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class InlineResponse2005
16
- # Time-stamp (GMT) when the domain_ownership validation will expire.
17
- attr_accessor :expires_at
16
+ attr_accessor :data
17
+
18
+ attr_accessor :meta
18
19
 
19
20
  # Attribute mapping from ruby-style variable name to JSON key.
20
21
  def self.attribute_map
21
22
  {
22
- :'expires_at' => :'expires_at'
23
+ :'data' => :'data',
24
+ :'meta' => :'meta'
23
25
  }
24
26
  end
25
27
 
@@ -31,7 +33,8 @@ module Fastly
31
33
  # Attribute type mapping.
32
34
  def self.fastly_types
33
35
  {
34
- :'expires_at' => :'String'
36
+ :'data' => :'Array<DdosProtectionEvent>',
37
+ :'meta' => :'PaginationCursorMeta'
35
38
  }
36
39
  end
37
40
 
@@ -56,8 +59,14 @@ module Fastly
56
59
  h[k.to_sym] = v
57
60
  }
58
61
 
59
- if attributes.key?(:'expires_at')
60
- self.expires_at = attributes[:'expires_at']
62
+ if attributes.key?(:'data')
63
+ if (value = attributes[:'data']).is_a?(Array)
64
+ self.data = value
65
+ end
66
+ end
67
+
68
+ if attributes.key?(:'meta')
69
+ self.meta = attributes[:'meta']
61
70
  end
62
71
  end
63
72
 
@@ -79,7 +88,8 @@ module Fastly
79
88
  def ==(o)
80
89
  return true if self.equal?(o)
81
90
  self.class == o.class &&
82
- expires_at == o.expires_at
91
+ data == o.data &&
92
+ meta == o.meta
83
93
  end
84
94
 
85
95
  # @see the `==` method
@@ -91,7 +101,7 @@ module Fastly
91
101
  # Calculates hash code according to all attributes.
92
102
  # @return [Integer] Hash code
93
103
  def hash
94
- [expires_at].hash
104
+ [data, meta].hash
95
105
  end
96
106
 
97
107
  # Builds the object from hash
@@ -33,7 +33,7 @@ module Fastly
33
33
  # Attribute type mapping.
34
34
  def self.fastly_types
35
35
  {
36
- :'data' => :'Array<KvStoreDetails>',
36
+ :'data' => :'Array<DdosProtectionRuleWithStats>',
37
37
  :'meta' => :'PaginationCursorMeta'
38
38
  }
39
39
  end
@@ -74,12 +74,22 @@ module Fastly
74
74
  # @return Array for valid properties with the reasons
75
75
  def list_invalid_properties
76
76
  invalid_properties = Array.new
77
+ if @data.nil?
78
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
79
+ end
80
+
81
+ if @meta.nil?
82
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
83
+ end
84
+
77
85
  invalid_properties
78
86
  end
79
87
 
80
88
  # Check to see if the all the properties in the model are valid
81
89
  # @return true if the model is valid
82
90
  def valid?
91
+ return false if @data.nil?
92
+ return false if @meta.nil?
83
93
  true
84
94
  end
85
95
 
@@ -15,6 +15,7 @@ module Fastly
15
15
  class InlineResponse2007
16
16
  attr_accessor :data
17
17
 
18
+ # Meta for the pagination.
18
19
  attr_accessor :meta
19
20
 
20
21
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -33,14 +34,15 @@ module Fastly
33
34
  # Attribute type mapping.
34
35
  def self.fastly_types
35
36
  {
36
- :'data' => :'Array<String>',
37
- :'meta' => :'PaginationCursorMeta'
37
+ :'data' => :'Array<SuccessfulResponseAsObject>',
38
+ :'meta' => :'Object'
38
39
  }
39
40
  end
40
41
 
41
42
  # List of attributes with nullable: true
42
43
  def self.fastly_nullable
43
44
  Set.new([
45
+ :'meta'
44
46
  ])
45
47
  end
46
48
 
@@ -13,15 +13,13 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class InlineResponse2008
16
- attr_accessor :data
17
-
18
- attr_accessor :meta
16
+ # Time-stamp (GMT) when the domain_ownership validation will expire.
17
+ attr_accessor :expires_at
19
18
 
20
19
  # Attribute mapping from ruby-style variable name to JSON key.
21
20
  def self.attribute_map
22
21
  {
23
- :'data' => :'data',
24
- :'meta' => :'meta'
22
+ :'expires_at' => :'expires_at'
25
23
  }
26
24
  end
27
25
 
@@ -33,8 +31,7 @@ module Fastly
33
31
  # Attribute type mapping.
34
32
  def self.fastly_types
35
33
  {
36
- :'data' => :'Array<SecretStoreResponse>',
37
- :'meta' => :'PaginationCursorMeta'
34
+ :'expires_at' => :'String'
38
35
  }
39
36
  end
40
37
 
@@ -59,14 +56,8 @@ module Fastly
59
56
  h[k.to_sym] = v
60
57
  }
61
58
 
62
- if attributes.key?(:'data')
63
- if (value = attributes[:'data']).is_a?(Array)
64
- self.data = value
65
- end
66
- end
67
-
68
- if attributes.key?(:'meta')
69
- self.meta = attributes[:'meta']
59
+ if attributes.key?(:'expires_at')
60
+ self.expires_at = attributes[:'expires_at']
70
61
  end
71
62
  end
72
63
 
@@ -88,8 +79,7 @@ module Fastly
88
79
  def ==(o)
89
80
  return true if self.equal?(o)
90
81
  self.class == o.class &&
91
- data == o.data &&
92
- meta == o.meta
82
+ expires_at == o.expires_at
93
83
  end
94
84
 
95
85
  # @see the `==` method
@@ -101,7 +91,7 @@ module Fastly
101
91
  # Calculates hash code according to all attributes.
102
92
  # @return [Integer] Hash code
103
93
  def hash
104
- [data, meta].hash
94
+ [expires_at].hash
105
95
  end
106
96
 
107
97
  # Builds the object from hash
@@ -13,15 +13,12 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class InlineResponse2009
16
- attr_accessor :data
17
-
18
- attr_accessor :meta
16
+ attr_accessor :results
19
17
 
20
18
  # Attribute mapping from ruby-style variable name to JSON key.
21
19
  def self.attribute_map
22
20
  {
23
- :'data' => :'data',
24
- :'meta' => :'meta'
21
+ :'results' => :'results'
25
22
  }
26
23
  end
27
24
 
@@ -33,8 +30,7 @@ module Fastly
33
30
  # Attribute type mapping.
34
31
  def self.fastly_types
35
32
  {
36
- :'data' => :'Array<SecretResponse>',
37
- :'meta' => :'PaginationCursorMeta'
33
+ :'results' => :'Array<Suggestion>'
38
34
  }
39
35
  end
40
36
 
@@ -59,15 +55,11 @@ module Fastly
59
55
  h[k.to_sym] = v
60
56
  }
61
57
 
62
- if attributes.key?(:'data')
63
- if (value = attributes[:'data']).is_a?(Array)
64
- self.data = value
58
+ if attributes.key?(:'results')
59
+ if (value = attributes[:'results']).is_a?(Array)
60
+ self.results = value
65
61
  end
66
62
  end
67
-
68
- if attributes.key?(:'meta')
69
- self.meta = attributes[:'meta']
70
- end
71
63
  end
72
64
 
73
65
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -88,8 +80,7 @@ module Fastly
88
80
  def ==(o)
89
81
  return true if self.equal?(o)
90
82
  self.class == o.class &&
91
- data == o.data &&
92
- meta == o.meta
83
+ results == o.results
93
84
  end
94
85
 
95
86
  # @see the `==` method
@@ -101,7 +92,7 @@ module Fastly
101
92
  # Calculates hash code according to all attributes.
102
93
  # @return [Integer] Hash code
103
94
  def hash
104
- [data, meta].hash
95
+ [results].hash
105
96
  end
106
97
 
107
98
  # Builds the object from hash
@@ -19,11 +19,19 @@ module Fastly
19
19
  # Name of the store.
20
20
  attr_accessor :name
21
21
 
22
+ # Timestamp at which the store was created.
23
+ attr_accessor :created_at
24
+
25
+ # Timestamp at which the store was last updated.
26
+ attr_accessor :updated_at
27
+
22
28
  # Attribute mapping from ruby-style variable name to JSON key.
23
29
  def self.attribute_map
24
30
  {
25
31
  :'id' => :'id',
26
- :'name' => :'name'
32
+ :'name' => :'name',
33
+ :'created_at' => :'created_at',
34
+ :'updated_at' => :'updated_at'
27
35
  }
28
36
  end
29
37
 
@@ -36,7 +44,9 @@ module Fastly
36
44
  def self.fastly_types
37
45
  {
38
46
  :'id' => :'String',
39
- :'name' => :'String'
47
+ :'name' => :'String',
48
+ :'created_at' => :'String',
49
+ :'updated_at' => :'String'
40
50
  }
41
51
  end
42
52
 
@@ -68,6 +78,14 @@ module Fastly
68
78
  if attributes.key?(:'name')
69
79
  self.name = attributes[:'name']
70
80
  end
81
+
82
+ if attributes.key?(:'created_at')
83
+ self.created_at = attributes[:'created_at']
84
+ end
85
+
86
+ if attributes.key?(:'updated_at')
87
+ self.updated_at = attributes[:'updated_at']
88
+ end
71
89
  end
72
90
 
73
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -89,7 +107,9 @@ module Fastly
89
107
  return true if self.equal?(o)
90
108
  self.class == o.class &&
91
109
  id == o.id &&
92
- name == o.name
110
+ name == o.name &&
111
+ created_at == o.created_at &&
112
+ updated_at == o.updated_at
93
113
  end
94
114
 
95
115
  # @see the `==` method
@@ -101,7 +121,7 @@ module Fastly
101
121
  # Calculates hash code according to all attributes.
102
122
  # @return [Integer] Hash code
103
123
  def hash
104
- [id, name].hash
124
+ [id, name, created_at, updated_at].hash
105
125
  end
106
126
 
107
127
  # Builds the object from hash
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class KvStoreRequestCreate
15
+ class KvStoreRequestCreateOrUpdate
16
16
  # A human-readable name for the store. Refer to https://docs.fastly.com/products/compute-resource-limits#kv-store for limitations on the KV store name.
17
17
  attr_accessor :name
18
18
 
@@ -45,13 +45,13 @@ 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::KvStoreRequestCreate` initialize method"
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::KvStoreRequestCreateOrUpdate` 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::KvStoreRequestCreate`. 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::KvStoreRequestCreateOrUpdate`. 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
  }
@@ -38,7 +38,7 @@ module Fastly
38
38
  {
39
39
  :'dimensions' => :'LogInsightsDimensions',
40
40
  :'dimension_attributes' => :'LogInsightsDimensionAttributes',
41
- :'values' => :'LogInsightsValues'
41
+ :'values' => :'Array<LogInsightsValues>'
42
42
  }
43
43
  end
44
44
 
@@ -72,7 +72,9 @@ module Fastly
72
72
  end
73
73
 
74
74
  if attributes.key?(:'values')
75
- self.values = attributes[:'values']
75
+ if (value = attributes[:'values']).is_a?(Array)
76
+ self.values = value
77
+ end
76
78
  end
77
79
  end
78
80
 
@@ -0,0 +1,266 @@
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
+ # Metadata about the request.
16
+ class Meta
17
+ # The `limit` value used when making the request.
18
+ attr_accessor :limit
19
+
20
+ # The count of requests matching the filter.
21
+ attr_accessor :total
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'limit' => :'limit',
27
+ :'total' => :'total'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.fastly_types
38
+ {
39
+ :'limit' => :'Integer',
40
+ :'total' => :'Integer'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.fastly_nullable
46
+ Set.new([
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::Meta` 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::Meta`. 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?(:'limit')
66
+ self.limit = attributes[:'limit']
67
+ end
68
+
69
+ if attributes.key?(:'total')
70
+ self.total = attributes[:'total']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if @limit.nil?
79
+ invalid_properties.push('invalid value for "limit", limit cannot be nil.')
80
+ end
81
+
82
+ if @limit > 100
83
+ invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.')
84
+ end
85
+
86
+ if @limit < 1
87
+ invalid_properties.push('invalid value for "limit", must be greater than or equal to 1.')
88
+ end
89
+
90
+ if @total.nil?
91
+ invalid_properties.push('invalid value for "total", total cannot be nil.')
92
+ end
93
+
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ return false if @limit.nil?
101
+ return false if @limit > 100
102
+ return false if @limit < 1
103
+ return false if @total.nil?
104
+ true
105
+ end
106
+
107
+ # Custom attribute writer method with validation
108
+ # @param [Object] limit Value to be assigned
109
+ def limit=(limit)
110
+ if limit.nil?
111
+ fail ArgumentError, 'limit cannot be nil'
112
+ end
113
+
114
+ if limit > 100
115
+ fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
116
+ end
117
+
118
+ if limit < 1
119
+ fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
120
+ end
121
+
122
+ @limit = limit
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ limit == o.limit &&
131
+ total == o.total
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [limit, total].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ new.build_from_hash(attributes)
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ self.class.fastly_types.each_pair do |key, type|
159
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
160
+ self.send("#{key}=", nil)
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
165
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
169
+ end
170
+ end
171
+
172
+ self
173
+ end
174
+
175
+ # Deserializes the data based on type
176
+ # @param string type Data type
177
+ # @param string value Value to be deserialized
178
+ # @return [Object] Deserialized data
179
+ def _deserialize(type, value)
180
+ case type.to_sym
181
+ when :Time
182
+ Time.parse(value)
183
+ when :Date
184
+ Date.parse(value)
185
+ when :String
186
+ value.to_s
187
+ when :Integer
188
+ value.to_i
189
+ when :Float
190
+ value.to_f
191
+ when :Boolean
192
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
193
+ true
194
+ else
195
+ false
196
+ end
197
+ when :Object
198
+ # generic object (usually a Hash), return directly
199
+ value
200
+ when /\AArray<(?<inner_type>.+)>\z/
201
+ inner_type = Regexp.last_match[:inner_type]
202
+ value.map { |v| _deserialize(inner_type, v) }
203
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
204
+ k_type = Regexp.last_match[:k_type]
205
+ v_type = Regexp.last_match[:v_type]
206
+ {}.tap do |hash|
207
+ value.each do |k, v|
208
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
209
+ end
210
+ end
211
+ else # model
212
+ # models (e.g. Pet) or oneOf
213
+ klass = Fastly.const_get(type)
214
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.fastly_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+
266
+ end
@@ -16,10 +16,14 @@ module Fastly
16
16
  # The workspace to link.
17
17
  attr_accessor :workspace_id
18
18
 
19
+ # The percentage of traffic to inspect.
20
+ attr_accessor :traffic_ramp
21
+
19
22
  # Attribute mapping from ruby-style variable name to JSON key.
20
23
  def self.attribute_map
21
24
  {
22
- :'workspace_id' => :'workspace_id'
25
+ :'workspace_id' => :'workspace_id',
26
+ :'traffic_ramp' => :'traffic_ramp'
23
27
  }
24
28
  end
25
29
 
@@ -31,7 +35,8 @@ module Fastly
31
35
  # Attribute type mapping.
32
36
  def self.fastly_types
33
37
  {
34
- :'workspace_id' => :'String'
38
+ :'workspace_id' => :'String',
39
+ :'traffic_ramp' => :'String'
35
40
  }
36
41
  end
37
42
 
@@ -59,6 +64,10 @@ module Fastly
59
64
  if attributes.key?(:'workspace_id')
60
65
  self.workspace_id = attributes[:'workspace_id']
61
66
  end
67
+
68
+ if attributes.key?(:'traffic_ramp')
69
+ self.traffic_ramp = attributes[:'traffic_ramp']
70
+ end
62
71
  end
63
72
 
64
73
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -84,7 +93,8 @@ module Fastly
84
93
  def ==(o)
85
94
  return true if self.equal?(o)
86
95
  self.class == o.class &&
87
- workspace_id == o.workspace_id
96
+ workspace_id == o.workspace_id &&
97
+ traffic_ramp == o.traffic_ramp
88
98
  end
89
99
 
90
100
  # @see the `==` method
@@ -96,7 +106,7 @@ module Fastly
96
106
  # Calculates hash code according to all attributes.
97
107
  # @return [Integer] Hash code
98
108
  def hash
99
- [workspace_id].hash
109
+ [workspace_id, traffic_ramp].hash
100
110
  end
101
111
 
102
112
  # Builds the object from hash