ibm_cloud_resource_controller 1.0.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +13 -0
  3. data/.gitignore +13 -0
  4. data/.openapi-generator-ignore +23 -0
  5. data/.openapi-generator/VERSION +1 -0
  6. data/.rspec +3 -0
  7. data/.travis.yml +49 -0
  8. data/CHANGELOG.md +2 -0
  9. data/CODE_OF_CONDUCT.md +76 -0
  10. data/CONTRIBUTING.md +13 -0
  11. data/Gemfile +4 -6
  12. data/LICENSE +201 -0
  13. data/README.md +56 -120
  14. data/Rakefile +3 -7
  15. data/bin/console +14 -0
  16. data/bin/setup +8 -0
  17. data/ibm_cloud_resource_controller.gemspec +34 -37
  18. data/lib/ibm_cloud_resource_controller.rb +9 -64
  19. data/lib/ibm_cloud_resource_controller/authenticators.rb +15 -0
  20. data/lib/ibm_cloud_resource_controller/common.rb +22 -0
  21. data/lib/ibm_cloud_resource_controller/resource_controller_v2.rb +982 -0
  22. data/lib/ibm_cloud_resource_controller/resource_manager_v2.rb +303 -0
  23. data/lib/ibm_cloud_resource_controller/version.rb +1 -13
  24. metadata +59 -145
  25. data/docs/Credentials.md +0 -25
  26. data/docs/ErrorReport.md +0 -23
  27. data/docs/PlanHistoryItem.md +0 -19
  28. data/docs/Reclamation.md +0 -45
  29. data/docs/ReclamationActionsPost.md +0 -19
  30. data/docs/ReclamationsList.md +0 -17
  31. data/docs/ResourceAlias.md +0 -57
  32. data/docs/ResourceAliasPatch.md +0 -17
  33. data/docs/ResourceAliasPost.md +0 -21
  34. data/docs/ResourceAliasesApi.md +0 -302
  35. data/docs/ResourceAliasesList.md +0 -21
  36. data/docs/ResourceBinding.md +0 -57
  37. data/docs/ResourceBindingPatch.md +0 -17
  38. data/docs/ResourceBindingPost.md +0 -25
  39. data/docs/ResourceBindingPostParameters.md +0 -17
  40. data/docs/ResourceBindingsApi.md +0 -300
  41. data/docs/ResourceBindingsList.md +0 -21
  42. data/docs/ResourceInstance.md +0 -81
  43. data/docs/ResourceInstancePatch.md +0 -23
  44. data/docs/ResourceInstancePost.md +0 -29
  45. data/docs/ResourceInstancesApi.md +0 -418
  46. data/docs/ResourceInstancesList.md +0 -21
  47. data/docs/ResourceKey.md +0 -53
  48. data/docs/ResourceKeyPatch.md +0 -17
  49. data/docs/ResourceKeyPost.md +0 -23
  50. data/docs/ResourceKeysApi.md +0 -298
  51. data/docs/ResourceKeysList.md +0 -21
  52. data/docs/ResourceReclamationsApi.md +0 -128
  53. data/git_push.sh +0 -58
  54. data/lib/ibm_cloud_resource_controller/api/resource_aliases_api.rb +0 -363
  55. data/lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb +0 -360
  56. data/lib/ibm_cloud_resource_controller/api/resource_instances_api.rb +0 -493
  57. data/lib/ibm_cloud_resource_controller/api/resource_keys_api.rb +0 -357
  58. data/lib/ibm_cloud_resource_controller/api/resource_reclamations_api.rb +0 -156
  59. data/lib/ibm_cloud_resource_controller/api_client.rb +0 -388
  60. data/lib/ibm_cloud_resource_controller/api_error.rb +0 -57
  61. data/lib/ibm_cloud_resource_controller/configuration.rb +0 -248
  62. data/lib/ibm_cloud_resource_controller/models/credentials.rb +0 -250
  63. data/lib/ibm_cloud_resource_controller/models/error_report.rb +0 -240
  64. data/lib/ibm_cloud_resource_controller/models/plan_history_item.rb +0 -230
  65. data/lib/ibm_cloud_resource_controller/models/reclamation.rb +0 -352
  66. data/lib/ibm_cloud_resource_controller/models/reclamation_actions_post.rb +0 -220
  67. data/lib/ibm_cloud_resource_controller/models/reclamations_list.rb +0 -212
  68. data/lib/ibm_cloud_resource_controller/models/resource_alias.rb +0 -410
  69. data/lib/ibm_cloud_resource_controller/models/resource_alias_patch.rb +0 -236
  70. data/lib/ibm_cloud_resource_controller/models/resource_alias_post.rb +0 -266
  71. data/lib/ibm_cloud_resource_controller/models/resource_aliases_list.rb +0 -247
  72. data/lib/ibm_cloud_resource_controller/models/resource_binding.rb +0 -410
  73. data/lib/ibm_cloud_resource_controller/models/resource_binding_patch.rb +0 -236
  74. data/lib/ibm_cloud_resource_controller/models/resource_binding_post.rb +0 -278
  75. data/lib/ibm_cloud_resource_controller/models/resource_binding_post_parameters.rb +0 -210
  76. data/lib/ibm_cloud_resource_controller/models/resource_bindings_list.rb +0 -247
  77. data/lib/ibm_cloud_resource_controller/models/resource_instance.rb +0 -536
  78. data/lib/ibm_cloud_resource_controller/models/resource_instance_patch.rb +0 -259
  79. data/lib/ibm_cloud_resource_controller/models/resource_instance_post.rb +0 -317
  80. data/lib/ibm_cloud_resource_controller/models/resource_instances_list.rb +0 -247
  81. data/lib/ibm_cloud_resource_controller/models/resource_key.rb +0 -390
  82. data/lib/ibm_cloud_resource_controller/models/resource_key_patch.rb +0 -236
  83. data/lib/ibm_cloud_resource_controller/models/resource_key_post.rb +0 -251
  84. data/lib/ibm_cloud_resource_controller/models/resource_keys_list.rb +0 -247
  85. data/spec/api/resource_aliases_api_spec.rb +0 -104
  86. data/spec/api/resource_bindings_api_spec.rb +0 -103
  87. data/spec/api/resource_instances_api_spec.rb +0 -130
  88. data/spec/api/resource_keys_api_spec.rb +0 -102
  89. data/spec/api/resource_reclamations_api_spec.rb +0 -62
  90. data/spec/api_client_spec.rb +0 -226
  91. data/spec/configuration_spec.rb +0 -42
  92. data/spec/models/credentials_spec.rb +0 -65
  93. data/spec/models/error_report_spec.rb +0 -59
  94. data/spec/models/plan_history_item_spec.rb +0 -47
  95. data/spec/models/reclamation_actions_post_spec.rb +0 -47
  96. data/spec/models/reclamation_spec.rb +0 -125
  97. data/spec/models/reclamations_list_spec.rb +0 -41
  98. data/spec/models/resource_alias_patch_spec.rb +0 -41
  99. data/spec/models/resource_alias_post_spec.rb +0 -53
  100. data/spec/models/resource_alias_spec.rb +0 -143
  101. data/spec/models/resource_aliases_list_spec.rb +0 -53
  102. data/spec/models/resource_binding_patch_spec.rb +0 -41
  103. data/spec/models/resource_binding_post_parameters_spec.rb +0 -41
  104. data/spec/models/resource_binding_post_spec.rb +0 -65
  105. data/spec/models/resource_binding_spec.rb +0 -137
  106. data/spec/models/resource_bindings_list_spec.rb +0 -53
  107. data/spec/models/resource_instance_patch_spec.rb +0 -59
  108. data/spec/models/resource_instance_post_spec.rb +0 -77
  109. data/spec/models/resource_instance_spec.rb +0 -191
  110. data/spec/models/resource_instances_list_spec.rb +0 -53
  111. data/spec/models/resource_key_patch_spec.rb +0 -41
  112. data/spec/models/resource_key_post_spec.rb +0 -59
  113. data/spec/models/resource_key_spec.rb +0 -125
  114. data/spec/models/resource_keys_list_spec.rb +0 -53
  115. data/spec/spec_helper.rb +0 -111
