oci 2.3.9 → 2.4.0

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.
@@ -7,6 +7,8 @@ require 'logger'
7
7
  module OCI
8
8
  # A point-in-time snapshot of a specified file system.
9
9
  #
10
+ # **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
11
+ #
10
12
  class FileStorage::Models::Snapshot # rubocop:disable Metrics/LineLength
11
13
  LIFECYCLE_STATE_ENUM = [
12
14
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
@@ -47,6 +49,21 @@ module OCI
47
49
  # @return [DateTime]
48
50
  attr_accessor :time_created
49
51
 
52
+ # Free-form tags for this resource. Each tag is a simple key-value pair
53
+ # with no predefined name, type, or namespace.
54
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
55
+ # Example: `{\"Department\": \"Finance\"}`
56
+ #
57
+ # @return [Hash<String, String>]
58
+ attr_accessor :freeform_tags
59
+
60
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
61
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
62
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
63
+ #
64
+ # @return [Hash<String, Hash<String, Object>>]
65
+ attr_accessor :defined_tags
66
+
50
67
  # Attribute mapping from ruby-style variable name to JSON key.
51
68
  def self.attribute_map
52
69
  {
@@ -55,7 +72,9 @@ module OCI
55
72
  'id': :'id',
56
73
  'lifecycle_state': :'lifecycleState',
57
74
  'name': :'name',
58
- 'time_created': :'timeCreated'
75
+ 'time_created': :'timeCreated',
76
+ 'freeform_tags': :'freeformTags',
77
+ 'defined_tags': :'definedTags'
59
78
  # rubocop:enable Style/SymbolLiteral
60
79
  }
61
80
  end
@@ -68,7 +87,9 @@ module OCI
68
87
  'id': :'String',
69
88
  'lifecycle_state': :'String',
70
89
  'name': :'String',
71
- 'time_created': :'DateTime'
90
+ 'time_created': :'DateTime',
91
+ 'freeform_tags': :'Hash<String, String>',
92
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
72
93
  # rubocop:enable Style/SymbolLiteral
73
94
  }
74
95
  end
@@ -84,6 +105,8 @@ module OCI
84
105
  # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
85
106
  # @option attributes [String] :name The value to assign to the {#name} property
86
107
  # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
108
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
109
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
87
110
  def initialize(attributes = {})
88
111
  return unless attributes.is_a?(Hash)
89
112
 
@@ -111,6 +134,18 @@ module OCI
111
134
  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
112
135
 
113
136
  self.time_created = attributes[:'time_created'] if attributes[:'time_created']
137
+
138
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
139
+
140
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
141
+
142
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
143
+
144
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
145
+
146
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
147
+
148
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
114
149
  end
115
150
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
116
151
  # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
@@ -143,7 +178,9 @@ module OCI
143
178
  id == other.id &&
144
179
  lifecycle_state == other.lifecycle_state &&
145
180
  name == other.name &&
146
- time_created == other.time_created
181
+ time_created == other.time_created &&
182
+ freeform_tags == other.freeform_tags &&
183
+ defined_tags == other.defined_tags
147
184
  end
148
185
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
149
186
 
@@ -159,7 +196,7 @@ module OCI
159
196
  # Calculates hash code according to all attributes.
160
197
  # @return [Fixnum] Hash code
161
198
  def hash
162
- [file_system_id, id, lifecycle_state, name, time_created].hash
199
+ [file_system_id, id, lifecycle_state, name, time_created, freeform_tags, defined_tags].hash
163
200
  end
164
201
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
165
202
 
@@ -14,11 +14,28 @@ module OCI
14
14
  # @return [String]
15
15
  attr_accessor :display_name
16
16
 
17
+ # Free-form tags for this resource. Each tag is a simple key-value pair
18
+ # with no predefined name, type, or namespace.
19
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
20
+ # Example: `{\"Department\": \"Finance\"}`
21
+ #
22
+ # @return [Hash<String, String>]
23
+ attr_accessor :freeform_tags
24
+
25
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
26
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
27
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
28
+ #
29
+ # @return [Hash<String, Hash<String, Object>>]
30
+ attr_accessor :defined_tags
31
+
17
32
  # Attribute mapping from ruby-style variable name to JSON key.
