oci 2.3.7 → 2.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/oci/core/blockstorage_client.rb +56 -24
- data/lib/oci/core/compute_client.rb +578 -24
- data/lib/oci/core/core.rb +11 -0
- data/lib/oci/core/models/app_catalog_listing.rb +242 -0
- data/lib/oci/core/models/app_catalog_listing_resource_version.rb +295 -0
- data/lib/oci/core/models/app_catalog_listing_resource_version_agreements.rb +219 -0
- data/lib/oci/core/models/app_catalog_listing_resource_version_summary.rb +194 -0
- data/lib/oci/core/models/app_catalog_listing_summary.rb +188 -0
- data/lib/oci/core/models/app_catalog_subscription.rb +246 -0
- data/lib/oci/core/models/app_catalog_subscription_summary.rb +246 -0
- data/lib/oci/core/models/create_app_catalog_subscription_details.rb +232 -0
- data/lib/oci/core/models/create_nat_gateway_details.rb +239 -0
- data/lib/oci/core/models/launch_instance_details.rb +4 -0
- data/lib/oci/core/models/nat_gateway.rb +333 -0
- data/lib/oci/core/models/public_ip.rb +76 -13
- data/lib/oci/core/models/service_gateway.rb +9 -4
- data/lib/oci/core/models/update_nat_gateway_details.rb +208 -0
- data/lib/oci/core/models/update_service_gateway_details.rb +9 -4
- data/lib/oci/core/virtual_network_client.rb +546 -91
- data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
- data/lib/oci/object_storage/models/bucket.rb +18 -4
- data/lib/oci/object_storage/models/copy_object_details.rb +269 -0
- data/lib/oci/object_storage/models/multipart_upload.rb +1 -1
- data/lib/oci/object_storage/models/namespace_metadata.rb +1 -1
- data/lib/oci/object_storage/models/object_lifecycle_policy.rb +167 -0
- data/lib/oci/object_storage/models/object_lifecycle_rule.rb +245 -0
- data/lib/oci/object_storage/models/object_name_filter.rb +153 -0
- data/lib/oci/object_storage/models/preauthenticated_request.rb +1 -1
- data/lib/oci/object_storage/models/put_object_lifecycle_policy_details.rb +147 -0
- data/lib/oci/object_storage/models/restore_objects_details.rb +2 -2
- data/lib/oci/object_storage/models/work_request.rb +304 -0
- data/lib/oci/object_storage/models/work_request_error.rb +168 -0
- data/lib/oci/object_storage/models/work_request_log_entry.rb +156 -0
- data/lib/oci/object_storage/models/work_request_resource.rb +225 -0
- data/lib/oci/object_storage/models/work_request_resource_metadata_key.rb +12 -0
- data/lib/oci/object_storage/models/work_request_summary.rb +304 -0
- data/lib/oci/object_storage/object_storage.rb +12 -0
- data/lib/oci/object_storage/object_storage_client.rb +542 -17
- data/lib/oci/object_storage/object_storage_client_composite_operations.rb +53 -0
- data/lib/oci/version.rb +1 -1
- metadata +24 -2
@@ -8,7 +8,7 @@ module OCI
|
|
8
8
|
# objects that are too large for a single upload operation. With multipart uploads, individual parts of an object can be
|
9
9
|
# uploaded in parallel to reduce the amount of time you spend uploading. Multipart uploads can also minimize the impact
|
10
10
|
# of network failures by letting you retry a failed part upload instead of requiring you to retry an entire object upload.
|
11
|
-
# See [
|
11
|
+
# See [Managing Multipart Uploads](https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingmultipartuploads.htm).
|
12
12
|
#
|
13
13
|
# To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,
|
14
14
|
# talk to an administrator. If you're an administrator who needs to write policies to give users access, see
|
@@ -4,7 +4,7 @@ require 'date'
|
|
4
4
|
|
5
5
|
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
6
|
module OCI
|
7
|
-
# A
|
7
|
+
# A NamespaceMetadata is a map for storing namespace and defaultS3CompartmentId, defaultSwiftCompartmentId.
|
8
8
|
#
|
9
9
|
class ObjectStorage::Models::NamespaceMetadata # rubocop:disable Metrics/LineLength
|
10
10
|
# **[Required]** The namespace to which the metadata belongs.
|
@@ -0,0 +1,167 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# The collection of lifecycle policy rules that together form the object lifecycle policy of a given bucket.
|
8
|
+
#
|
9
|
+
class ObjectStorage::Models::ObjectLifecyclePolicy # rubocop:disable Metrics/LineLength
|
10
|
+
# The date and time the object lifecycle policy was created, as described in
|
11
|
+
# [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29.
|
12
|
+
#
|
13
|
+
# @return [DateTime]
|
14
|
+
attr_accessor :time_created
|
15
|
+
|
16
|
+
# The live lifecycle policy on the bucket.
|
17
|
+
#
|
18
|
+
# For an example of this value, see the
|
19
|
+
# [PutObjectLifecyclePolicy API documentation](https://docs.us-phoenix-1.oraclecloud.com/iaas/api/#/en/objectstorage/20160918/ObjectLifecyclePolicy/PutObjectLifecyclePolicy).
|
20
|
+
#
|
21
|
+
# @return [Array<OCI::ObjectStorage::Models::ObjectLifecycleRule>]
|
22
|
+
attr_accessor :items
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
# rubocop:disable Style/SymbolLiteral
|
28
|
+
'time_created': :'timeCreated',
|
29
|
+
'items': :'items'
|
30
|
+
# rubocop:enable Style/SymbolLiteral
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.swagger_types
|
36
|
+
{
|
37
|
+
# rubocop:disable Style/SymbolLiteral
|
38
|
+
'time_created': :'DateTime',
|
39
|
+
'items': :'Array<OCI::ObjectStorage::Models::ObjectLifecycleRule>'
|
40
|
+
# rubocop:enable Style/SymbolLiteral
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
45
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
46
|
+
|
47
|
+
|
48
|
+
# Initializes the object
|
49
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
50
|
+
# @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
|
51
|
+
# @option attributes [Array<OCI::ObjectStorage::Models::ObjectLifecycleRule>] :items The value to assign to the {#items} property
|
52
|
+
def initialize(attributes = {})
|
53
|
+
return unless attributes.is_a?(Hash)
|
54
|
+
|
55
|
+
# convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
57
|
+
|
58
|
+
self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
|
59
|
+
|
60
|
+
raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
|
61
|
+
|
62
|
+
self.time_created = attributes[:'time_created'] if attributes[:'time_created']
|
63
|
+
|
64
|
+
self.items = attributes[:'items'] if attributes[:'items']
|
65
|
+
end
|
66
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
67
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
68
|
+
|
69
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
70
|
+
|
71
|
+
|
72
|
+
# Checks equality by comparing each attribute.
|
73
|
+
# @param [Object] other the other object to be compared
|
74
|
+
def ==(other)
|
75
|
+
return true if equal?(other)
|
76
|
+
self.class == other.class &&
|
77
|
+
time_created == other.time_created &&
|
78
|
+
items == other.items
|
79
|
+
end
|
80
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] other the other object to be compared
|
84
|
+
def eql?(other)
|
85
|
+
self == other
|
86
|
+
end
|
87
|
+
|
88
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
89
|
+
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Fixnum] Hash code
|
93
|
+
def hash
|
94
|
+
[time_created, items].hash
|
95
|
+
end
|
96
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
97
|
+
|
98
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
99
|
+
|
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.swagger_types.each_pair do |key, type|
|
107
|
+
if type =~ /^Array<(.*)>/i
|
108
|
+
# check to ensure the input is an array given that the 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
|
+
public_method("#{key}=").call(
|
112
|
+
attributes[self.class.attribute_map[key]]
|
113
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
114
|
+
)
|
115
|
+
end
|
116
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
+
public_method("#{key}=").call(
|
118
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
119
|
+
)
|
120
|
+
end
|
121
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
122
|
+
end
|
123
|
+
|
124
|
+
self
|
125
|
+
end
|
126
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
127
|
+
|
128
|
+
# Returns the string representation of the object
|
129
|
+
# @return [String] String presentation of the object
|
130
|
+
def to_s
|
131
|
+
to_hash.to_s
|
132
|
+
end
|
133
|
+
|
134
|
+
# Returns the object in the form of hash
|
135
|
+
# @return [Hash] Returns the object in the form of hash
|
136
|
+
def to_hash
|
137
|
+
hash = {}
|
138
|
+
self.class.attribute_map.each_pair do |attr, param|
|
139
|
+
value = public_method(attr).call
|
140
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
141
|
+
hash[param] = _to_hash(value)
|
142
|
+
end
|
143
|
+
hash
|
144
|
+
end
|
145
|
+
|
146
|
+
private
|
147
|
+
|
148
|
+
# Outputs non-array value in the form of hash
|
149
|
+
# For object, use to_hash. Otherwise, just return the value
|
150
|
+
# @param [Object] value Any valid value
|
151
|
+
# @return [Hash] Returns the value in the form of hash
|
152
|
+
def _to_hash(value)
|
153
|
+
if value.is_a?(Array)
|
154
|
+
value.compact.map { |v| _to_hash(v) }
|
155
|
+
elsif value.is_a?(Hash)
|
156
|
+
{}.tap do |hash|
|
157
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
158
|
+
end
|
159
|
+
elsif value.respond_to? :to_hash
|
160
|
+
value.to_hash
|
161
|
+
else
|
162
|
+
value
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,245 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
7
|
+
module OCI
|
8
|
+
# To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,
|
9
|
+
# talk to an administrator. If you're an administrator who needs to write policies to give users access, see
|
10
|
+
# [Getting Started with Policies](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).
|
11
|
+
#
|
12
|
+
class ObjectStorage::Models::ObjectLifecycleRule # rubocop:disable Metrics/LineLength
|
13
|
+
TIME_UNIT_ENUM = [
|
14
|
+
TIME_UNIT_DAYS = 'DAYS'.freeze,
|
15
|
+
TIME_UNIT_YEARS = 'YEARS'.freeze,
|
16
|
+
TIME_UNIT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
17
|
+
].freeze
|
18
|
+
|
19
|
+
# **[Required]** The name of the lifecycle rule to be applied.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :name
|
22
|
+
|
23
|
+
# **[Required]** The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects into the
|
24
|
+
# [Archival Storage tier](https://docs.us-phoenix-1.oraclecloud.com/Content/Archive/Concepts/archivestorageoverview.htm). Rules using the action
|
25
|
+
# 'DELETE' permanently delete objects from buckets. 'ARCHIVE' and 'DELETE' are the only two supported
|
26
|
+
# actions at this time.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :action
|
30
|
+
|
31
|
+
# **[Required]** Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the
|
32
|
+
# timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
|
33
|
+
#
|
34
|
+
# @return [Integer]
|
35
|
+
attr_accessor :time_amount
|
36
|
+
|
37
|
+
# **[Required]** The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC.
|
38
|
+
# Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
attr_reader :time_unit
|
42
|
+
|
43
|
+
# **[Required]** A boolean that determines whether this rule is currently enabled.
|
44
|
+
# @return [BOOLEAN]
|
45
|
+
attr_accessor :is_enabled
|
46
|
+
|
47
|
+
# A filter limiting object names that the rule will apply to.
|
48
|
+
# @return [OCI::ObjectStorage::Models::ObjectNameFilter]
|
49
|
+
attr_accessor :object_name_filter
|
50
|
+
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
52
|
+
def self.attribute_map
|
53
|
+
{
|
54
|
+
# rubocop:disable Style/SymbolLiteral
|
55
|
+
'name': :'name',
|
56
|
+
'action': :'action',
|
57
|
+
'time_amount': :'timeAmount',
|
58
|
+
'time_unit': :'timeUnit',
|
59
|
+
'is_enabled': :'isEnabled',
|
60
|
+
'object_name_filter': :'objectNameFilter'
|
61
|
+
# rubocop:enable Style/SymbolLiteral
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# Attribute type mapping.
|
66
|
+
def self.swagger_types
|
67
|
+
{
|
68
|
+
# rubocop:disable Style/SymbolLiteral
|
69
|
+
'name': :'String',
|
70
|
+
'action': :'String',
|
71
|
+
'time_amount': :'Integer',
|
72
|
+
'time_unit': :'String',
|
73
|
+
'is_enabled': :'BOOLEAN',
|
74
|
+
'object_name_filter': :'OCI::ObjectStorage::Models::ObjectNameFilter'
|
75
|
+
# rubocop:enable Style/SymbolLiteral
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
80
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
81
|
+
|
82
|
+
|
83
|
+
# Initializes the object
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
# @option attributes [String] :name The value to assign to the {#name} property
|
86
|
+
# @option attributes [String] :action The value to assign to the {#action} property
|
87
|
+
# @option attributes [Integer] :time_amount The value to assign to the {#time_amount} property
|
88
|
+
# @option attributes [String] :time_unit The value to assign to the {#time_unit} property
|
89
|
+
# @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
|
90
|
+
# @option attributes [OCI::ObjectStorage::Models::ObjectNameFilter] :object_name_filter The value to assign to the {#object_name_filter} property
|
91
|
+
def initialize(attributes = {})
|
92
|
+
return unless attributes.is_a?(Hash)
|
93
|
+
|
94
|
+
# convert string to symbol for hash key
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
96
|
+
|
97
|
+
self.name = attributes[:'name'] if attributes[:'name']
|
98
|
+
|
99
|
+
self.action = attributes[:'action'] if attributes[:'action']
|
100
|
+
|
101
|
+
self.time_amount = attributes[:'timeAmount'] if attributes[:'timeAmount']
|
102
|
+
|
103
|
+
raise 'You cannot provide both :timeAmount and :time_amount' if attributes.key?(:'timeAmount') && attributes.key?(:'time_amount')
|
104
|
+
|
105
|
+
self.time_amount = attributes[:'time_amount'] if attributes[:'time_amount']
|
106
|
+
|
107
|
+
self.time_unit = attributes[:'timeUnit'] if attributes[:'timeUnit']
|
108
|
+
|
109
|
+
raise 'You cannot provide both :timeUnit and :time_unit' if attributes.key?(:'timeUnit') && attributes.key?(:'time_unit')
|
110
|
+
|
111
|
+
self.time_unit = attributes[:'time_unit'] if attributes[:'time_unit']
|
112
|
+
|
113
|
+
self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
|
114
|
+
|
115
|
+
raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
|
116
|
+
|
117
|
+
self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
|
118
|
+
|
119
|
+
self.object_name_filter = attributes[:'objectNameFilter'] if attributes[:'objectNameFilter']
|
120
|
+
|
121
|
+
raise 'You cannot provide both :objectNameFilter and :object_name_filter' if attributes.key?(:'objectNameFilter') && attributes.key?(:'object_name_filter')
|
122
|
+
|
123
|
+
self.object_name_filter = attributes[:'object_name_filter'] if attributes[:'object_name_filter']
|
124
|
+
end
|
125
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
126
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
127
|
+
|
128
|
+
# Custom attribute writer method checking allowed values (enum).
|
129
|
+
# @param [Object] time_unit Object to be assigned
|
130
|
+
def time_unit=(time_unit)
|
131
|
+
# rubocop:disable Style/ConditionalAssignment
|
132
|
+
if time_unit && !TIME_UNIT_ENUM.include?(time_unit)
|
133
|
+
# rubocop: disable Metrics/LineLength
|
134
|
+
OCI.logger.debug("Unknown value for 'time_unit' [" + time_unit + "]. Mapping to 'TIME_UNIT_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
135
|
+
# rubocop: enable Metrics/LineLength
|
136
|
+
@time_unit = TIME_UNIT_UNKNOWN_ENUM_VALUE
|
137
|
+
else
|
138
|
+
@time_unit = time_unit
|
139
|
+
end
|
140
|
+
# rubocop:enable Style/ConditionalAssignment
|
141
|
+
end
|
142
|
+
|
143
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
144
|
+
|
145
|
+
|
146
|
+
# Checks equality by comparing each attribute.
|
147
|
+
# @param [Object] other the other object to be compared
|
148
|
+
def ==(other)
|
149
|
+
return true if equal?(other)
|
150
|
+
self.class == other.class &&
|
151
|
+
name == other.name &&
|
152
|
+
action == other.action &&
|
153
|
+
time_amount == other.time_amount &&
|
154
|
+
time_unit == other.time_unit &&
|
155
|
+
is_enabled == other.is_enabled &&
|
156
|
+
object_name_filter == other.object_name_filter
|
157
|
+
end
|
158
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
159
|
+
|
160
|
+
# @see the `==` method
|
161
|
+
# @param [Object] other the other object to be compared
|
162
|
+
def eql?(other)
|
163
|
+
self == other
|
164
|
+
end
|
165
|
+
|
166
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
167
|
+
|
168
|
+
|
169
|
+
# Calculates hash code according to all attributes.
|
170
|
+
# @return [Fixnum] Hash code
|
171
|
+
def hash
|
172
|
+
[name, action, time_amount, time_unit, is_enabled, object_name_filter].hash
|
173
|
+
end
|
174
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
175
|
+
|
176
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
177
|
+
|
178
|
+
|
179
|
+
# Builds the object from hash
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
181
|
+
# @return [Object] Returns the model itself
|
182
|
+
def build_from_hash(attributes)
|
183
|
+
return nil unless attributes.is_a?(Hash)
|
184
|
+
self.class.swagger_types.each_pair do |key, type|
|
185
|
+
if type =~ /^Array<(.*)>/i
|
186
|
+
# check to ensure the input is an array given that the the attribute
|
187
|
+
# is documented as an array but the input is not
|
188
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
189
|
+
public_method("#{key}=").call(
|
190
|
+
attributes[self.class.attribute_map[key]]
|
191
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
192
|
+
)
|
193
|
+
end
|
194
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
195
|
+
public_method("#{key}=").call(
|
196
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
197
|
+
)
|
198
|
+
end
|
199
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
200
|
+
end
|
201
|
+
|
202
|
+
self
|
203
|
+
end
|
204
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
205
|
+
|
206
|
+
# Returns the string representation of the object
|
207
|
+
# @return [String] String presentation of the object
|
208
|
+
def to_s
|
209
|
+
to_hash.to_s
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the object in the form of hash
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
214
|
+
def to_hash
|
215
|
+
hash = {}
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
217
|
+
value = public_method(attr).call
|
218
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
219
|
+
hash[param] = _to_hash(value)
|
220
|
+
end
|
221
|
+
hash
|
222
|
+
end
|
223
|
+
|
224
|
+
private
|
225
|
+
|
226
|
+
# Outputs non-array value in the form of hash
|
227
|
+
# For object, use to_hash. Otherwise, just return the value
|
228
|
+
# @param [Object] value Any valid value
|
229
|
+
# @return [Hash] Returns the value in the form of hash
|
230
|
+
def _to_hash(value)
|
231
|
+
if value.is_a?(Array)
|
232
|
+
value.compact.map { |v| _to_hash(v) }
|
233
|
+
elsif value.is_a?(Hash)
|
234
|
+
{}.tap do |hash|
|
235
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
236
|
+
end
|
237
|
+
elsif value.respond_to? :to_hash
|
238
|
+
value.to_hash
|
239
|
+
else
|
240
|
+
value
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# A filter that compares object names to a set of object name prefixes to determine if a rule applies to a
|
8
|
+
# given object.
|
9
|
+
#
|
10
|
+
class ObjectStorage::Models::ObjectNameFilter # rubocop:disable Metrics/LineLength
|
11
|
+
# An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
|
12
|
+
#
|
13
|
+
# @return [Array<String>]
|
14
|
+
attr_accessor :inclusion_prefixes
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
# rubocop:disable Style/SymbolLiteral
|
20
|
+
'inclusion_prefixes': :'inclusionPrefixes'
|
21
|
+
# rubocop:enable Style/SymbolLiteral
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Attribute type mapping.
|
26
|
+
def self.swagger_types
|
27
|
+
{
|
28
|
+
# rubocop:disable Style/SymbolLiteral
|
29
|
+
'inclusion_prefixes': :'Array<String>'
|
30
|
+
# rubocop:enable Style/SymbolLiteral
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
35
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
36
|
+
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
# @option attributes [Array<String>] :inclusion_prefixes The value to assign to the {#inclusion_prefixes} property
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
# convert string to symbol for hash key
|
45
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
46
|
+
|
47
|
+
self.inclusion_prefixes = attributes[:'inclusionPrefixes'] if attributes[:'inclusionPrefixes']
|
48
|
+
|
49
|
+
raise 'You cannot provide both :inclusionPrefixes and :inclusion_prefixes' if attributes.key?(:'inclusionPrefixes') && attributes.key?(:'inclusion_prefixes')
|
50
|
+
|
51
|
+
self.inclusion_prefixes = attributes[:'inclusion_prefixes'] if attributes[:'inclusion_prefixes']
|
52
|
+
end
|
53
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
54
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
55
|
+
|
56
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
57
|
+
|
58
|
+
|
59
|
+
# Checks equality by comparing each attribute.
|
60
|
+
# @param [Object] other the other object to be compared
|
61
|
+
def ==(other)
|
62
|
+
return true if equal?(other)
|
63
|
+
self.class == other.class &&
|
64
|
+
inclusion_prefixes == other.inclusion_prefixes
|
65
|
+
end
|
66
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
67
|
+
|
68
|
+
# @see the `==` method
|
69
|
+
# @param [Object] other the other object to be compared
|
70
|
+
def eql?(other)
|
71
|
+
self == other
|
72
|
+
end
|
73
|
+
|
74
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
75
|
+
|
76
|
+
|
77
|
+
# Calculates hash code according to all attributes.
|
78
|
+
# @return [Fixnum] Hash code
|
79
|
+
def hash
|
80
|
+
[inclusion_prefixes].hash
|
81
|
+
end
|
82
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
83
|
+
|
84
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
85
|
+
|
86
|
+
|
87
|
+
# Builds the object from hash
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
# @return [Object] Returns the model itself
|
90
|
+
def build_from_hash(attributes)
|
91
|
+
return nil unless attributes.is_a?(Hash)
|
92
|
+
self.class.swagger_types.each_pair do |key, type|
|
93
|
+
if type =~ /^Array<(.*)>/i
|
94
|
+
# check to ensure the input is an array given that the the attribute
|
95
|
+
# is documented as an array but the input is not
|
96
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
97
|
+
public_method("#{key}=").call(
|
98
|
+
attributes[self.class.attribute_map[key]]
|
99
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
100
|
+
)
|
101
|
+
end
|
102
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
103
|
+
public_method("#{key}=").call(
|
104
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
105
|
+
)
|
106
|
+
end
|
107
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
+
end
|
109
|
+
|
110
|
+
self
|
111
|
+
end
|
112
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
113
|
+
|
114
|
+
# Returns the string representation of the object
|
115
|
+
# @return [String] String presentation of the object
|
116
|
+
def to_s
|
117
|
+
to_hash.to_s
|
118
|
+
end
|
119
|
+
|
120
|
+
# Returns the object in the form of hash
|
121
|
+
# @return [Hash] Returns the object in the form of hash
|
122
|
+
def to_hash
|
123
|
+
hash = {}
|
124
|
+
self.class.attribute_map.each_pair do |attr, param|
|
125
|
+
value = public_method(attr).call
|
126
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
127
|
+
hash[param] = _to_hash(value)
|
128
|
+
end
|
129
|
+
hash
|
130
|
+
end
|
131
|
+
|
132
|
+
private
|
133
|
+
|
134
|
+
# Outputs non-array value in the form of hash
|
135
|
+
# For object, use to_hash. Otherwise, just return the value
|
136
|
+
# @param [Object] value Any valid value
|
137
|
+
# @return [Hash] Returns the value in the form of hash
|
138
|
+
def _to_hash(value)
|
139
|
+
if value.is_a?(Array)
|
140
|
+
value.compact.map { |v| _to_hash(v) }
|
141
|
+
elsif value.is_a?(Hash)
|
142
|
+
{}.tap do |hash|
|
143
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
144
|
+
end
|
145
|
+
elsif value.respond_to? :to_hash
|
146
|
+
value.to_hash
|
147
|
+
else
|
148
|
+
value
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|