@@ -1,236 +0,0 @@
1
- =begin
2
- #IBM Cloud Resource Controller API
3
-
4
- #Manage lifecycle of your Cloud resources using Resource Controller APIs. Resources are provisioned globally in an account scope. Supports asynchronous provisioning of resources. Enables consumption of a global resource through a Cloud Foundry space in any region.
5
-
6
- The version of the OpenAPI document: 2.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0-beta2
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module IbmCloudResourceController
16
- # Updated property values for the resource key.
17
- class ResourceKeyPatch
18
- # The new name of the key. Must be 180 characters or less and cannot include any special characters other than `(space) - . _ :`.
19
- attr_accessor :name
20
-
21
- # Attribute mapping from ruby-style variable name to JSON key.
22
- def self.attribute_map
23
- {
24
- :'name' => :'name'
25
- }
26
- end
27
-
28
- # Attribute type mapping.
29
- def self.openapi_types
30
- {
31
- :'name' => :'String'
32
- }
33
- end
34
-
35
- # List of attributes with nullable: true
36
- def self.openapi_nullable
37
- Set.new([
38
- ])
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- if (!attributes.is_a?(Hash))
45
- fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudResourceController::ResourceKeyPatch` initialize method"
46
- end
47
-
48
- # check to see if the attribute exists and convert string to symbol for hash key
49
- attributes = attributes.each_with_object({}) { |(k, v), h|
50
- if (!self.class.attribute_map.key?(k.to_sym))
51
- fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudResourceController::ResourceKeyPatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
- end
53
- h[k.to_sym] = v
54
- }
55
-
56
- if attributes.key?(:'name')
57
- self.name = attributes[:'name']
58
- end
59
- end
60
-
61
- # Show invalid properties with the reasons. Usually used together with valid?
62
- # @return Array for valid properties with the reasons
63
- def list_invalid_properties
64
- invalid_properties = Array.new
65
- if @name.nil?
66
- invalid_properties.push('invalid value for "name", name cannot be nil.')
67
- end
68
-
69
- pattern = Regexp.new(/^([^[:ascii:]]|[a-zA-Z0-9\-._: ])+$/)
70
- if @name !~ pattern
71
- invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
72
- end
73
-
74
- invalid_properties
75
- end
76
-
77
- # Check to see if the all the properties in the model are valid
78
- # @return true if the model is valid
79
- def valid?
80
- return false if @name.nil?
81
- return false if @name !~ Regexp.new(/^([^[:ascii:]]|[a-zA-Z0-9\-._: ])+$/)
82
- true
83
- end
84
-
85
- # Custom attribute writer method with validation
86
- # @param [Object] name Value to be assigned
87
- def name=(name)
88
- if name.nil?
89
- fail ArgumentError, 'name cannot be nil'
90
- end
91
-
92
- pattern = Regexp.new(/^([^[:ascii:]]|[a-zA-Z0-9\-._: ])+$/)
93
- if name !~ pattern
94
- fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
95
- end
96
-
97
- @name = name
98
- end
99
-
100
- # Checks equality by comparing each attribute.
101
- # @param [Object] Object to be compared
102
- def ==(o)
103
- return true if self.equal?(o)
104
- self.class == o.class &&
105
- name == o.name
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].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
- new.build_from_hash(attributes)
125
- end
126
-
127
- # Builds the object from hash
128
- # @param [Hash] attributes Model attributes in the form of hash
129
- # @return [Object] Returns the model itself
130
- def build_from_hash(attributes)
131
- return nil unless attributes.is_a?(Hash)
132
- self.class.openapi_types.each_pair do |key, type|
133
- if type =~ /\AArray<(.*)>/i
134
- # check to ensure the input is an array given that the attribute
135
- # is documented as an array but the input is not
136
- if attributes[self.class.attribute_map[key]].is_a?(Array)
137
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
- end
139
- elsif !attributes[self.class.attribute_map[key]].nil?
140
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
142
- self.send("#{key}=", nil)
143
- end
144
- end
145
-
146
- self
147
- end
148
-
149
- # Deserializes the data based on type
150
- # @param string type Data type
151
- # @param string value Value to be deserialized
152
- # @return [Object] Deserialized data
153
- def _deserialize(type, value)
154
- case type.to_sym
155
- when :DateTime
156
- DateTime.parse(value)
157
- when :Date
158
- Date.parse(value)
159
- when :String
160
- value.to_s
161
- when :Integer
162
- value.to_i
163
- when :Float
164
- value.to_f
165
- when :Boolean
166
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
- true
168
- else
169
- false
170
- end
171
- when :Object
172
- # generic object (usually a Hash), return directly
173
- value
174
- when /\AArray<(?<inner_type>.+)>\z/
175
- inner_type = Regexp.last_match[:inner_type]
176
- value.map { |v| _deserialize(inner_type, v) }
177
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
- k_type = Regexp.last_match[:k_type]
179
- v_type = Regexp.last_match[:v_type]
180
- {}.tap do |hash|
181
- value.each do |k, v|
182
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
- end
184
- end
185
- else # model
186
- IbmCloudResourceController.const_get(type).build_from_hash(value)
187
- end
188
- end
189
-
190
- # Returns the string representation of the object
191
- # @return [String] String presentation of the object
192
- def to_s
193
- to_hash.to_s
194
- end
195
-
196
- # to_body is an alias to to_hash (backward compatibility)
197
- # @return [Hash] Returns the object in the form of hash
198
- def to_body
199
- to_hash
200
- end
201
-
202
- # Returns the object in the form of hash
203
- # @return [Hash] Returns the object in the form of hash
204
- def to_hash
205
- hash = {}
206
- self.class.attribute_map.each_pair do |attr, param|
207
- value = self.send(attr)
208
- if value.nil?
209
- is_nullable = self.class.openapi_nullable.include?(attr)
210
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
- end
212
-
213
- hash[param] = _to_hash(value)
214
- end
215
- hash
216
- end
217
-
218
- # Outputs non-array value in the form of hash
219
- # For object, use to_hash. Otherwise, just return the value
220
- # @param [Object] value Any valid value
221
- # @return [Hash] Returns the value in the form of hash
222
- def _to_hash(value)
223
- if value.is_a?(Array)
224
- value.compact.map { |v| _to_hash(v) }
225
- elsif value.is_a?(Hash)
226
- {}.tap do |hash|
227
- value.each { |k, v| hash[k] = _to_hash(v) }
228
- end
229
- elsif value.respond_to? :to_hash
230
- value.to_hash
231
- else
232
- value
233
- end
234
- end
235
- end
236
- end
@@ -1,251 +0,0 @@
1
- =begin
2
- #IBM Cloud Resource Controller API
3
-
4
- #Manage lifecycle of your Cloud resources using Resource Controller APIs. Resources are provisioned globally in an account scope. Supports asynchronous provisioning of resources. Enables consumption of a global resource through a Cloud Foundry space in any region.
5
-
6
- The version of the OpenAPI document: 2.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0-beta2
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module IbmCloudResourceController
16
- # Property values for the new resource key.
17
- class ResourceKeyPost
18
- # The name of the key.
19
- attr_accessor :name
20
-
21
- # The short or long ID of resource instance or alias.
22
- attr_accessor :source
23
-
24
- attr_accessor :parameters
25
-
26
- # The role name or it's CRN.
27
- attr_accessor :role
28
-
29
- # Attribute mapping from ruby-style variable name to JSON key.
30
- def self.attribute_map
31
- {
32
- :'name' => :'name',
33
- :'source' => :'source',
34
- :'parameters' => :'parameters',
35
- :'role' => :'role'
36
- }
37
- end
38
-
39
- # Attribute type mapping.
40
- def self.openapi_types
41
- {
42
- :'name' => :'String',
43
- :'source' => :'String',
44
- :'parameters' => :'ResourceBindingPostParameters',
45
- :'role' => :'String'
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 `IbmCloudResourceController::ResourceKeyPost` 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 `IbmCloudResourceController::ResourceKeyPost`. 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?(:'source')
75
- self.source = attributes[:'source']
76
- end
77
-
78
- if attributes.key?(:'parameters')
79
- self.parameters = attributes[:'parameters']
80
- end
81
-
82
- if attributes.key?(:'role')
83
- self.role = attributes[:'role']
84
- else
85
- self.role = 'Writer'
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
- if @name.nil?
94
- invalid_properties.push('invalid value for "name", name cannot be nil.')
95
- end
96
-
97
- if @source.nil?
98
- invalid_properties.push('invalid value for "source", source cannot be nil.')
99
- end
100
-
101
- invalid_properties
102
- end
103
-
104
- # Check to see if the all the properties in the model are valid
105
- # @return true if the model is valid
106
- def valid?
107
- return false if @name.nil?
108
- return false if @source.nil?
109
- true
110
- end
111
-
112
- # Checks equality by comparing each attribute.
113
- # @param [Object] Object to be compared
114
- def ==(o)
115
- return true if self.equal?(o)
116
- self.class == o.class &&
117
- name == o.name &&
118
- source == o.source &&
119
- parameters == o.parameters &&
120
- role == o.role
121
- end
122
-
123
- # @see the `==` method
124
- # @param [Object] Object to be compared
125
- def eql?(o)
126
- self == o
127
- end
128
-
129
- # Calculates hash code according to all attributes.
130
- # @return [Integer] Hash code
131
- def hash
132
- [name, source, parameters, role].hash
133
- end
134
-
135
- # Builds the object from hash
136
- # @param [Hash] attributes Model attributes in the form of hash
137
- # @return [Object] Returns the model itself
138
- def self.build_from_hash(attributes)
139
- new.build_from_hash(attributes)
140
- end
141
-
142
- # Builds the object from hash
143
- # @param [Hash] attributes Model attributes in the form of hash
144
- # @return [Object] Returns the model itself
145
- def build_from_hash(attributes)
146
- return nil unless attributes.is_a?(Hash)
147
- self.class.openapi_types.each_pair do |key, type|
148
- if type =~ /\AArray<(.*)>/i
149
- # check to ensure the input is an array given that the attribute
150
- # is documented as an array but the input is not
151
- if attributes[self.class.attribute_map[key]].is_a?(Array)
152
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
- end
154
- elsif !attributes[self.class.attribute_map[key]].nil?
155
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
157
- self.send("#{key}=", nil)
158
- end
159
- end
160
-
161
- self
162
- end
163
-
164
- # Deserializes the data based on type
165
- # @param string type Data type
166
- # @param string value Value to be deserialized
167
- # @return [Object] Deserialized data
168
- def _deserialize(type, value)
169
- case type.to_sym
170
- when :DateTime
171
- DateTime.parse(value)
172
- when :Date
173
- Date.parse(value)
174
- when :String
175
- value.to_s
176
- when :Integer
177
- value.to_i
178
- when :Float
179
- value.to_f
180
- when :Boolean
181
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
- true
183
- else
184
- false
185
- end
186
- when :Object
187
- # generic object (usually a Hash), return directly
188
- value
189
- when /\AArray<(?<inner_type>.+)>\z/
190
- inner_type = Regexp.last_match[:inner_type]
191
- value.map { |v| _deserialize(inner_type, v) }
192
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
- k_type = Regexp.last_match[:k_type]
194
- v_type = Regexp.last_match[:v_type]
195
- {}.tap do |hash|
196
- value.each do |k, v|
197
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
- end
199
- end
200
- else # model
201
- IbmCloudResourceController.const_get(type).build_from_hash(value)
202
- end
203
- end
204
-
205
- # Returns the string representation of the object
206
- # @return [String] String presentation of the object
207
- def to_s
208
- to_hash.to_s
209
- end
210
-
211
- # to_body is an alias to to_hash (backward compatibility)
212
- # @return [Hash] Returns the object in the form of hash
213
- def to_body
214
- to_hash
215
- end
216
-
217
- # Returns the object in the form of hash
218
- # @return [Hash] Returns the object in the form of hash
219
- def to_hash
220
- hash = {}
221
- self.class.attribute_map.each_pair do |attr, param|
222
- value = self.send(attr)
223
- if value.nil?
224
- is_nullable = self.class.openapi_nullable.include?(attr)
225
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
- end
227
-
228
- hash[param] = _to_hash(value)
229
- end
230
- hash
231
- end
232
-
233
- # Outputs non-array value in the form of hash
234
- # For object, use to_hash. Otherwise, just return the value
235
- # @param [Object] value Any valid value
236
- # @return [Hash] Returns the value in the form of hash
237
- def _to_hash(value)
238
- if value.is_a?(Array)
239
- value.compact.map { |v| _to_hash(v) }
240
- elsif value.is_a?(Hash)
241
- {}.tap do |hash|
242
- value.each { |k, v| hash[k] = _to_hash(v) }
243
- end
244
- elsif value.respond_to? :to_hash
245
- value.to_hash
246
- else
247
- value
248
- end
249
- end
250
- end
251
- end