18
33
  def self.attribute_map
19
34
  {
20
35
  # rubocop:disable Style/SymbolLiteral
21
- 'display_name': :'displayName'
36
+ 'display_name': :'displayName',
37
+ 'freeform_tags': :'freeformTags',
38
+ 'defined_tags': :'definedTags'
22
39
  # rubocop:enable Style/SymbolLiteral
23
40
  }
24
41
  end
@@ -27,7 +44,9 @@ module OCI
27
44
  def self.swagger_types
28
45
  {
29
46
  # rubocop:disable Style/SymbolLiteral
30
- 'display_name': :'String'
47
+ 'display_name': :'String',
48
+ 'freeform_tags': :'Hash<String, String>',
49
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
31
50
  # rubocop:enable Style/SymbolLiteral
32
51
  }
33
52
  end
@@ -39,6 +58,8 @@ module OCI
39
58
  # Initializes the object
40
59
  # @param [Hash] attributes Model attributes in the form of hash
41
60
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
61
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
62
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
42
63
  def initialize(attributes = {})
43
64
  return unless attributes.is_a?(Hash)
44
65
 
@@ -50,6 +71,18 @@ module OCI
50
71
  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
51
72
 
52
73
  self.display_name = attributes[:'display_name'] if attributes[:'display_name']
74
+
75
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
76
+
77
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
78
+
79
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
80
+
81
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
82
+
83
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
84
+
85
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
53
86
  end
54
87
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
55
88
  # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
@@ -63,7 +96,9 @@ module OCI
63
96
  return true if equal?(other)
64
97
 
65
98
  self.class == other.class &&
66
- display_name == other.display_name
99
+ display_name == other.display_name &&
100
+ freeform_tags == other.freeform_tags &&
101
+ defined_tags == other.defined_tags
67
102
  end
68
103
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
69
104
 
@@ -79,7 +114,7 @@ module OCI
79
114
  # Calculates hash code according to all attributes.
80
115
  # @return [Fixnum] Hash code
81
116
  def hash
82
- [display_name].hash
117
+ [display_name, freeform_tags, defined_tags].hash
83
118
  end
84
119
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
85
120
 
@@ -14,11 +14,28 @@ module OCI
14
14
  # @return [String]
15
15
  attr_accessor :display_name
16
16
 
17
+ # Free-form tags for this resource. Each tag is a simple key-value pair
18
+ # with no predefined name, type, or namespace.
19
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
20
+ # Example: `{\"Department\": \"Finance\"}`
21
+ #
22
+ # @return [Hash<String, String>]
23
+ attr_accessor :freeform_tags
24
+
25
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
26
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
27
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
28
+ #
29
+ # @return [Hash<String, Hash<String, Object>>]
30
+ attr_accessor :defined_tags
31
+
17
32
  # Attribute mapping from ruby-style variable name to JSON key.
18
33
  def self.attribute_map
19
34
  {
20
35
  # rubocop:disable Style/SymbolLiteral
21
- 'display_name': :'displayName'
36
+ 'display_name': :'displayName',
37
+ 'freeform_tags': :'freeformTags',
38
+ 'defined_tags': :'definedTags'
22
39
  # rubocop:enable Style/SymbolLiteral
23
40
  }
24
41
  end
@@ -27,7 +44,9 @@ module OCI
27
44
  def self.swagger_types
28
45
  {
29
46
  # rubocop:disable Style/SymbolLiteral
30
- 'display_name': :'String'
47
+ 'display_name': :'String',
48
+ 'freeform_tags': :'Hash<String, String>',
49
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
31
50
  # rubocop:enable Style/SymbolLiteral
32
51
  }
33
52
  end
@@ -39,6 +58,8 @@ module OCI
39
58
  # Initializes the object
40
59
  # @param [Hash] attributes Model attributes in the form of hash
41
60
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
61
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
62
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
42
63
  def initialize(attributes = {})
43
64
  return unless attributes.is_a?(Hash)
44
65
 
@@ -50,6 +71,18 @@ module OCI
50
71
  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
51
72
 
