oraclebmc 1.1.1

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.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +82 -0
  3. data/README.md +220 -0
  4. data/lib/oraclebmc/api_client.rb +349 -0
  5. data/lib/oraclebmc/config.rb +80 -0
  6. data/lib/oraclebmc/config_file_loader.rb +85 -0
  7. data/lib/oraclebmc/core/blockstorage_client.rb +459 -0
  8. data/lib/oraclebmc/core/compute_client.rb +1053 -0
  9. data/lib/oraclebmc/core/core.rb +82 -0
  10. data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +179 -0
  11. data/lib/oraclebmc/core/models/attach_volume_details.rb +206 -0
  12. data/lib/oraclebmc/core/models/capture_console_history_details.rb +162 -0
  13. data/lib/oraclebmc/core/models/console_history.rb +252 -0
  14. data/lib/oraclebmc/core/models/cpe.rb +209 -0
  15. data/lib/oraclebmc/core/models/create_cpe_details.rb +187 -0
  16. data/lib/oraclebmc/core/models/create_dhcp_details.rb +195 -0
  17. data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +184 -0
  18. data/lib/oraclebmc/core/models/create_drg_details.rb +173 -0
  19. data/lib/oraclebmc/core/models/create_image_details.rb +188 -0
  20. data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +195 -0
  21. data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +210 -0
  22. data/lib/oraclebmc/core/models/create_route_table_details.rb +195 -0
  23. data/lib/oraclebmc/core/models/create_security_list_details.rb +206 -0
  24. data/lib/oraclebmc/core/models/create_subnet_details.rb +253 -0
  25. data/lib/oraclebmc/core/models/create_vcn_details.rb +187 -0
  26. data/lib/oraclebmc/core/models/create_volume_backup_details.rb +173 -0
  27. data/lib/oraclebmc/core/models/create_volume_details.rb +211 -0
  28. data/lib/oraclebmc/core/models/dhcp_dns_option.rb +203 -0
  29. data/lib/oraclebmc/core/models/dhcp_option.rb +171 -0
  30. data/lib/oraclebmc/core/models/dhcp_options.rb +246 -0
  31. data/lib/oraclebmc/core/models/drg.rb +224 -0
  32. data/lib/oraclebmc/core/models/drg_attachment.rb +246 -0
  33. data/lib/oraclebmc/core/models/egress_security_rule.rb +240 -0
  34. data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +254 -0
  35. data/lib/oraclebmc/core/models/icmp_options.rb +173 -0
  36. data/lib/oraclebmc/core/models/image.rb +282 -0
  37. data/lib/oraclebmc/core/models/ingress_security_rule.rb +240 -0
  38. data/lib/oraclebmc/core/models/instance.rb +326 -0
  39. data/lib/oraclebmc/core/models/internet_gateway.rb +248 -0
  40. data/lib/oraclebmc/core/models/ip_sec_connection.rb +261 -0
  41. data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +195 -0
  42. data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +198 -0
  43. data/lib/oraclebmc/core/models/launch_instance_details.rb +327 -0
  44. data/lib/oraclebmc/core/models/port_range.rb +175 -0
  45. data/lib/oraclebmc/core/models/route_rule.rb +177 -0
  46. data/lib/oraclebmc/core/models/route_table.rb +246 -0
  47. data/lib/oraclebmc/core/models/security_list.rb +257 -0
  48. data/lib/oraclebmc/core/models/shape.rb +164 -0
  49. data/lib/oraclebmc/core/models/subnet.rb +325 -0
  50. data/lib/oraclebmc/core/models/tcp_options.rb +177 -0
  51. data/lib/oraclebmc/core/models/tunnel_config.rb +193 -0
  52. data/lib/oraclebmc/core/models/tunnel_status.rb +218 -0
  53. data/lib/oraclebmc/core/models/udp_options.rb +177 -0
  54. data/lib/oraclebmc/core/models/update_cpe_details.rb +162 -0
  55. data/lib/oraclebmc/core/models/update_dhcp_details.rb +172 -0
  56. data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +162 -0
  57. data/lib/oraclebmc/core/models/update_drg_details.rb +162 -0
  58. data/lib/oraclebmc/core/models/update_image_details.rb +165 -0
  59. data/lib/oraclebmc/core/models/update_instance_details.rb +165 -0
  60. data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +173 -0
  61. data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +162 -0
  62. data/lib/oraclebmc/core/models/update_route_table_details.rb +173 -0
  63. data/lib/oraclebmc/core/models/update_security_list_details.rb +184 -0
  64. data/lib/oraclebmc/core/models/update_subnet_details.rb +162 -0
  65. data/lib/oraclebmc/core/models/update_vcn_details.rb +162 -0
  66. data/lib/oraclebmc/core/models/update_volume_backup_details.rb +162 -0
  67. data/lib/oraclebmc/core/models/update_volume_details.rb +163 -0
  68. data/lib/oraclebmc/core/models/vcn.rb +272 -0
  69. data/lib/oraclebmc/core/models/vnic.rb +274 -0
  70. data/lib/oraclebmc/core/models/vnic_attachment.rb +271 -0
  71. data/lib/oraclebmc/core/models/volume.rb +249 -0
  72. data/lib/oraclebmc/core/models/volume_attachment.rb +284 -0
  73. data/lib/oraclebmc/core/models/volume_backup.rb +273 -0
  74. data/lib/oraclebmc/core/util.rb +1 -0
  75. data/lib/oraclebmc/core/virtual_network_client.rb +2263 -0
  76. data/lib/oraclebmc/errors.rb +62 -0
  77. data/lib/oraclebmc/global_context.rb +21 -0
  78. data/lib/oraclebmc/identity/identity.rb +38 -0
  79. data/lib/oraclebmc/identity/identity_client.rb +1462 -0
  80. data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +173 -0
  81. data/lib/oraclebmc/identity/models/api_key.rb +251 -0
  82. data/lib/oraclebmc/identity/models/availability_domain.rb +173 -0
  83. data/lib/oraclebmc/identity/models/compartment.rb +251 -0
  84. data/lib/oraclebmc/identity/models/create_api_key_details.rb +162 -0
  85. data/lib/oraclebmc/identity/models/create_compartment_details.rb +187 -0
  86. data/lib/oraclebmc/identity/models/create_group_details.rb +186 -0
  87. data/lib/oraclebmc/identity/models/create_policy_details.rb +215 -0
  88. data/lib/oraclebmc/identity/models/create_swift_password_details.rb +163 -0
  89. data/lib/oraclebmc/identity/models/create_user_details.rb +186 -0
  90. data/lib/oraclebmc/identity/models/group.rb +251 -0
  91. data/lib/oraclebmc/identity/models/policy.rb +277 -0
  92. data/lib/oraclebmc/identity/models/swift_password.rb +266 -0
  93. data/lib/oraclebmc/identity/models/ui_password.rb +227 -0
  94. data/lib/oraclebmc/identity/models/update_compartment_details.rb +162 -0
  95. data/lib/oraclebmc/identity/models/update_group_details.rb +162 -0
  96. data/lib/oraclebmc/identity/models/update_policy_details.rb +190 -0
  97. data/lib/oraclebmc/identity/models/update_state_details.rb +163 -0
  98. data/lib/oraclebmc/identity/models/update_swift_password_details.rb +162 -0
  99. data/lib/oraclebmc/identity/models/update_user_details.rb +162 -0
  100. data/lib/oraclebmc/identity/models/user.rb +257 -0
  101. data/lib/oraclebmc/identity/models/user_group_membership.rb +249 -0
  102. data/lib/oraclebmc/identity/util.rb +1 -0
  103. data/lib/oraclebmc/load_balancer/load_balancer.rb +45 -0
  104. data/lib/oraclebmc/load_balancer/load_balancer_client.rb +1218 -0
  105. data/lib/oraclebmc/load_balancer/models/backend.rb +262 -0
  106. data/lib/oraclebmc/load_balancer/models/backend_details.rb +248 -0
  107. data/lib/oraclebmc/load_balancer/models/backend_set.rb +211 -0
  108. data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +197 -0
  109. data/lib/oraclebmc/load_balancer/models/certificate.rb +209 -0
  110. data/lib/oraclebmc/load_balancer/models/certificate_details.rb +245 -0
  111. data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +248 -0
  112. data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +210 -0
  113. data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +245 -0
  114. data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +216 -0
  115. data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +233 -0
  116. data/lib/oraclebmc/load_balancer/models/health_checker.rb +265 -0
  117. data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +264 -0
  118. data/lib/oraclebmc/load_balancer/models/ip_address.rb +165 -0
  119. data/lib/oraclebmc/load_balancer/models/listener.rb +216 -0
  120. data/lib/oraclebmc/load_balancer/models/listener_details.rb +202 -0
  121. data/lib/oraclebmc/load_balancer/models/load_balancer.rb +296 -0
  122. data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +162 -0
  123. data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +162 -0
  124. data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +162 -0
  125. data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +195 -0
  126. data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +195 -0
  127. data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +220 -0
  128. data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +197 -0
  129. data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +263 -0
  130. data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +202 -0
  131. data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +165 -0
  132. data/lib/oraclebmc/load_balancer/models/work_request.rb +269 -0
  133. data/lib/oraclebmc/load_balancer/models/work_request_error.rb +185 -0
  134. data/lib/oraclebmc/load_balancer/util.rb +55 -0
  135. data/lib/oraclebmc/regions.rb +41 -0
  136. data/lib/oraclebmc/response.rb +86 -0
  137. data/lib/oraclebmc/signer.rb +119 -0
  138. data/lib/oraclebmc/version.rb +5 -0
  139. data/lib/oraclebmc/waiter.rb +111 -0
  140. data/lib/oraclebmc.rb +20 -0
  141. metadata +265 -0
