fastly 4.3.0 → 4.4.0

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