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,314 +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 TlsCsrDataAttributes
16
- # Subject Altername Names - An array of one or more fully qualified domain names or public IP addresses to be secured by this certificate. Required.
17
- attr_accessor :sans
18
-
19
- # Common Name (CN) - The fully qualified domain name (FQDN) to be secured by this certificate. The common name should be one of the entries in the SANs parameter.
20
- attr_accessor :common_name
21
-
22
- # Country (C) - The two-letter ISO country code where the organization is located.
23
- attr_accessor :country
24
-
25
- # State (S) - The state, province, region, or county where the organization is located. This should not be abbreviated.
26
- attr_accessor :state
27
-
28
- # Locality (L) - The locality, city, town, or village where the organization is located.
29
- attr_accessor :city
30
-
31
- # Postal Code - The postal code where the organization is located.
32
- attr_accessor :postal_code
33
-
34
- # Street Address - The street address where the organization is located.
35
- attr_accessor :street_address
36
-
37
- # Organization (O) - The legal name of the organization, including any suffixes. This should not be abbreviated.
38
- attr_accessor :organization
39
-
40
- # Organizational Unit (OU) - The internal division of the organization managing the certificate.
41
- attr_accessor :organizational_unit
42
-
43
- # Email Address (EMAIL) - The organizational contact for this.
44
- attr_accessor :email
45
-
46
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'sans' => :'sans',
50
- :'common_name' => :'common_name',
51
- :'country' => :'country',
52
- :'state' => :'state',
53
- :'city' => :'city',
54
- :'postal_code' => :'postal_code',
55
- :'street_address' => :'street_address',
56
- :'organization' => :'organization',
57
- :'organizational_unit' => :'organizational_unit',
58
- :'email' => :'email'
59
- }
60
- end
61
-
62
- # Returns all the JSON keys this model knows about
63
- def self.acceptable_attributes
64
- attribute_map.values
65
- end
66
-
67
- # Attribute type mapping.
68
- def self.fastly_types
69
- {
70
- :'sans' => :'Array<String>',
71
- :'common_name' => :'String',
72
- :'country' => :'String',
73
- :'state' => :'String',
74
- :'city' => :'String',
75
- :'postal_code' => :'String',
76
- :'street_address' => :'String',
77
- :'organization' => :'String',
78
- :'organizational_unit' => :'String',
79
- :'email' => :'String'
80
- }
81
- end
82
-
83
- # List of attributes with nullable: true
84
- def self.fastly_nullable
85
- Set.new([
86
- ])
87
- end
88
-
89
- # Initializes the object
90
- # @param [Hash] attributes Model attributes in the form of hash
91
- def initialize(attributes = {})
92
- if (!attributes.is_a?(Hash))
93
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::TlsCsrDataAttributes` initialize method"
94
- end
95
-
96
- # check to see if the attribute exists and convert string to symbol for hash key
97
- attributes = attributes.each_with_object({}) { |(k, v), h|
98
- if (!self.class.attribute_map.key?(k.to_sym))
99
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::TlsCsrDataAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
- end
101
- h[k.to_sym] = v
102
- }
103
-
104
- if attributes.key?(:'sans')
105
- if (value = attributes[:'sans']).is_a?(Array)
106
- self.sans = value
107
- end
108
- end
109
-
110
- if attributes.key?(:'common_name')
111
- self.common_name = attributes[:'common_name']
112
- end
113
-
114
- if attributes.key?(:'country')
115
- self.country = attributes[:'country']
116
- end
117
-
118
- if attributes.key?(:'state')
119
- self.state = attributes[:'state']
120
- end
121
-
122
- if attributes.key?(:'city')
123
- self.city = attributes[:'city']
124
- end
125
-
126
- if attributes.key?(:'postal_code')
127
- self.postal_code = attributes[:'postal_code']
128
- end
129
-
130
- if attributes.key?(:'street_address')
131
- self.street_address = attributes[:'street_address']
132
- end
133
-
134
- if attributes.key?(:'organization')
135
- self.organization = attributes[:'organization']
136
- end
137
-
138
- if attributes.key?(:'organizational_unit')
139
- self.organizational_unit = attributes[:'organizational_unit']
140
- end
141
-
142
- if attributes.key?(:'email')
143
- self.email = attributes[:'email']
144
- end
145
- end
146
-
147
- # Show invalid properties with the reasons. Usually used together with valid?
148
- # @return Array for valid properties with the reasons
149
- def list_invalid_properties
150
- invalid_properties = Array.new
151
- if @sans.nil?
152
- invalid_properties.push('invalid value for "sans", sans cannot be nil.')
153
- end
154
-
155
- invalid_properties
156
- end
157
-
158
- # Check to see if the all the properties in the model are valid
159
- # @return true if the model is valid
160
- def valid?
161
- return false if @sans.nil?
162
- true
163
- end
164
-
165
- # Checks equality by comparing each attribute.
166
- # @param [Object] Object to be compared
167
- def ==(o)
168
- return true if self.equal?(o)
169
- self.class == o.class &&
170
- sans == o.sans &&
171
- common_name == o.common_name &&
172
- country == o.country &&
173
- state == o.state &&
174
- city == o.city &&
175
- postal_code == o.postal_code &&
176
- street_address == o.street_address &&
177
- organization == o.organization &&
178
- organizational_unit == o.organizational_unit &&
179
- email == o.email
180
- end
181
-
182
- # @see the `==` method
183
- # @param [Object] Object to be compared
184
- def eql?(o)
185
- self == o
186
- end
187
-
188
- # Calculates hash code according to all attributes.
189
- # @return [Integer] Hash code
190
- def hash
191
- [sans, common_name, country, state, city, postal_code, street_address, organization, organizational_unit, email].hash
192
- end
193
-
194
- # Builds the object from hash
195
- # @param [Hash] attributes Model attributes in the form of hash
196
- # @return [Object] Returns the model itself
197
- def self.build_from_hash(attributes)
198
- new.build_from_hash(attributes)
199
- end
200
-
201
- # Builds the object from hash
202
- # @param [Hash] attributes Model attributes in the form of hash
203
- # @return [Object] Returns the model itself
204
- def build_from_hash(attributes)
205
- return nil unless attributes.is_a?(Hash)
206
- self.class.fastly_types.each_pair do |key, type|
207
- if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
208
- self.send("#{key}=", nil)
209
- elsif type =~ /\AArray<(.*)>/i
210
- # check to ensure the input is an array given that the attribute
211
- # is documented as an array but the input is not
212
- if attributes[self.class.attribute_map[key]].is_a?(Array)
213
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
214
- end
215
- elsif !attributes[self.class.attribute_map[key]].nil?
216
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
217
- end
218
- end
219
-
220
- self
221
- end
222
-
223
- # Deserializes the data based on type
224
- # @param string type Data type
225
- # @param string value Value to be deserialized
226
- # @return [Object] Deserialized data
227
- def _deserialize(type, value)
228
- case type.to_sym
229
- when :Time
230
- Time.parse(value)
231
- when :Date
232
- Date.parse(value)
233
- when :String
234
- value.to_s
235
- when :Integer
236
- value.to_i
237
- when :Float
238
- value.to_f
239
- when :Boolean
240
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
241
- true
242
- else
243
- false
244
- end
245
- when :Object
246
- # generic object (usually a Hash), return directly
247
- value
248
- when /\AArray<(?<inner_type>.+)>\z/
249
- inner_type = Regexp.last_match[:inner_type]
250
- value.map { |v| _deserialize(inner_type, v) }
251
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
252
- k_type = Regexp.last_match[:k_type]
253
- v_type = Regexp.last_match[:v_type]
254
- {}.tap do |hash|
255
- value.each do |k, v|
256
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
- end
258
- end
259
- else # model
260
- # models (e.g. Pet) or oneOf
261
- klass = Fastly.const_get(type)
262
- klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
263
- end
264
- end
265
-
266
- # Returns the string representation of the object
267
- # @return [String] String presentation of the object
268
- def to_s
269
- to_hash.to_s
270
- end
271
-
272
- # to_body is an alias to to_hash (backward compatibility)
273
- # @return [Hash] Returns the object in the form of hash
274
- def to_body
275
- to_hash
276
- end
277
-
278
- # Returns the object in the form of hash
279
- # @return [Hash] Returns the object in the form of hash
280
- def to_hash
281
- hash = {}
282
- self.class.attribute_map.each_pair do |attr, param|
283
- value = self.send(attr)
284
- if value.nil?
285
- is_nullable = self.class.fastly_nullable.include?(attr)
286
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
287
- end
288
-
289
- hash[param] = _to_hash(value)
290
- end
291
- hash
292
- end
293
-
294
- # Outputs non-array value in the form of hash
295
- # For object, use to_hash. Otherwise, just return the value
296
- # @param [Object] value Any valid value
297
- # @return [Hash] Returns the value in the form of hash
298
- def _to_hash(value)
299
- if value.is_a?(Array)
300
- value.compact.map { |v| _to_hash(v) }
301
- elsif value.is_a?(Hash)
302
- {}.tap do |hash|
303
- value.each { |k, v| hash[k] = _to_hash(v) }
304
- end
305
- elsif value.respond_to? :to_hash
306
- value.to_hash
307
- else
308
- value
309
- end
310
- end
311
-
312
- end
313
-
314
- end
@@ -1,216 +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 TlsCsrResponse
16
- attr_accessor :data
17
-
18
- # Attribute mapping from ruby-style variable name to JSON key.
19
- def self.attribute_map
20
- {
21
- :'data' => :'data'
22
- }
23
- end
24
-
25
- # Returns all the JSON keys this model knows about
26
- def self.acceptable_attributes
27
- attribute_map.values
28
- end
29
-
30
- # Attribute type mapping.
31
- def self.fastly_types
32
- {
33
- :'data' => :'TlsCsrResponseData'
34
- }
35
- end
36
-
37
- # List of attributes with nullable: true
38
- def self.fastly_nullable
39
- Set.new([
40
- ])
41
- end
42
-
43
- # Initializes the object
44
- # @param [Hash] attributes Model attributes in the form of hash
45
- def initialize(attributes = {})
46
- if (!attributes.is_a?(Hash))
47
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::TlsCsrResponse` initialize method"
48
- end
49
-
50
- # check to see if the attribute exists and convert string to symbol for hash key
51
- attributes = attributes.each_with_object({}) { |(k, v), h|
52
- if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::TlsCsrResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
- end
55
- h[k.to_sym] = v
56
- }
57
-
58
- if attributes.key?(:'data')
59
- self.data = attributes[:'data']
60
- end
61
- end
62
-
63
- # Show invalid properties with the reasons. Usually used together with valid?
64
- # @return Array for valid properties with the reasons
65
- def list_invalid_properties
66
- invalid_properties = Array.new
67
- invalid_properties
68
- end
69
-
70
- # Check to see if the all the properties in the model are valid
71
- # @return true if the model is valid
72
- def valid?
73
- true
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(o)
79
- return true if self.equal?(o)
80
- self.class == o.class &&
81
- data == o.data
82
- end
83
-
84
- # @see the `==` method
85
- # @param [Object] Object to be compared
86
- def eql?(o)
87
- self == o
88
- end
89
-
90
- # Calculates hash code according to all attributes.
91
- # @return [Integer] Hash code
92
- def hash
93
- [data].hash
94
- end
95
-
96
- # Builds the object from hash
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- # @return [Object] Returns the model itself
99
- def self.build_from_hash(attributes)
100
- new.build_from_hash(attributes)
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- self.class.fastly_types.each_pair do |key, type|
109
- if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
110
- self.send("#{key}=", nil)
111
- elsif type =~ /\AArray<(.*)>/i
112
- # check to ensure the input is an array given that the attribute
113
- # is documented as an array but the input is not
114
- if attributes[self.class.attribute_map[key]].is_a?(Array)
115
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
- end
117
- elsif !attributes[self.class.attribute_map[key]].nil?
118
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
- end
120
- end
121
-
122
- self
123
- end
124
-
125
- # Deserializes the data based on type
126
- # @param string type Data type
127
- # @param string value Value to be deserialized
128
- # @return [Object] Deserialized data
129
- def _deserialize(type, value)
130
- case type.to_sym
131
- when :Time
132
- Time.parse(value)
133
- when :Date
134
- Date.parse(value)
135
- when :String
136
- value.to_s
137
- when :Integer
138
- value.to_i
139
- when :Float
140
- value.to_f
141
- when :Boolean
142
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
- true
144
- else
145
- false
146
- end
147
- when :Object
148
- # generic object (usually a Hash), return directly
149
- value
150
- when /\AArray<(?<inner_type>.+)>\z/
151
- inner_type = Regexp.last_match[:inner_type]
152
- value.map { |v| _deserialize(inner_type, v) }
153
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
- k_type = Regexp.last_match[:k_type]
155
- v_type = Regexp.last_match[:v_type]
156
- {}.tap do |hash|
157
- value.each do |k, v|
158
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
- end
160
- end
161
- else # model
162
- # models (e.g. Pet) or oneOf
163
- klass = Fastly.const_get(type)
164
- klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
- end
166
- end
167
-
168
- # Returns the string representation of the object
169
- # @return [String] String presentation of the object
170
- def to_s
171
- to_hash.to_s
172
- end
173
-
174
- # to_body is an alias to to_hash (backward compatibility)
175
- # @return [Hash] Returns the object in the form of hash
176
- def to_body
177
- to_hash
178
- end
179
-
180
- # Returns the object in the form of hash
181
- # @return [Hash] Returns the object in the form of hash
182
- def to_hash
183
- hash = {}
184
- self.class.attribute_map.each_pair do |attr, param|
185
- value = self.send(attr)
186
- if value.nil?
187
- is_nullable = self.class.fastly_nullable.include?(attr)
188
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
- end
190
-
191
- hash[param] = _to_hash(value)
192
- end
193
- hash
194
- end
195
-
196
- # Outputs non-array value in the form of hash
197
- # For object, use to_hash. Otherwise, just return the value
198
- # @param [Object] value Any valid value
199
- # @return [Hash] Returns the value in the form of hash
200
- def _to_hash(value)
201
- if value.is_a?(Array)
202
- value.compact.map { |v| _to_hash(v) }
203
- elsif value.is_a?(Hash)
204
- {}.tap do |hash|
205
- value.each { |k, v| hash[k] = _to_hash(v) }
206
- end
207
- elsif value.respond_to? :to_hash
208
- value.to_hash
209
- else
210
- value
211
- end
212
- end
213
-
214
- end
215
-
216
- end