openapi_azureipranges 0.10.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.
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Azure IP Ranges and Service Tags - Public Cloud
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.10.0
7
+ Contact: blah+oapicf@cliffano.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OpenApiAzureIpRangesClient
17
+ class Value
18
+ # The name of the value.
19
+ attr_accessor :name
20
+
21
+ # The unique identifier of the value.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :properties
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'name' => :'name',
30
+ :'id' => :'id',
31
+ :'properties' => :'properties'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'name' => :'String',
44
+ :'id' => :'String',
45
+ :'properties' => :'ValueProperties'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_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 `OpenApiAzureIpRangesClient::Value` 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 `OpenApiAzureIpRangesClient::Value`. 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?(:'name')
71
+ self.name = attributes[:'name']
72
+ end
73
+
74
+ if attributes.key?(:'id')
75
+ self.id = attributes[:'id']
76
+ end
77
+
78
+ if attributes.key?(:'properties')
79
+ self.properties = attributes[:'properties']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ warn '[DEPRECATED] the `valid?` method is obsolete'
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ name == o.name &&
104
+ id == o.id &&
105
+ properties == o.properties
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [name, id, properties].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ transformed_hash = {}
127
+ openapi_types.each_pair do |key, type|
128
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = nil
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[attribute_map[key]].is_a?(Array)
134
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
135
+ end
136
+ elsif !attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
138
+ end
139
+ end
140
+ new(transformed_hash)
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def self._deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = OpenApiAzureIpRangesClient.const_get(type)
182
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,279 @@
1
+ =begin
2
+ #Azure IP Ranges and Service Tags - Public Cloud
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.10.0
7
+ Contact: blah+oapicf@cliffano.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OpenApiAzureIpRangesClient
17
+ class ValueProperties
18
+ # The number associated with the change.
19
+ attr_accessor :change_number
20
+
21
+ # The region associated with the value.
22
+ attr_accessor :region
23
+
24
+ # The ID of the region.
25
+ attr_accessor :region_id
26
+
27
+ # The platform associated with the value.
28
+ attr_accessor :platform
29
+
30
+ # The system service associated with the value.
31
+ attr_accessor :system_service
32
+
33
+ # The address prefixes associated with the value.
34
+ attr_accessor :address_prefixes
35
+
36
+ # The network features associated with the value.
37
+ attr_accessor :network_features
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'change_number' => :'changeNumber',
43
+ :'region' => :'region',
44
+ :'region_id' => :'regionId',
45
+ :'platform' => :'platform',
46
+ :'system_service' => :'systemService',
47
+ :'address_prefixes' => :'addressPrefixes',
48
+ :'network_features' => :'networkFeatures'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'change_number' => :'Integer',
61
+ :'region' => :'String',
62
+ :'region_id' => :'Integer',
63
+ :'platform' => :'String',
64
+ :'system_service' => :'String',
65
+ :'address_prefixes' => :'Array<String>',
66
+ :'network_features' => :'Array<String>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenApiAzureIpRangesClient::ValueProperties` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenApiAzureIpRangesClient::ValueProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'change_number')
92
+ self.change_number = attributes[:'change_number']
93
+ end
94
+
95
+ if attributes.key?(:'region')
96
+ self.region = attributes[:'region']
97
+ end
98
+
99
+ if attributes.key?(:'region_id')
100
+ self.region_id = attributes[:'region_id']
101
+ end
102
+
103
+ if attributes.key?(:'platform')
104
+ self.platform = attributes[:'platform']
105
+ end
106
+
107
+ if attributes.key?(:'system_service')
108
+ self.system_service = attributes[:'system_service']
109
+ end
110
+
111
+ if attributes.key?(:'address_prefixes')
112
+ if (value = attributes[:'address_prefixes']).is_a?(Array)
113
+ self.address_prefixes = value
114
+ end
115
+ end
116
+
117
+ if attributes.key?(:'network_features')
118
+ if (value = attributes[:'network_features']).is_a?(Array)
119
+ self.network_features = value
120
+ end
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ change_number == o.change_number &&
145
+ region == o.region &&
146
+ region_id == o.region_id &&
147
+ platform == o.platform &&
148
+ system_service == o.system_service &&
149
+ address_prefixes == o.address_prefixes &&
150
+ network_features == o.network_features
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [change_number, region, region_id, platform, system_service, address_prefixes, network_features].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Deserializes the data based on type
189
+ # @param string type Data type
190
+ # @param string value Value to be deserialized
191
+ # @return [Object] Deserialized data
192
+ def self._deserialize(type, value)
193
+ case type.to_sym
194
+ when :Time
195
+ Time.parse(value)
196
+ when :Date
197
+ Date.parse(value)
198
+ when :String
199
+ value.to_s
200
+ when :Integer
201
+ value.to_i
202
+ when :Float
203
+ value.to_f
204
+ when :Boolean
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ true
207
+ else
208
+ false
209
+ end
210
+ when :Object
211
+ # generic object (usually a Hash), return directly
212
+ value
213
+ when /\AArray<(?<inner_type>.+)>\z/
214
+ inner_type = Regexp.last_match[:inner_type]
215
+ value.map { |v| _deserialize(inner_type, v) }
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ k_type = Regexp.last_match[:k_type]
218
+ v_type = Regexp.last_match[:v_type]
219
+ {}.tap do |hash|
220
+ value.each do |k, v|
221
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
222
+ end
223
+ end
224
+ else # model
225
+ # models (e.g. Pet) or oneOf
226
+ klass = OpenApiAzureIpRangesClient.const_get(type)
227
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
228
+ end
229
+ end
230
+
231
+ # Returns the string representation of the object
232
+ # @return [String] String presentation of the object
233
+ def to_s
234
+ to_hash.to_s
235
+ end
236
+
237
+ # to_body is an alias to to_hash (backward compatibility)
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_body
240
+ to_hash
241
+ end
242
+
243
+ # Returns the object in the form of hash
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_hash
246
+ hash = {}
247
+ self.class.attribute_map.each_pair do |attr, param|
248
+ value = self.send(attr)
249
+ if value.nil?
250
+ is_nullable = self.class.openapi_nullable.include?(attr)
251
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
252
+ end
253
+
254
+ hash[param] = _to_hash(value)
255
+ end
256
+ hash
257
+ end
258
+
259
+ # Outputs non-array value in the form of hash
260
+ # For object, use to_hash. Otherwise, just return the value
261
+ # @param [Object] value Any valid value
262
+ # @return [Hash] Returns the value in the form of hash
263
+ def _to_hash(value)
264
+ if value.is_a?(Array)
265
+ value.compact.map { |v| _to_hash(v) }
266
+ elsif value.is_a?(Hash)
267
+ {}.tap do |hash|
268
+ value.each { |k, v| hash[k] = _to_hash(v) }
269
+ end
270
+ elsif value.respond_to? :to_hash
271
+ value.to_hash
272
+ else
273
+ value
274
+ end
275
+ end
276
+
277
+ end
278
+
279
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #Azure IP Ranges and Service Tags - Public Cloud
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.10.0
7
+ Contact: blah+oapicf@cliffano.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ module OpenApiAzureIpRangesClient
14
+ VERSION = '0.10.0'
15
+ end
@@ -0,0 +1,43 @@
1
+ =begin
2
+ #Azure IP Ranges and Service Tags - Public Cloud
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.10.0
7
+ Contact: blah+oapicf@cliffano.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'openapi_azureipranges/api_client'
15
+ require 'openapi_azureipranges/api_error'
16
+ require 'openapi_azureipranges/version'
17
+ require 'openapi_azureipranges/configuration'
18
+
19
+ # Models
20
+ require 'openapi_azureipranges/models/change'
21
+ require 'openapi_azureipranges/models/value'
22
+ require 'openapi_azureipranges/models/value_properties'
23
+
24
+ # APIs
25
+ require 'openapi_azureipranges/api/default_api'
26
+
27
+ module OpenApiAzureIpRangesClient
28
+ class << self
29
+ # Customize default settings for the SDK using block.
30
+ # OpenApiAzureIpRangesClient.configure do |config|
31
+ # config.username = "xxx"
32
+ # config.password = "xxx"
33
+ # end
34
+ # If no block given, return the default Configuration object.
35
+ def configure
36
+ if block_given?
37
+ yield(Configuration.default)
38
+ else
39
+ Configuration.default
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,39 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #Azure IP Ranges and Service Tags - Public Cloud
5
+
6
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.10.0
9
+ Contact: blah+oapicf@cliffano.com
10
+ Generated by: https://openapi-generator.tech
11
+ Generator version: 7.9.0
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "openapi_azureipranges/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "openapi_azureipranges"
20
+ s.version = OpenApiAzureIpRangesClient::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["OpenAPI Clients Factory"]
23
+ s.email = ["blah+oapicf@cliffano.com"]
24
+ s.homepage = "https://github.com/oapicf/openapi-azureipranges"
25
+ s.summary = "Azure IP Ranges and Service Tags - Public Cloud Ruby Gem"
26
+ s.description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)"
27
+ s.license = "MIT"
28
+ s.required_ruby_version = ">= 2.0"
29
+ s.metadata = {}
30
+
31
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
32
+
33
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
+
35
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
36
+ s.test_files = `find spec/*`.split("\n")
37
+ s.executables = []
38
+ s.require_paths = ["lib"]
39
+ end
@@ -0,0 +1,47 @@
1
+ =begin
2
+ #Azure IP Ranges and Service Tags - Public Cloud
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.10.0
7
+ Contact: blah+oapicf@cliffano.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for OpenApiAzureIpRangesClient::DefaultApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'DefaultApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = OpenApiAzureIpRangesClient::DefaultApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of DefaultApi' do
30
+ it 'should create an instance of DefaultApi' do
31
+ expect(@api_instance).to be_instance_of(OpenApiAzureIpRangesClient::DefaultApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for get_azure_ip_ranges_service_tags_public_cloud
36
+ # Get Azure IP Ranges and Service Tags - Public Cloud
37
+ # Retrieve details about Azure IP Ranges and Service Tags - Public Cloud.
38
+ # @param version The version of the JSON file to be retrieved in the format YYYYMMDD, e.g. 20240506
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Change]
41
+ describe 'get_azure_ip_ranges_service_tags_public_cloud test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
44
+ end
45
+ end
46
+
47
+ end