52
73
  self.display_name = attributes[:'display_name'] if attributes[:'display_name']
74
+
75
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
76
+
77
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
78
+
79
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
80
+
81
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
82
+
83
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
84
+
85
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
53
86
  end
54
87
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
55
88
  # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
@@ -63,7 +96,9 @@ module OCI
63
96
  return true if equal?(other)
64
97
 
65
98
  self.class == other.class &&
66
- display_name == other.display_name
99
+ display_name == other.display_name &&
100
+ freeform_tags == other.freeform_tags &&
101
+ defined_tags == other.defined_tags
67
102
  end
68
103
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
69
104
 
@@ -79,7 +114,7 @@ module OCI
79
114
  # Calculates hash code according to all attributes.
80
115
  # @return [Fixnum] Hash code
81
116
  def hash
82
- [display_name].hash
117
+ [display_name, freeform_tags, defined_tags].hash
83
118
  end
84
119
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
85
120
 
@@ -0,0 +1,174 @@
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
+ # UpdateSnapshotDetails model.
8
+ class FileStorage::Models::UpdateSnapshotDetails # rubocop:disable Metrics/LineLength
9
+ # Free-form tags for this resource. Each tag is a simple key-value pair
10
+ # with no predefined name, type, or namespace.
11
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
12
+ # Example: `{\"Department\": \"Finance\"}`
13
+ #
14
+ # @return [Hash<String, String>]
15
+ attr_accessor :freeform_tags
16
+
17
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
18
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
19
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
20
+ #
21
+ # @return [Hash<String, Hash<String, Object>>]
22
+ attr_accessor :defined_tags
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'freeform_tags': :'freeformTags',
29
+ 'defined_tags': :'definedTags'
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
+ 'freeform_tags': :'Hash<String, String>',
39
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
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 [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
51
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} 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.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
59
+
60
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
61
+
62
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
63
+
64
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
65
+
66
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
67
+
68
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
69
+ end
70
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
71
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
72
+
73
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
74
+
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] other the other object to be compared
78
+ def ==(other)
79
+ return true if equal?(other)
80
+
81
+ self.class == other.class &&
82
+ freeform_tags == other.freeform_tags &&
83
+ defined_tags == other.defined_tags
84
+ end
85
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
86
+
87
+ # @see the `==` method
88
+ # @param [Object] other the other object to be compared
89
+ def eql?(other)
90
+ self == other
91
+ end
92
+
93
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
94
+
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [freeform_tags, defined_tags].hash
100
+ end
101
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
102
+
103
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
104
+
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+
112
+ self.class.swagger_types.each_pair do |key, type|
113
+ if type =~ /^Array<(.*)>/i
114
+ # check to ensure the input is an array given that the the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ public_method("#{key}=").call(
118
+ attributes[self.class.attribute_map[key]]
119
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
120
+ )
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ public_method("#{key}=").call(
124
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
125
+ )
126
+ end
127
+ # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
133
+
134
+ # Returns the string representation of the object
135
+ # @return [String] String presentation of the object
136
+ def to_s
137
+ to_hash.to_s
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = public_method(attr).call
146
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
147
+
148
+ hash[param] = _to_hash(value)
149
+ end
150
+ hash
151
+ end
152
+
153
+ private
154
+
155
+ # Outputs non-array value in the form of hash
156
+ # For object, use to_hash. Otherwise, just return the value
157
+ # @param [Object] value Any valid value
158
+ # @return [Hash] Returns the value in the form of hash
159
+ def _to_hash(value)
160
+ if value.is_a?(Array)
161
+ value.compact.map { |v| _to_hash(v) }
162
+ elsif value.is_a?(Hash)
163
+ {}.tap do |hash|
164
+ value.each { |k, v| hash[k] = _to_hash(v) }
165
+ end
166
+ elsif value.respond_to? :to_hash
167
+ value.to_hash
168
+ else
169
+ value
170
+ end
171
+ end
172
+ end
173
+ end
174
+ # rubocop:enable Lint/UnneededCopDisableDirective
data/lib/oci/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  module OCI
4
- VERSION = '2.3.9'.freeze
4
+ VERSION = '2.4.0'.freeze
5
5
  end