@@ -0,0 +1,211 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::BackendSet
7
+ # A friendly name for the backend set. It must be unique and it cannot be changed.
8
+ #
9
+ # Example: `My backend set`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :name
13
+
14
+ # The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN'
15
+ # To get a list of available policies, use the {#list_policies list_policies}
16
+ # operation.
17
+ #
18
+ # Example: `LEAST_CONNECTIONS`
19
+ #
20
+ # @return [String]
21
+ attr_accessor :policy
22
+
23
+ # @return [Array<OracleBMC::LoadBalancer::Models::Backend>]
24
+ attr_accessor :backends
25
+
26
+ # @return [OracleBMC::LoadBalancer::Models::HealthChecker]
27
+ attr_accessor :health_checker
28
+
29
+ # @return [OracleBMC::LoadBalancer::Models::SSLConfiguration]
30
+ attr_accessor :ssl_configuration
31
+
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
40
+
41
+
42
+ if attributes[:'name']
43
+ self.name = attributes[:'name']
44
+ end
45
+
46
+ if attributes[:'policy']
47
+ self.policy = attributes[:'policy']
48
+ end
49
+
50
+ if attributes[:'backends']
51
+ self.backends = attributes[:'backends']
52
+ end
53
+
54
+ if attributes[:'healthChecker']
55
+ self.health_checker = attributes[:'healthChecker']
56
+ end
57
+
58
+ if attributes[:'sslConfiguration']
59
+ self.ssl_configuration = attributes[:'sslConfiguration']
60
+ end
61
+
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] other_object to be compared
66
+ def ==(other_object)
67
+ return true if self.equal?(other_object)
68
+ self.class == other_object.class &&
69
+ name == other_object.name &&
70
+ policy == other_object.policy &&
71
+ backends == other_object.backends &&
72
+ health_checker == other_object.health_checker &&
73
+ ssl_configuration == other_object.ssl_configuration
74
+ end
75
+
76
+ # @see the `==` method
77
+ # @param [Object] other_object to be compared
78
+ def eql?(other_object)
79
+ self == other_object
80
+ end
81
+
82
+ # Calculates hash code according to all attributes.
83
+ # @return [Fixnum] Hash code
84
+ def hash
85
+ [name, policy, backends, health_checker, ssl_configuration].hash
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.swagger_types.each_pair do |key, type|
94
+ if type =~ /^Array<(.*)>/i
95
+ # check to ensure the input is an array given that the the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ # Returns the string representation of the object
109
+ # @return [String] String presentation of the object
110
+ def to_s
111
+ to_hash.to_s
112
+ end
113
+
114
+ # Returns the object in the form of hash
115
+ # @return [Hash] Returns the object in the form of hash
116
+ def to_hash
117
+ hash = {}
118
+ self.class.attribute_map.each_pair do |attr, param|
119
+ value = self.send(attr)
120
+ next if value.nil?
121
+ hash[param] = _to_hash(value)
122
+ end
123
+ hash
124
+ end
125
+
126
+ private
127
+
128
+ # Outputs non-array value in the form of hash
129
+ # For object, use to_hash. Otherwise, just return the value
130
+ # @param [Object] value Any valid value
131
+ # @return [Hash] Returns the value in the form of hash
132
+ def _to_hash(value)
133
+ if value.is_a?(Array)
134
+ value.compact.map{ |v| _to_hash(v) }
135
+ elsif value.is_a?(Hash)
136
+ {}.tap do |hash|
137
+ value.each { |k, v| hash[k] = _to_hash(v) }
138
+ end
139
+ elsif value.respond_to? :to_hash
140
+ value.to_hash
141
+ else
142
+ value
143
+ end
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param [String] type Data type
148
+ # @param [String] value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :DateTime
153
+ DateTime.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :BOOLEAN
163
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ temp_model = OracleBMC.const_get(type.to_s).new
184
+ temp_model.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+
189
+ # Attribute mapping from ruby-style variable name to JSON key.
190
+ def self.attribute_map
191
+ {
192
+ :'name' => :'name',
193
+ :'policy' => :'policy',
194
+ :'backends' => :'backends',
195
+ :'health_checker' => :'healthChecker',
196
+ :'ssl_configuration' => :'sslConfiguration'
197
+ }
198
+ end
199
+
200
+ # Attribute type mapping.
201
+ def self.swagger_types
202
+ {
203
+ :'name' => :'String',
204
+ :'policy' => :'String',
205
+ :'backends' => :'Array<OracleBMC::LoadBalancer::Models::Backend>',
206
+ :'health_checker' => :'OracleBMC::LoadBalancer::Models::HealthChecker',
207
+ :'ssl_configuration' => :'OracleBMC::LoadBalancer::Models::SSLConfiguration'
208
+ }
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,197 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::BackendSetDetails
7
+ # The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN'
8
+ # To get a list of available policies, use the {#list_policies list_policies}
9
+ # operation.
10
+ #
11
+ # Example: `LEAST_CONNECTIONS`
12
+ #
13
+ # @return [String]
14
+ attr_accessor :policy
15
+
16
+ # @return [Array<OracleBMC::LoadBalancer::Models::BackendDetails>]
17
+ attr_accessor :backends
18
+
19
+ # @return [OracleBMC::LoadBalancer::Models::HealthCheckerDetails]
20
+ attr_accessor :health_checker
21
+
22
+ # @return [OracleBMC::LoadBalancer::Models::SSLConfigurationDetails]
23
+ attr_accessor :ssl_configuration
24
+
25
+
26
+ # Initializes the object
27
+ # @param [Hash] attributes Model attributes in the form of hash
28
+ def initialize(attributes = {})
29
+ return unless attributes.is_a?(Hash)
30
+
31
+ # convert string to symbol for hash key
32
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
33
+
34
+
35
+ if attributes[:'policy']
36
+ self.policy = attributes[:'policy']
37
+ end
38
+
39
+ if attributes[:'backends']
40
+ self.backends = attributes[:'backends']
41
+ end
42
+
43
+ if attributes[:'healthChecker']
44
+ self.health_checker = attributes[:'healthChecker']
45
+ end
46
+
47
+ if attributes[:'sslConfiguration']
48
+ self.ssl_configuration = attributes[:'sslConfiguration']
49
+ end
50
+
51
+ end
52
+
53
+ # Checks equality by comparing each attribute.
54
+ # @param [Object] other_object to be compared
55
+ def ==(other_object)
56
+ return true if self.equal?(other_object)
57
+ self.class == other_object.class &&
58
+ policy == other_object.policy &&
59
+ backends == other_object.backends &&
60
+ health_checker == other_object.health_checker &&
61
+ ssl_configuration == other_object.ssl_configuration
62
+ end
63
+
64
+ # @see the `==` method
65
+ # @param [Object] other_object to be compared
66
+ def eql?(other_object)
67
+ self == other_object
68
+ end
69
+
70
+ # Calculates hash code according to all attributes.
71
+ # @return [Fixnum] Hash code
72
+ def hash
73
+ [policy, backends, health_checker, ssl_configuration].hash
74
+ end
75
+
76
+ # Builds the object from hash
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ # @return [Object] Returns the model itself
79
+ def build_from_hash(attributes)
80
+ return nil unless attributes.is_a?(Hash)
81
+ self.class.swagger_types.each_pair do |key, type|
82
+ if type =~ /^Array<(.*)>/i
83
+ # check to ensure the input is an array given that the the attribute
84
+ # is documented as an array but the input is not
85
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
86
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
87
+ end
88
+ elsif !attributes[self.class.attribute_map[key]].nil?
89
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
90
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
91
+ end
92
+
93
+ self
94
+ end
95
+
96
+ # Returns the string representation of the object
97
+ # @return [String] String presentation of the object
98
+ def to_s
99
+ to_hash.to_s
100
+ end
101
+
102
+ # Returns the object in the form of hash
103
+ # @return [Hash] Returns the object in the form of hash
104
+ def to_hash
105
+ hash = {}
106
+ self.class.attribute_map.each_pair do |attr, param|
107
+ value = self.send(attr)
108
+ next if value.nil?
109
+ hash[param] = _to_hash(value)
110
+ end
111
+ hash
112
+ end
113
+
114
+ private
115
+
116
+ # Outputs non-array value in the form of hash
117
+ # For object, use to_hash. Otherwise, just return the value
118
+ # @param [Object] value Any valid value
119
+ # @return [Hash] Returns the value in the form of hash
120
+ def _to_hash(value)
121
+ if value.is_a?(Array)
122
+ value.compact.map{ |v| _to_hash(v) }
123
+ elsif value.is_a?(Hash)
124
+ {}.tap do |hash|
125
+ value.each { |k, v| hash[k] = _to_hash(v) }
126
+ end
127
+ elsif value.respond_to? :to_hash
128
+ value.to_hash
129
+ else
130
+ value
131
+ end
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param [String] type Data type
136
+ # @param [String] value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :BOOLEAN
151
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ temp_model = OracleBMC.const_get(type.to_s).new
172
+ temp_model.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+
177
+ # Attribute mapping from ruby-style variable name to JSON key.
178
+ def self.attribute_map
179
+ {
180
+ :'policy' => :'policy',
181
+ :'backends' => :'backends',
182
+ :'health_checker' => :'healthChecker',
183
+ :'ssl_configuration' => :'sslConfiguration'
184
+ }
185
+ end
186
+
187
+ # Attribute type mapping.
188
+ def self.swagger_types
189
+ {
190
+ :'policy' => :'String',
191
+ :'backends' => :'Array<OracleBMC::LoadBalancer::Models::BackendDetails>',
192
+ :'health_checker' => :'OracleBMC::LoadBalancer::Models::HealthCheckerDetails',
193
+ :'ssl_configuration' => :'OracleBMC::LoadBalancer::Models::SSLConfigurationDetails'
194
+ }
195
+ end
196
+ end
197
+ end
@@ -0,0 +1,209 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::Certificate
7
+ # A friendly name for the certificate bundle. It must be unique and it cannot be changed.
8
+ #
9
+ # Example: `My certificate bundle`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :certificate_name
13
+
14
+ # The public certificate, in PEM format, that you received from your SSL certificate provider.
15
+ #
16
+ # Example:
17
+ #
18
+ # -----BEGIN CERTIFICATE-----
19
+ # MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG
20
+ # A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE
21
+ # MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl
22
+ # YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw
23
+ # ...
24
+ # -----END CERTIFICATE-----
25
+ #
26
+ # @return [String]
27
+ attr_accessor :public_certificate
28
+
29
+ # The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider.
30
+ #
31
+ # Example:
32
+ #
33
+ # -----BEGIN CERTIFICATE-----
34
+ # MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix
35
+ # EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD
36
+ # VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y
37
+ # aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy
38
+ # ...
39
+ # -----END CERTIFICATE-----
40
+ #
41
+ # @return [String]
42
+ attr_accessor :ca_certificate
43
+
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
52
+
53
+
54
+ if attributes[:'certificateName']
55
+ self.certificate_name = attributes[:'certificateName']
56
+ end
57
+
58
+ if attributes[:'publicCertificate']
59
+ self.public_certificate = attributes[:'publicCertificate']
60
+ end
61
+
62
+ if attributes[:'caCertificate']
63
+ self.ca_certificate = attributes[:'caCertificate']
64
+ end
65
+
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] other_object to be compared
70
+ def ==(other_object)
71
+ return true if self.equal?(other_object)
72
+ self.class == other_object.class &&
73
+ certificate_name == other_object.certificate_name &&
74
+ public_certificate == other_object.public_certificate &&
75
+ ca_certificate == other_object.ca_certificate
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] other_object to be compared
80
+ def eql?(other_object)
81
+ self == other_object
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [certificate_name, public_certificate, ca_certificate].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /^Array<(.*)>/i
97
+ # check to ensure the input is an array given that the the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Returns the string representation of the object
111
+ # @return [String] String presentation of the object
112
+ def to_s
113
+ to_hash.to_s
114
+ end
115
+
116
+ # Returns the object in the form of hash
117
+ # @return [Hash] Returns the object in the form of hash
118
+ def to_hash
119
+ hash = {}
120
+ self.class.attribute_map.each_pair do |attr, param|
121
+ value = self.send(attr)
122
+ next if value.nil?
123
+ hash[param] = _to_hash(value)
124
+ end
125
+ hash
126
+ end
127
+
128
+ private
129
+
130
+ # Outputs non-array value in the form of hash
131
+ # For object, use to_hash. Otherwise, just return the value
132
+ # @param [Object] value Any valid value
133
+ # @return [Hash] Returns the value in the form of hash
134
+ def _to_hash(value)
135
+ if value.is_a?(Array)
136
+ value.compact.map{ |v| _to_hash(v) }
137
+ elsif value.is_a?(Hash)
138
+ {}.tap do |hash|
139
+ value.each { |k, v| hash[k] = _to_hash(v) }
140
+ end
141
+ elsif value.respond_to? :to_hash
142
+ value.to_hash
143
+ else
144
+ value
145
+ end
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param [String] type Data type
150
+ # @param [String] value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :DateTime
155
+ DateTime.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :BOOLEAN
165
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ temp_model = OracleBMC.const_get(type.to_s).new
186
+ temp_model.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+
191
+ # Attribute mapping from ruby-style variable name to JSON key.
192
+ def self.attribute_map
193
+ {
194
+ :'certificate_name' => :'certificateName',
195
+ :'public_certificate' => :'publicCertificate',
196
+ :'ca_certificate' => :'caCertificate'
197
+ }
198
+ end
199
+
200
+ # Attribute type mapping.
201
+ def self.swagger_types
202
+ {
203
+ :'certificate_name' => :'String',
204
+ :'public_certificate' => :'String',
205
+ :'ca_certificate' => :'String'
206
+ }
207
+ end
208
+ end
209
+ end