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
@@ -22,13 +22,16 @@ module Fastly
22
22
 
23
23
  attr_accessor :region
24
24
 
25
+ attr_accessor :datacenter
26
+
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
26
28
  def self.attribute_map
27
29
  {
28
30
  :'to' => :'to',
29
31
  :'from' => :'from',
30
32
  :'by' => :'by',
31
- :'region' => :'region'
33
+ :'region' => :'region',
34
+ :'datacenter' => :'datacenter'
32
35
  }
33
36
  end
34
37
 
@@ -43,7 +46,8 @@ module Fastly
43
46
  :'to' => :'String',
44
47
  :'from' => :'String',
45
48
  :'by' => :'String',
46
- :'region' => :'String'
49
+ :'region' => :'String',
50
+ :'datacenter' => :'String'
47
51
  }
48
52
  end
49
53
 
@@ -83,6 +87,10 @@ module Fastly
83
87
  if attributes.key?(:'region')
84
88
  self.region = attributes[:'region']
85
89
  end
90
+
91
+ if attributes.key?(:'datacenter')
92
+ self.datacenter = attributes[:'datacenter']
93
+ end
86
94
  end
87
95
 
88
96
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -106,7 +114,8 @@ module Fastly
106
114
  to == o.to &&
107
115
  from == o.from &&
108
116
  by == o.by &&
109
- region == o.region
117
+ region == o.region &&
118
+ datacenter == o.datacenter
110
119
  end
111
120
 
112
121
  # @see the `==` method
@@ -118,7 +127,7 @@ module Fastly
118
127
  # Calculates hash code according to all attributes.
119
128
  # @return [Integer] Hash code
120
129
  def hash
121
- [to, from, by, region].hash
130
+ [to, from, by, region, datacenter].hash
122
131
  end
123
132
 
124
133
  # Builds the object from hash
@@ -18,6 +18,8 @@ module Fastly
18
18
 
19
19
  attr_accessor :name
20
20
 
21
+ attr_accessor :display_name
22
+
21
23
  attr_accessor :description
22
24
 
23
25
  # The set of permissions granted to this role.
@@ -28,6 +30,7 @@ module Fastly
28
30
  {
29
31
  :'id' => :'id',
30
32
  :'name' => :'name',
33
+ :'display_name' => :'display_name',
31
34
  :'description' => :'description',
32
35
  :'permissions' => :'permissions'
33
36
  }
@@ -43,6 +46,7 @@ module Fastly
43
46
  {
44
47
  :'id' => :'String',
45
48
  :'name' => :'String',
49
+ :'display_name' => :'String',
46
50
  :'description' => :'String',
47
51
  :'permissions' => :'Array<String>'
48
52
  }
@@ -77,6 +81,10 @@ module Fastly
77
81
  self.name = attributes[:'name']
78
82
  end
79
83
 
84
+ if attributes.key?(:'display_name')
85
+ self.display_name = attributes[:'display_name']
86
+ end
87
+
80
88
  if attributes.key?(:'description')
81
89
  self.description = attributes[:'description']
82
90
  end
@@ -108,6 +116,7 @@ module Fastly
108
116
  self.class == o.class &&
109
117
  id == o.id &&
110
118
  name == o.name &&
119
+ display_name == o.display_name &&
111
120
  description == o.description &&
112
121
  permissions == o.permissions
113
122
  end
@@ -121,7 +130,7 @@ module Fastly
121
130
  # Calculates hash code according to all attributes.
122
131
  # @return [Integer] Hash code
123
132
  def hash
124
- [id, name, description, permissions].hash
133
+ [id, name, display_name, description, permissions].hash
125
134
  end
126
135
 
127
136
  # Builds the object from hash
@@ -13,12 +13,15 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class InlineResponse2001
16
- # The service IDs of the services the token will have access to. Separate service IDs with a space.
16
+ attr_accessor :meta
17
+
18
+ # The discovered operations returned by the request.
17
19
  attr_accessor :data
18
20
 
19
21
  # Attribute mapping from ruby-style variable name to JSON key.
20
22
  def self.attribute_map
21
23
  {
24
+ :'meta' => :'meta',
22
25
  :'data' => :'data'
23
26
  }
24
27
  end
