oci 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +82 -0
- data/README.md +262 -0
- data/lib/oci.rb +25 -0
- data/lib/oci/api_client.rb +389 -0
- data/lib/oci/config.rb +118 -0
- data/lib/oci/config_file_loader.rb +96 -0
- data/lib/oci/core/blockstorage_client.rb +462 -0
- data/lib/oci/core/compute_client.rb +1415 -0
- data/lib/oci/core/core.rb +114 -0
- data/lib/oci/core/models/attach_i_scsi_volume_details.rb +137 -0
- data/lib/oci/core/models/attach_vnic_details.rb +144 -0
- data/lib/oci/core/models/attach_volume_details.rb +165 -0
- data/lib/oci/core/models/capture_console_history_details.rb +120 -0
- data/lib/oci/core/models/console_history.rb +213 -0
- data/lib/oci/core/models/cpe.rb +169 -0
- data/lib/oci/core/models/create_cpe_details.rb +145 -0
- data/lib/oci/core/models/create_cross_connect_details.rb +204 -0
- data/lib/oci/core/models/create_cross_connect_group_details.rb +133 -0
- data/lib/oci/core/models/create_dhcp_details.rb +153 -0
- data/lib/oci/core/models/create_drg_attachment_details.rb +142 -0
- data/lib/oci/core/models/create_drg_details.rb +131 -0
- data/lib/oci/core/models/create_image_details.rb +159 -0
- data/lib/oci/core/models/create_instance_console_connection_details.rb +131 -0
- data/lib/oci/core/models/create_internet_gateway_details.rb +153 -0
- data/lib/oci/core/models/create_ip_sec_connection_details.rb +168 -0
- data/lib/oci/core/models/create_private_ip_details.rb +173 -0
- data/lib/oci/core/models/create_route_table_details.rb +153 -0
- data/lib/oci/core/models/create_security_list_details.rb +164 -0
- data/lib/oci/core/models/create_subnet_details.rb +257 -0
- data/lib/oci/core/models/create_vcn_details.rb +171 -0
- data/lib/oci/core/models/create_virtual_circuit_details.rb +260 -0
- data/lib/oci/core/models/create_vnic_details.rb +214 -0
- data/lib/oci/core/models/create_volume_backup_details.rb +133 -0
- data/lib/oci/core/models/create_volume_details.rb +170 -0
- data/lib/oci/core/models/cross_connect.rb +235 -0
- data/lib/oci/core/models/cross_connect_group.rb +187 -0
- data/lib/oci/core/models/cross_connect_location.rb +134 -0
- data/lib/oci/core/models/cross_connect_mapping.rb +190 -0
- data/lib/oci/core/models/cross_connect_port_speed_shape.rb +137 -0
- data/lib/oci/core/models/cross_connect_status.rb +200 -0
- data/lib/oci/core/models/dhcp_dns_option.rb +171 -0
- data/lib/oci/core/models/dhcp_option.rb +135 -0
- data/lib/oci/core/models/dhcp_options.rb +208 -0
- data/lib/oci/core/models/dhcp_search_domain_option.rb +141 -0
- data/lib/oci/core/models/drg.rb +186 -0
- data/lib/oci/core/models/drg_attachment.rb +208 -0
- data/lib/oci/core/models/egress_security_rule.rb +198 -0
- data/lib/oci/core/models/export_image_details.rb +134 -0
- data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +150 -0
- data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +130 -0
- data/lib/oci/core/models/fast_connect_provider_service.rb +145 -0
- data/lib/oci/core/models/i_scsi_volume_attachment.rb +212 -0
- data/lib/oci/core/models/icmp_options.rb +131 -0
- data/lib/oci/core/models/image.rb +245 -0
- data/lib/oci/core/models/image_source_details.rb +134 -0
- data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +150 -0
- data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +128 -0
- data/lib/oci/core/models/ingress_security_rule.rb +198 -0
- data/lib/oci/core/models/instance.rb +307 -0
- data/lib/oci/core/models/instance_console_connection.rb +193 -0
- data/lib/oci/core/models/instance_credentials.rb +131 -0
- data/lib/oci/core/models/internet_gateway.rb +210 -0
- data/lib/oci/core/models/ip_sec_connection.rb +223 -0
- data/lib/oci/core/models/ip_sec_connection_device_config.rb +153 -0
- data/lib/oci/core/models/ip_sec_connection_device_status.rb +156 -0
- data/lib/oci/core/models/launch_instance_details.rb +336 -0
- data/lib/oci/core/models/letter_of_authority.rb +194 -0
- data/lib/oci/core/models/port_range.rb +133 -0
- data/lib/oci/core/models/private_ip.rb +248 -0
- data/lib/oci/core/models/route_rule.rb +135 -0
- data/lib/oci/core/models/route_table.rb +208 -0
- data/lib/oci/core/models/security_list.rb +219 -0
- data/lib/oci/core/models/shape.rb +122 -0
- data/lib/oci/core/models/subnet.rb +351 -0
- data/lib/oci/core/models/tcp_options.rb +135 -0
- data/lib/oci/core/models/tunnel_config.rb +151 -0
- data/lib/oci/core/models/tunnel_status.rb +178 -0
- data/lib/oci/core/models/udp_options.rb +135 -0
- data/lib/oci/core/models/update_cpe_details.rb +122 -0
- data/lib/oci/core/models/update_cross_connect_details.rb +138 -0
- data/lib/oci/core/models/update_cross_connect_group_details.rb +122 -0
- data/lib/oci/core/models/update_dhcp_details.rb +132 -0
- data/lib/oci/core/models/update_drg_attachment_details.rb +122 -0
- data/lib/oci/core/models/update_drg_details.rb +122 -0
- data/lib/oci/core/models/update_image_details.rb +124 -0
- data/lib/oci/core/models/update_instance_details.rb +124 -0
- data/lib/oci/core/models/update_internet_gateway_details.rb +133 -0
- data/lib/oci/core/models/update_ip_sec_connection_details.rb +122 -0
- data/lib/oci/core/models/update_private_ip_details.rb +157 -0
- data/lib/oci/core/models/update_route_table_details.rb +133 -0
- data/lib/oci/core/models/update_security_list_details.rb +144 -0
- data/lib/oci/core/models/update_subnet_details.rb +122 -0
- data/lib/oci/core/models/update_vcn_details.rb +122 -0
- data/lib/oci/core/models/update_virtual_circuit_details.rb +240 -0
- data/lib/oci/core/models/update_vnic_details.rb +144 -0
- data/lib/oci/core/models/update_volume_backup_details.rb +122 -0
- data/lib/oci/core/models/update_volume_details.rb +122 -0
- data/lib/oci/core/models/vcn.rb +276 -0
- data/lib/oci/core/models/virtual_circuit.rb +395 -0
- data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +137 -0
- data/lib/oci/core/models/vnic.rb +287 -0
- data/lib/oci/core/models/vnic_attachment.rb +250 -0
- data/lib/oci/core/models/volume.rb +210 -0
- data/lib/oci/core/models/volume_attachment.rb +246 -0
- data/lib/oci/core/models/volume_backup.rb +235 -0
- data/lib/oci/core/util.rb +1 -0
- data/lib/oci/core/virtual_network_client.rb +3421 -0
- data/lib/oci/errors.rb +78 -0
- data/lib/oci/global_context.rb +20 -0
- data/lib/oci/identity/identity.rb +55 -0
- data/lib/oci/identity/identity_client.rb +2148 -0
- data/lib/oci/identity/models/add_user_to_group_details.rb +131 -0
- data/lib/oci/identity/models/api_key.rb +211 -0
- data/lib/oci/identity/models/availability_domain.rb +131 -0
- data/lib/oci/identity/models/compartment.rb +211 -0
- data/lib/oci/identity/models/create_api_key_details.rb +120 -0
- data/lib/oci/identity/models/create_compartment_details.rb +145 -0
- data/lib/oci/identity/models/create_customer_secret_key_details.rb +121 -0
- data/lib/oci/identity/models/create_group_details.rb +144 -0
- data/lib/oci/identity/models/create_identity_provider_details.rb +215 -0
- data/lib/oci/identity/models/create_idp_group_mapping_details.rb +133 -0
- data/lib/oci/identity/models/create_policy_details.rb +173 -0
- data/lib/oci/identity/models/create_region_subscription_details.rb +128 -0
- data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +154 -0
- data/lib/oci/identity/models/create_swift_password_details.rb +121 -0
- data/lib/oci/identity/models/create_user_details.rb +144 -0
- data/lib/oci/identity/models/customer_secret_key.rb +225 -0
- data/lib/oci/identity/models/customer_secret_key_summary.rb +213 -0
- data/lib/oci/identity/models/group.rb +211 -0
- data/lib/oci/identity/models/identity_provider.rb +261 -0
- data/lib/oci/identity/models/idp_group_mapping.rb +220 -0
- data/lib/oci/identity/models/policy.rb +237 -0
- data/lib/oci/identity/models/region.rb +143 -0
- data/lib/oci/identity/models/region_subscription.rb +180 -0
- data/lib/oci/identity/models/saml2_identity_provider.rb +180 -0
- data/lib/oci/identity/models/swift_password.rb +226 -0
- data/lib/oci/identity/models/tenancy.rb +159 -0
- data/lib/oci/identity/models/ui_password.rb +187 -0
- data/lib/oci/identity/models/update_compartment_details.rb +132 -0
- data/lib/oci/identity/models/update_customer_secret_key_details.rb +120 -0
- data/lib/oci/identity/models/update_group_details.rb +120 -0
- data/lib/oci/identity/models/update_identity_provider_details.rb +160 -0
- data/lib/oci/identity/models/update_idp_group_mapping_details.rb +131 -0
- data/lib/oci/identity/models/update_policy_details.rb +148 -0
- data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +145 -0
- data/lib/oci/identity/models/update_state_details.rb +121 -0
- data/lib/oci/identity/models/update_swift_password_details.rb +120 -0
- data/lib/oci/identity/models/update_user_details.rb +120 -0
- data/lib/oci/identity/models/user.rb +217 -0
- data/lib/oci/identity/models/user_group_membership.rb +209 -0
- data/lib/oci/identity/util.rb +1 -0
- data/lib/oci/internal/internal.rb +10 -0
- data/lib/oci/internal/util.rb +69 -0
- data/lib/oci/load_balancer/load_balancer.rb +51 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +1449 -0
- data/lib/oci/load_balancer/models/backend.rb +220 -0
- data/lib/oci/load_balancer/models/backend_details.rb +206 -0
- data/lib/oci/load_balancer/models/backend_health.rb +158 -0
- data/lib/oci/load_balancer/models/backend_set.rb +182 -0
- data/lib/oci/load_balancer/models/backend_set_details.rb +165 -0
- data/lib/oci/load_balancer/models/backend_set_health.rb +207 -0
- data/lib/oci/load_balancer/models/certificate.rb +169 -0
- data/lib/oci/load_balancer/models/certificate_details.rb +205 -0
- data/lib/oci/load_balancer/models/create_backend_details.rb +206 -0
- data/lib/oci/load_balancer/models/create_backend_set_details.rb +181 -0
- data/lib/oci/load_balancer/models/create_certificate_details.rb +205 -0
- data/lib/oci/load_balancer/models/create_listener_details.rb +175 -0
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +220 -0
- data/lib/oci/load_balancer/models/health_check_result.rb +183 -0
- data/lib/oci/load_balancer/models/health_checker.rb +224 -0
- data/lib/oci/load_balancer/models/health_checker_details.rb +223 -0
- data/lib/oci/load_balancer/models/ip_address.rb +139 -0
- data/lib/oci/load_balancer/models/listener.rb +174 -0
- data/lib/oci/load_balancer/models/listener_details.rb +160 -0
- data/lib/oci/load_balancer/models/load_balancer.rb +280 -0
- data/lib/oci/load_balancer/models/load_balancer_health.rb +215 -0
- data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +168 -0
- data/lib/oci/load_balancer/models/load_balancer_policy.rb +120 -0
- data/lib/oci/load_balancer/models/load_balancer_protocol.rb +120 -0
- data/lib/oci/load_balancer/models/load_balancer_shape.rb +120 -0
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +141 -0
- data/lib/oci/load_balancer/models/ssl_configuration.rb +155 -0
- data/lib/oci/load_balancer/models/ssl_configuration_details.rb +155 -0
- data/lib/oci/load_balancer/models/update_backend_details.rb +178 -0
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +165 -0
- data/lib/oci/load_balancer/models/update_health_checker_details.rb +222 -0
- data/lib/oci/load_balancer/models/update_listener_details.rb +160 -0
- data/lib/oci/load_balancer/models/update_load_balancer_details.rb +124 -0
- data/lib/oci/load_balancer/models/work_request.rb +229 -0
- data/lib/oci/load_balancer/models/work_request_error.rb +145 -0
- data/lib/oci/load_balancer/util.rb +58 -0
- data/lib/oci/object_storage/models/bucket.rb +216 -0
- data/lib/oci/object_storage/models/bucket_summary.rb +175 -0
- data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +133 -0
- data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +131 -0
- data/lib/oci/object_storage/models/create_bucket_details.rb +173 -0
- data/lib/oci/object_storage/models/create_multipart_upload_details.rb +166 -0
- data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +171 -0
- data/lib/oci/object_storage/models/list_objects.rb +146 -0
- data/lib/oci/object_storage/models/multipart_upload.rb +164 -0
- data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +153 -0
- data/lib/oci/object_storage/models/object_summary.rb +153 -0
- data/lib/oci/object_storage/models/preauthenticated_request.rb +207 -0
- data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +196 -0
- data/lib/oci/object_storage/models/update_bucket_details.rb +171 -0
- data/lib/oci/object_storage/object_storage.rb +30 -0
- data/lib/oci/object_storage/object_storage_client.rb +1185 -0
- data/lib/oci/object_storage/util.rb +1 -0
- data/lib/oci/regions.rb +43 -0
- data/lib/oci/response.rb +80 -0
- data/lib/oci/response_headers.rb +144 -0
- data/lib/oci/signer.rb +157 -0
- data/lib/oci/version.rb +5 -0
- data/lib/oci/waiter.rb +101 -0
- data/lib/oraclebmc.rb +3 -0
- metadata +375 -0
@@ -0,0 +1,153 @@
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OCI
|
6
|
+
class ObjectStorage::Models::MultipartUploadPartSummary
|
7
|
+
# the current entity tag for the part.
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :etag
|
10
|
+
|
11
|
+
# the MD5 hash of the bytes of the part.
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :md5
|
14
|
+
|
15
|
+
# the size of the part in bytes.
|
16
|
+
# @return [Integer]
|
17
|
+
attr_accessor :size
|
18
|
+
|
19
|
+
# the part number for this part.
|
20
|
+
# @return [Integer]
|
21
|
+
attr_accessor :part_number
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the object
|
25
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
26
|
+
def initialize(attributes = {})
|
27
|
+
return unless attributes.is_a?(Hash)
|
28
|
+
|
29
|
+
# convert string to symbol for hash key
|
30
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
31
|
+
|
32
|
+
if attributes[:'etag']
|
33
|
+
self.etag = attributes[:'etag']
|
34
|
+
end
|
35
|
+
|
36
|
+
if attributes[:'md5']
|
37
|
+
self.md5 = attributes[:'md5']
|
38
|
+
end
|
39
|
+
|
40
|
+
if attributes[:'size']
|
41
|
+
self.size = attributes[:'size']
|
42
|
+
end
|
43
|
+
|
44
|
+
if attributes[:'partNumber']
|
45
|
+
self.part_number = attributes[:'partNumber']
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Checks equality by comparing each attribute.
|
51
|
+
# @param [Object] other_object to be compared
|
52
|
+
def ==(other_object)
|
53
|
+
return true if self.equal?(other_object)
|
54
|
+
self.class == other_object.class &&
|
55
|
+
etag == other_object.etag &&
|
56
|
+
md5 == other_object.md5 &&
|
57
|
+
size == other_object.size &&
|
58
|
+
part_number == other_object.part_number
|
59
|
+
end
|
60
|
+
|
61
|
+
# @see the `==` method
|
62
|
+
# @param [Object] other_object to be compared
|
63
|
+
def eql?(other_object)
|
64
|
+
self == other_object
|
65
|
+
end
|
66
|
+
|
67
|
+
# Calculates hash code according to all attributes.
|
68
|
+
# @return [Fixnum] Hash code
|
69
|
+
def hash
|
70
|
+
[etag, md5, size, part_number].hash
|
71
|
+
end
|
72
|
+
|
73
|
+
# Builds the object from hash
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
# @return [Object] Returns the model itself
|
76
|
+
def build_from_hash(attributes)
|
77
|
+
return nil unless attributes.is_a?(Hash)
|
78
|
+
self.class.swagger_types.each_pair do |key, type|
|
79
|
+
if type =~ /^Array<(.*)>/i
|
80
|
+
# check to ensure the input is an array given that the the attribute
|
81
|
+
# is documented as an array but the input is not
|
82
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
83
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
84
|
+
end
|
85
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
86
|
+
self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
87
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
88
|
+
end
|
89
|
+
|
90
|
+
self
|
91
|
+
end
|
92
|
+
|
93
|
+
# Returns the string representation of the object
|
94
|
+
# @return [String] String presentation of the object
|
95
|
+
def to_s
|
96
|
+
to_hash.to_s
|
97
|
+
end
|
98
|
+
|
99
|
+
# Returns the object in the form of hash
|
100
|
+
# @return [Hash] Returns the object in the form of hash
|
101
|
+
def to_hash
|
102
|
+
hash = {}
|
103
|
+
self.class.attribute_map.each_pair do |attr, param|
|
104
|
+
value = self.send(attr)
|
105
|
+
next if value.nil?
|
106
|
+
hash[param] = _to_hash(value)
|
107
|
+
end
|
108
|
+
hash
|
109
|
+
end
|
110
|
+
|
111
|
+
private
|
112
|
+
|
113
|
+
# Outputs non-array value in the form of hash
|
114
|
+
# For object, use to_hash. Otherwise, just return the value
|
115
|
+
# @param [Object] value Any valid value
|
116
|
+
# @return [Hash] Returns the value in the form of hash
|
117
|
+
def _to_hash(value)
|
118
|
+
if value.is_a?(Array)
|
119
|
+
value.compact.map{ |v| _to_hash(v) }
|
120
|
+
elsif value.is_a?(Hash)
|
121
|
+
{}.tap do |hash|
|
122
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
123
|
+
end
|
124
|
+
elsif value.respond_to? :to_hash
|
125
|
+
value.to_hash
|
126
|
+
else
|
127
|
+
value
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
134
|
+
def self.attribute_map
|
135
|
+
{
|
136
|
+
:'etag' => :'etag',
|
137
|
+
:'md5' => :'md5',
|
138
|
+
:'size' => :'size',
|
139
|
+
:'part_number' => :'partNumber'
|
140
|
+
}
|
141
|
+
end
|
142
|
+
|
143
|
+
# Attribute type mapping.
|
144
|
+
def self.swagger_types
|
145
|
+
{
|
146
|
+
:'etag' => :'String',
|
147
|
+
:'md5' => :'String',
|
148
|
+
:'size' => :'Integer',
|
149
|
+
:'part_number' => :'Integer'
|
150
|
+
}
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OCI
|
6
|
+
class ObjectStorage::Models::ObjectSummary
|
7
|
+
# The name of the object.
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :name
|
10
|
+
|
11
|
+
# Size of the object in bytes.
|
12
|
+
# @return [Integer]
|
13
|
+
attr_accessor :size
|
14
|
+
|
15
|
+
# Base64-encoded MD5 hash of the object data.
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :md5
|
18
|
+
|
19
|
+
# Date and time of object creation.
|
20
|
+
# @return [DateTime]
|
21
|
+
attr_accessor :time_created
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the object
|
25
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
26
|
+
def initialize(attributes = {})
|
27
|
+
return unless attributes.is_a?(Hash)
|
28
|
+
|
29
|
+
# convert string to symbol for hash key
|
30
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
31
|
+
|
32
|
+
if attributes[:'name']
|
33
|
+
self.name = attributes[:'name']
|
34
|
+
end
|
35
|
+
|
36
|
+
if attributes[:'size']
|
37
|
+
self.size = attributes[:'size']
|
38
|
+
end
|
39
|
+
|
40
|
+
if attributes[:'md5']
|
41
|
+
self.md5 = attributes[:'md5']
|
42
|
+
end
|
43
|
+
|
44
|
+
if attributes[:'timeCreated']
|
45
|
+
self.time_created = attributes[:'timeCreated']
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Checks equality by comparing each attribute.
|
51
|
+
# @param [Object] other_object to be compared
|
52
|
+
def ==(other_object)
|
53
|
+
return true if self.equal?(other_object)
|
54
|
+
self.class == other_object.class &&
|
55
|
+
name == other_object.name &&
|
56
|
+
size == other_object.size &&
|
57
|
+
md5 == other_object.md5 &&
|
58
|
+
time_created == other_object.time_created
|
59
|
+
end
|
60
|
+
|
61
|
+
# @see the `==` method
|
62
|
+
# @param [Object] other_object to be compared
|
63
|
+
def eql?(other_object)
|
64
|
+
self == other_object
|
65
|
+
end
|
66
|
+
|
67
|
+
# Calculates hash code according to all attributes.
|
68
|
+
# @return [Fixnum] Hash code
|
69
|
+
def hash
|
70
|
+
[name, size, md5, time_created].hash
|
71
|
+
end
|
72
|
+
|
73
|
+
# Builds the object from hash
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
# @return [Object] Returns the model itself
|
76
|
+
def build_from_hash(attributes)
|
77
|
+
return nil unless attributes.is_a?(Hash)
|
78
|
+
self.class.swagger_types.each_pair do |key, type|
|
79
|
+
if type =~ /^Array<(.*)>/i
|
80
|
+
# check to ensure the input is an array given that the the attribute
|
81
|
+
# is documented as an array but the input is not
|
82
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
83
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
84
|
+
end
|
85
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
86
|
+
self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
87
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
88
|
+
end
|
89
|
+
|
90
|
+
self
|
91
|
+
end
|
92
|
+
|
93
|
+
# Returns the string representation of the object
|
94
|
+
# @return [String] String presentation of the object
|
95
|
+
def to_s
|
96
|
+
to_hash.to_s
|
97
|
+
end
|
98
|
+
|
99
|
+
# Returns the object in the form of hash
|
100
|
+
# @return [Hash] Returns the object in the form of hash
|
101
|
+
def to_hash
|
102
|
+
hash = {}
|
103
|
+
self.class.attribute_map.each_pair do |attr, param|
|
104
|
+
value = self.send(attr)
|
105
|
+
next if value.nil?
|
106
|
+
hash[param] = _to_hash(value)
|
107
|
+
end
|
108
|
+
hash
|
109
|
+
end
|
110
|
+
|
111
|
+
private
|
112
|
+
|
113
|
+
# Outputs non-array value in the form of hash
|
114
|
+
# For object, use to_hash. Otherwise, just return the value
|
115
|
+
# @param [Object] value Any valid value
|
116
|
+
# @return [Hash] Returns the value in the form of hash
|
117
|
+
def _to_hash(value)
|
118
|
+
if value.is_a?(Array)
|
119
|
+
value.compact.map{ |v| _to_hash(v) }
|
120
|
+
elsif value.is_a?(Hash)
|
121
|
+
{}.tap do |hash|
|
122
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
123
|
+
end
|
124
|
+
elsif value.respond_to? :to_hash
|
125
|
+
value.to_hash
|
126
|
+
else
|
127
|
+
value
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
134
|
+
def self.attribute_map
|
135
|
+
{
|
136
|
+
:'name' => :'name',
|
137
|
+
:'size' => :'size',
|
138
|
+
:'md5' => :'md5',
|
139
|
+
:'time_created' => :'timeCreated'
|
140
|
+
}
|
141
|
+
end
|
142
|
+
|
143
|
+
# Attribute type mapping.
|
144
|
+
def self.swagger_types
|
145
|
+
{
|
146
|
+
:'name' => :'String',
|
147
|
+
:'size' => :'Integer',
|
148
|
+
:'md5' => :'String',
|
149
|
+
:'time_created' => :'DateTime'
|
150
|
+
}
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -0,0 +1,207 @@
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OCI
|
6
|
+
class ObjectStorage::Models::PreauthenticatedRequest
|
7
|
+
|
8
|
+
ACCESS_TYPE_ENUM = [ACCESS_TYPE_OBJECT_READ = 'ObjectRead',
|
9
|
+
ACCESS_TYPE_OBJECT_WRITE = 'ObjectWrite',
|
10
|
+
ACCESS_TYPE_OBJECT_READ_WRITE = 'ObjectReadWrite',
|
11
|
+
ACCESS_TYPE_ANY_OBJECT_WRITE = 'AnyObjectWrite',
|
12
|
+
ACCESS_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
|
13
|
+
|
14
|
+
# the unique identifier to use when directly addressing the pre-authenticated request
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
# the user supplied name of the pre-authenticated request.
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
# the uri to embed in the url when using the pre-authenticated request.
|
23
|
+
# @return [String]
|
24
|
+
attr_accessor :access_uri
|
25
|
+
|
26
|
+
# Name of object that is being granted access to by the pre-authenticated request. This can be null and that would mean that the pre-authenticated request is granting access to the entire bucket
|
27
|
+
# @return [String]
|
28
|
+
attr_accessor :object_name
|
29
|
+
|
30
|
+
# the operation that can be performed on this resource e.g PUT or GET.
|
31
|
+
# @return [String]
|
32
|
+
attr_accessor :access_type
|
33
|
+
|
34
|
+
# the expiration date after which the pre authenticated request will no longer be valid as per spec
|
35
|
+
# [RFC 3339](https://tools.ietf.org/rfc/rfc3339)
|
36
|
+
#
|
37
|
+
# @return [DateTime]
|
38
|
+
attr_accessor :time_expires
|
39
|
+
|
40
|
+
# the date when the pre-authenticated request was created as per spec
|
41
|
+
# [RFC 3339](https://tools.ietf.org/rfc/rfc3339)
|
42
|
+
#
|
43
|
+
# @return [DateTime]
|
44
|
+
attr_accessor :time_created
|
45
|
+
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
return unless attributes.is_a?(Hash)
|
51
|
+
|
52
|
+
# convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
54
|
+
|
55
|
+
if attributes[:'id']
|
56
|
+
self.id = attributes[:'id']
|
57
|
+
end
|
58
|
+
|
59
|
+
if attributes[:'name']
|
60
|
+
self.name = attributes[:'name']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes[:'accessUri']
|
64
|
+
self.access_uri = attributes[:'accessUri']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes[:'objectName']
|
68
|
+
self.object_name = attributes[:'objectName']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes[:'accessType']
|
72
|
+
self.access_type = attributes[:'accessType']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes[:'timeExpires']
|
76
|
+
self.time_expires = attributes[:'timeExpires']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes[:'timeCreated']
|
80
|
+
self.time_created = attributes[:'timeCreated']
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
# Custom attribute writer method checking allowed values (enum).
|
86
|
+
# @param [Object] access_type Object to be assigned
|
87
|
+
def access_type=(access_type)
|
88
|
+
if access_type && !ACCESS_TYPE_ENUM.include?(access_type)
|
89
|
+
@access_type = ACCESS_TYPE_UNKNOWN_ENUM_VALUE
|
90
|
+
else
|
91
|
+
@access_type = access_type
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks equality by comparing each attribute.
|
96
|
+
# @param [Object] other_object to be compared
|
97
|
+
def ==(other_object)
|
98
|
+
return true if self.equal?(other_object)
|
99
|
+
self.class == other_object.class &&
|
100
|
+
id == other_object.id &&
|
101
|
+
name == other_object.name &&
|
102
|
+
access_uri == other_object.access_uri &&
|
103
|
+
object_name == other_object.object_name &&
|
104
|
+
access_type == other_object.access_type &&
|
105
|
+
time_expires == other_object.time_expires &&
|
106
|
+
time_created == other_object.time_created
|
107
|
+
end
|
108
|
+
|
109
|
+
# @see the `==` method
|
110
|
+
# @param [Object] other_object to be compared
|
111
|
+
def eql?(other_object)
|
112
|
+
self == other_object
|
113
|
+
end
|
114
|
+
|
115
|
+
# Calculates hash code according to all attributes.
|
116
|
+
# @return [Fixnum] Hash code
|
117
|
+
def hash
|
118
|
+
[id, name, access_uri, object_name, access_type, time_expires, time_created].hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.swagger_types.each_pair do |key, type|
|
127
|
+
if type =~ /^Array<(.*)>/i
|
128
|
+
# check to ensure the input is an array given that the the attribute
|
129
|
+
# is documented as an array but the input is not
|
130
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
131
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
132
|
+
end
|
133
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
134
|
+
self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
135
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
136
|
+
end
|
137
|
+
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Returns the string representation of the object
|
142
|
+
# @return [String] String presentation of the object
|
143
|
+
def to_s
|
144
|
+
to_hash.to_s
|
145
|
+
end
|
146
|
+
|
147
|
+
# Returns the object in the form of hash
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
149
|
+
def to_hash
|
150
|
+
hash = {}
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
152
|
+
value = self.send(attr)
|
153
|
+
next if value.nil?
|
154
|
+
hash[param] = _to_hash(value)
|
155
|
+
end
|
156
|
+
hash
|
157
|
+
end
|
158
|
+
|
159
|
+
private
|
160
|
+
|
161
|
+
# Outputs non-array value in the form of hash
|
162
|
+
# For object, use to_hash. Otherwise, just return the value
|
163
|
+
# @param [Object] value Any valid value
|
164
|
+
# @return [Hash] Returns the value in the form of hash
|
165
|
+
def _to_hash(value)
|
166
|
+
if value.is_a?(Array)
|
167
|
+
value.compact.map{ |v| _to_hash(v) }
|
168
|
+
elsif value.is_a?(Hash)
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
171
|
+
end
|
172
|
+
elsif value.respond_to? :to_hash
|
173
|
+
value.to_hash
|
174
|
+
else
|
175
|
+
value
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
182
|
+
def self.attribute_map
|
183
|
+
{
|
184
|
+
:'id' => :'id',
|
185
|
+
:'name' => :'name',
|
186
|
+
:'access_uri' => :'accessUri',
|
187
|
+
:'object_name' => :'objectName',
|
188
|
+
:'access_type' => :'accessType',
|
189
|
+
:'time_expires' => :'timeExpires',
|
190
|
+
:'time_created' => :'timeCreated'
|
191
|
+
}
|
192
|
+
end
|
193
|
+
|
194
|
+
# Attribute type mapping.
|
195
|
+
def self.swagger_types
|
196
|
+
{
|
197
|
+
:'id' => :'String',
|
198
|
+
:'name' => :'String',
|
199
|
+
:'access_uri' => :'String',
|
200
|
+
:'object_name' => :'String',
|
201
|
+
:'access_type' => :'String',
|
202
|
+
:'time_expires' => :'DateTime',
|
203
|
+
:'time_created' => :'DateTime'
|
204
|
+
}
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|