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