@@ -31,7 +34,8 @@ module Fastly
31
34
  # Attribute type mapping.
32
35
  def self.fastly_types
33
36
  {
34
- :'data' => :'Array<String>'
37
+ :'meta' => :'Meta',
38
+ :'data' => :'Array<DiscoveredOperationGet>'
35
39
  }
36
40
  end
37
41
 
@@ -56,6 +60,10 @@ module Fastly
56
60
  h[k.to_sym] = v
57
61
  }
58
62
 
63
+ if attributes.key?(:'meta')
64
+ self.meta = attributes[:'meta']
65
+ end
66
+
59
67
  if attributes.key?(:'data')
60
68
  if (value = attributes[:'data']).is_a?(Array)
61
69
  self.data = value
@@ -81,6 +89,7 @@ module Fastly
81
89
  def ==(o)
82
90
  return true if self.equal?(o)
83
91
  self.class == o.class &&
92
+ meta == o.meta &&
84
93
  data == o.data
85
94
  end
86
95
 
@@ -93,7 +102,7 @@ module Fastly
93
102
  # Calculates hash code according to all attributes.
94
103
  # @return [Integer] Hash code
95
104
  def hash
96
- [data].hash
105
+ [meta, data].hash
97
106
  end
98
107
 
99
108
  # Builds the object from hash
@@ -15,10 +15,13 @@ module Fastly
15
15
  class InlineResponse20010
16
16
  attr_accessor :data
17
17
 
18
+ attr_accessor :meta
19
+
18
20
  # Attribute mapping from ruby-style variable name to JSON key.
19
21
  def self.attribute_map
20
22
  {
21
- :'data' => :'data'
23
+ :'data' => :'data',
24
+ :'meta' => :'meta'
22
25
  }
23
26
  end
24
27
 
@@ -30,7 +33,8 @@ module Fastly
30
33
  # Attribute type mapping.
31
34
  def self.fastly_types
32
35
  {
33
- :'data' => :'Array<ServiceAuthorizationResponseData>'
36
+ :'data' => :'Array<KvStoreDetails>',
37
+ :'meta' => :'PaginationCursorMeta'
34
38
  }
35
39
  end
36
40
 
@@ -60,6 +64,10 @@ module Fastly
60
64
  self.data = value
61
65
  end
62
66
  end
67
+
68
+ if attributes.key?(:'meta')
69
+ self.meta = attributes[:'meta']
70
+ end
63
71
  end
64
72
 
65
73
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -80,7 +88,8 @@ module Fastly
80
88
  def ==(o)
81
89
  return true if self.equal?(o)
82
90
  self.class == o.class &&
83
- data == o.data
91
+ data == o.data &&
92
+ meta == o.meta
84
93
  end
85
94
 
86
95
  # @see the `==` method
@@ -92,7 +101,7 @@ module Fastly
92
101
  # Calculates hash code according to all attributes.
93
102
  # @return [Integer] Hash code
94
103
  def hash
95
- [data].hash
104
+ [data, meta].hash
96
105
  end
97
106
 
98
107
  # Builds the object from hash
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module Fastly
15
+ class InlineResponse20011
16
+ attr_accessor :data
17
+
18
+ attr_accessor :meta
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data',
24
+ :'meta' => :'meta'
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
+ :'data' => :'Array<String>',
37
+ :'meta' => :'PaginationCursorMeta'
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::InlineResponse20011` 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::InlineResponse20011`. 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?(:'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']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ data == o.data &&
92
+ meta == o.meta
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [data, meta].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.fastly_types.each_pair do |key, type|
120
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = Fastly.const_get(type)
175
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.fastly_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module Fastly
15
+ class InlineResponse20012
16
+ attr_accessor :data
17
+
18
+ attr_accessor :meta
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data',
24
+ :'meta' => :'meta'
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
+ :'data' => :'Array<SecretStoreResponse>',
37
+ :'meta' => :'PaginationCursorMeta'
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::InlineResponse20012` 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::InlineResponse20012`. 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?(:'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']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ data == o.data &&
92
+ meta == o.meta
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [data, meta].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.fastly_types.each_pair do |key, type|
120
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = Fastly.const_get(type)
175
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.fastly_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end