oci 2.5.9 → 2.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/autoscaling/auto_scaling_client.rb +73 -0
  4. data/lib/oci/autoscaling/autoscaling.rb +1 -0
  5. data/lib/oci/autoscaling/models/change_auto_scaling_compartment_details.rb +154 -0
  6. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +0 -1
  7. data/lib/oci/container_engine/models/work_request_error.rb +0 -1
  8. data/lib/oci/core/blockstorage_client.rb +342 -0
  9. data/lib/oci/core/compute_client.rb +77 -5
  10. data/lib/oci/core/compute_client_composite_operations.rb +3 -3
  11. data/lib/oci/core/compute_management_client.rb +211 -0
  12. data/lib/oci/core/core.rb +27 -0
  13. data/lib/oci/core/models/add_network_security_group_security_rules_details.rb +153 -0
  14. data/lib/oci/core/models/add_security_rule_details.rb +388 -0
  15. data/lib/oci/core/models/added_network_security_group_security_rules.rb +153 -0
  16. data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +153 -0
  17. data/lib/oci/core/models/change_boot_volume_compartment_details.rb +153 -0
  18. data/lib/oci/core/models/change_image_compartment_details.rb +154 -0
  19. data/lib/oci/core/models/change_instance_configuration_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_instance_pool_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/change_nat_gateway_compartment_details.rb +153 -0
  22. data/lib/oci/core/models/change_route_table_compartment_details.rb +155 -0
  23. data/lib/oci/core/models/change_security_list_compartment_details.rb +155 -0
  24. data/lib/oci/core/models/change_service_gateway_compartment_details.rb +155 -0
  25. data/lib/oci/core/models/change_subnet_compartment_details.rb +155 -0
  26. data/lib/oci/core/models/change_vcn_compartment_details.rb +155 -0
  27. data/lib/oci/core/models/change_volume_backup_compartment_details.rb +153 -0
  28. data/lib/oci/core/models/change_volume_compartment_details.rb +153 -0
  29. data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +153 -0
  30. data/lib/oci/core/models/change_volume_group_compartment_details.rb +153 -0
  31. data/lib/oci/core/models/create_network_security_group_details.rb +223 -0
  32. data/lib/oci/core/models/create_vnic_details.rb +18 -1
  33. data/lib/oci/core/models/image.rb +2 -1
  34. data/lib/oci/core/models/instance_configuration.rb +3 -1
  35. data/lib/oci/core/models/instance_configuration_create_vnic_details.rb +18 -1
  36. data/lib/oci/core/models/instance_configuration_instance_source_via_image_details.rb +15 -1
  37. data/lib/oci/core/models/instance_configuration_summary.rb +3 -3
  38. data/lib/oci/core/models/instance_pool.rb +4 -1
  39. data/lib/oci/core/models/instance_pool_summary.rb +3 -3
  40. data/lib/oci/core/models/network_security_group.rb +324 -0
  41. data/lib/oci/core/models/network_security_group_vnic.rb +188 -0
  42. data/lib/oci/core/models/remove_network_security_group_security_rules_details.rb +154 -0
  43. data/lib/oci/core/models/security_list.rb +5 -0
  44. data/lib/oci/core/models/security_rule.rb +455 -0
  45. data/lib/oci/core/models/update_network_security_group_details.rb +189 -0
  46. data/lib/oci/core/models/update_network_security_group_security_rules_details.rb +153 -0
  47. data/lib/oci/core/models/update_security_rule_details.rb +404 -0
  48. data/lib/oci/core/models/update_vnic_details.rb +20 -1
  49. data/lib/oci/core/models/updated_network_security_group_security_rules.rb +153 -0
  50. data/lib/oci/core/models/vnic.rb +18 -1
  51. data/lib/oci/core/virtual_network_client.rb +1228 -132
  52. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  53. data/lib/oci/database/database.rb +19 -0
  54. data/lib/oci/database/database_client.rb +1066 -46
  55. data/lib/oci/database/database_client_composite_operations.rb +317 -0
  56. data/lib/oci/database/models/autonomous_container_database.rb +416 -0
  57. data/lib/oci/database/models/autonomous_container_database_backup_config.rb +157 -0
  58. data/lib/oci/database/models/autonomous_container_database_summary.rb +420 -0
  59. data/lib/oci/database/models/autonomous_database.rb +58 -1
  60. data/lib/oci/database/models/autonomous_database_backup.rb +16 -1
  61. data/lib/oci/database/models/autonomous_database_backup_summary.rb +16 -1
  62. data/lib/oci/database/models/autonomous_database_connection_strings.rb +11 -1
  63. data/lib/oci/database/models/autonomous_database_connection_urls.rb +170 -0
  64. data/lib/oci/database/models/autonomous_database_summary.rb +58 -1
  65. data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +224 -0
  66. data/lib/oci/database/models/autonomous_exadata_infrastructure.rb +419 -0
  67. data/lib/oci/database/models/autonomous_exadata_infrastructure_maintenance_window.rb +186 -0
  68. data/lib/oci/database/models/autonomous_exadata_infrastructure_shape_summary.rb +224 -0
  69. data/lib/oci/database/models/autonomous_exadata_infrastructure_summary.rb +436 -0
  70. data/lib/oci/database/models/backup.rb +1 -0
  71. data/lib/oci/database/models/backup_summary.rb +1 -0
  72. data/lib/oci/database/models/create_autonomous_container_database_details.rb +284 -0
  73. data/lib/oci/database/models/create_autonomous_database_base.rb +46 -1
  74. data/lib/oci/database/models/create_autonomous_database_clone_details.rb +13 -1
  75. data/lib/oci/database/models/create_autonomous_database_details.rb +13 -1
  76. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +34 -1
  77. data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
  78. data/lib/oci/database/models/day_of_week.rb +174 -0
  79. data/lib/oci/database/models/db_system.rb +34 -1
  80. data/lib/oci/database/models/db_system_summary.rb +34 -1
  81. data/lib/oci/database/models/launch_autonomous_exadata_infrastructure_details.rb +304 -0
  82. data/lib/oci/database/models/launch_db_system_base.rb +35 -2
  83. data/lib/oci/database/models/launch_db_system_details.rb +11 -2
  84. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +11 -2
  85. data/lib/oci/database/models/maintenance_run.rb +392 -0
  86. data/lib/oci/database/models/maintenance_run_summary.rb +395 -0
  87. data/lib/oci/database/models/maintenance_window.rb +226 -0
  88. data/lib/oci/database/models/month.rb +179 -0
  89. data/lib/oci/database/models/restore_autonomous_database_details.rb +30 -4
  90. data/lib/oci/database/models/update_autonomous_container_database_details.rb +230 -0
  91. data/lib/oci/database/models/update_autonomous_database_details.rb +18 -1
  92. data/lib/oci/database/models/update_autonomous_exadata_infrastructure_details.rb +203 -0
  93. data/lib/oci/database/models/update_db_system_details.rb +37 -4
  94. data/lib/oci/database/models/update_maintenance_run_details.rb +154 -0
  95. data/lib/oci/email/email.rb +1 -0
  96. data/lib/oci/email/email_client.rb +62 -0
  97. data/lib/oci/email/models/change_sender_compartment_details.rb +157 -0
  98. data/lib/oci/key_management/key_management.rb +1 -0
  99. data/lib/oci/key_management/kms_crypto_client.rb +4 -4
  100. data/lib/oci/key_management/kms_management_client.rb +161 -10
  101. data/lib/oci/key_management/kms_management_client_composite_operations.rb +79 -0
  102. data/lib/oci/key_management/kms_vault_client.rb +16 -11
  103. data/lib/oci/key_management/models/key.rb +17 -1
  104. data/lib/oci/key_management/models/schedule_key_deletion_details.rb +156 -0
  105. data/lib/oci/load_balancer/load_balancer.rb +1 -0
  106. data/lib/oci/load_balancer/load_balancer_client.rb +64 -0
  107. data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
  108. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +16 -1
  109. data/lib/oci/load_balancer/models/load_balancer.rb +16 -1
  110. data/lib/oci/load_balancer/models/remove_http_request_header_rule.rb +1 -1
  111. data/lib/oci/load_balancer/models/remove_http_response_header_rule.rb +1 -1
  112. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +9 -5
  113. data/lib/oci/load_balancer/models/update_backend_set_details.rb +2 -0
  114. data/lib/oci/load_balancer/models/update_network_security_groups_details.rb +154 -0
  115. data/lib/oci/monitoring/models/metric.rb +1 -0
  116. data/lib/oci/object_storage/models/work_request_error.rb +1 -0
  117. data/lib/oci/resource_manager/models/change_stack_compartment_details.rb +155 -0
  118. data/lib/oci/resource_manager/models/work_request.rb +293 -0
  119. data/lib/oci/resource_manager/models/work_request_error.rb +170 -0
  120. data/lib/oci/resource_manager/models/work_request_log_entry.rb +159 -0
  121. data/lib/oci/resource_manager/models/work_request_resource.rb +217 -0
  122. data/lib/oci/resource_manager/models/work_request_summary.rb +254 -0
  123. data/lib/oci/resource_manager/resource_manager.rb +6 -0
  124. data/lib/oci/resource_manager/resource_manager_client.rb +338 -0
  125. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +50 -0
  126. data/lib/oci/streaming/stream_admin_client.rb +2 -2
  127. data/lib/oci/streaming/stream_client.rb +1 -1
  128. data/lib/oci/version.rb +1 -1
  129. metadata +58 -2
@@ -9,7 +9,7 @@ module OCI
9
9
  #
10
10
  # If the same header appears more than once in the request, the load balancer removes all occurances of the specified header.
11
11
  #
12
- # **NOTE:** The system does not distinquish between underscore and dash characters in headers. That is, it treats
12
+ # **Note:** The system does not distinquish between underscore and dash characters in headers. That is, it treats
13
13
  # `example_header_name` and `example-header-name` as identical. Oracle recommends that you do not rely on underscore
14
14
  # or dash characters to uniquely distinguish header names.
15
15
  #
@@ -9,7 +9,7 @@ module OCI
9
9
  #
10
10
  # If the same header appears more than once in the response, the load balancer removes all occurances of the specified header.
11
11
  #
12
- # **NOTE:** The system does not distinquish between underscore and dash characters in headers. That is, it treats
12
+ # **Note:** The system does not distinquish between underscore and dash characters in headers. That is, it treats
13
13
  # `example_header_name` and `example-header-name` as identical. Oracle recommends that you do not rely on underscore
14
14
  # or dash characters to uniquely distinguish header names.
15
15
  #
@@ -4,17 +4,21 @@ require 'date'
4
4
 
5
5
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
6
  module OCI
7
- # The configuration details for implementing session persistence. Session persistence enables the Load Balancing
8
- # Service to direct any number of requests that originate from a single logical client to a single backend web server.
9
- # For more information, see [Session Persistence](https://docs.cloud.oracle.com/Content/Balance/Reference/sessionpersistence.htm).
7
+ # The configuration details for implementing session persistence based on a user-specified cookie name (application
8
+ # cookie stickiness).
10
9
  #
10
+ # Session persistence enables the Load Balancing service to direct any number of requests that originate from a single
11
+ # logical client to a single backend web server. For more information, see
12
+ # [Session Persistence](https://docs.cloud.oracle.com/Content/Balance/Reference/sessionpersistence.htm).
11
13
  #
12
- # To disable session persistence on a running load balancer, use the
13
- # {#update_backend_set update_backend_set} operation and specify \"null\" for the
14
+ # To disable application cookie stickiness on a running load balancer, use the
15
+ # {#update_backend_set update_backend_set} operation and specify `null` for the
14
16
  # `SessionPersistenceConfigurationDetails` object.
15
17
  #
16
18
  # Example: `SessionPersistenceConfigurationDetails: null`
17
19
  #
20
+ # **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
21
+ #
18
22
  class LoadBalancer::Models::SessionPersistenceConfigurationDetails
19
23
  # **[Required]** The name of the cookie used to detect a session initiated by the backend server. Use '*' to specify
20
24
  # that any cookie set by the backend causes the session to persist.
@@ -8,6 +8,8 @@ module OCI
8
8
  # For more information on backend set configuration, see
9
9
  # [Managing Backend Sets](https://docs.cloud.oracle.com/Content/Balance/Tasks/managingbackendsets.htm).
10
10
  #
11
+ # **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
12
+ #
11
13
  class LoadBalancer::Models::UpdateBackendSetDetails
12
14
  # **[Required]** The load balancer policy for the backend set. To get a list of available policies, use the
13
15
  # {#list_policies list_policies} operation.
@@ -0,0 +1,154 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # An object representing an updated list of NSGs that overwrites the existing list of NSGs. In particular, if the load balancer had no prior NSGs configured, these with be the new NSGs to be used by the load balancer. If the load balancer used to have a list of NSGs configured, and this list contains no entries, then the load balancer will contain no NSGs after this call completes.
8
+ class LoadBalancer::Models::UpdateNetworkSecurityGroupsDetails
9
+ # The array of NSG [OCIDs](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) to be used by this Load Balancer.
10
+ #
11
+ # @return [Array<String>]
12
+ attr_accessor :network_security_group_ids
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ # rubocop:disable Style/SymbolLiteral
18
+ 'network_security_group_ids': :'networkSecurityGroupIds'
19
+ # rubocop:enable Style/SymbolLiteral
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ # rubocop:disable Style/SymbolLiteral
27
+ 'network_security_group_ids': :'Array<String>'
28
+ # rubocop:enable Style/SymbolLiteral
29
+ }
30
+ end
31
+
32
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
33
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
34
+
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ # @option attributes [Array<String>] :network_security_group_ids The value to assign to the {#network_security_group_ids} property
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ self.network_security_group_ids = attributes[:'networkSecurityGroupIds'] if attributes[:'networkSecurityGroupIds']
46
+
47
+ raise 'You cannot provide both :networkSecurityGroupIds and :network_security_group_ids' if attributes.key?(:'networkSecurityGroupIds') && attributes.key?(:'network_security_group_ids')
48
+
49
+ self.network_security_group_ids = attributes[:'network_security_group_ids'] if attributes[:'network_security_group_ids']
50
+ end
51
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
52
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
53
+
54
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
55
+
56
+
57
+ # Checks equality by comparing each attribute.
58
+ # @param [Object] other the other object to be compared
59
+ def ==(other)
60
+ return true if equal?(other)
61
+
62
+ self.class == other.class &&
63
+ network_security_group_ids == other.network_security_group_ids
64
+ end
65
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
66
+
67
+ # @see the `==` method
68
+ # @param [Object] other the other object to be compared
69
+ def eql?(other)
70
+ self == other
71
+ end
72
+
73
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
74
+
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Fixnum] Hash code
78
+ def hash
79
+ [network_security_group_ids].hash
80
+ end
81
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
82
+
83
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
84
+
85
+
86
+ # Builds the object from hash
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ # @return [Object] Returns the model itself
89
+ def build_from_hash(attributes)
90
+ return nil unless attributes.is_a?(Hash)
91
+
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
+
128
+ hash[param] = _to_hash(value)
129
+ end
130
+ hash
131
+ end
132
+
133
+ private
134
+
135
+ # Outputs non-array value in the form of hash
136
+ # For object, use to_hash. Otherwise, just return the value
137
+ # @param [Object] value Any valid value
138
+ # @return [Hash] Returns the value in the form of hash
139
+ def _to_hash(value)
140
+ if value.is_a?(Array)
141
+ value.compact.map { |v| _to_hash(v) }
142
+ elsif value.is_a?(Hash)
143
+ {}.tap do |hash|
144
+ value.each { |k, v| hash[k] = _to_hash(v) }
145
+ end
146
+ elsif value.respond_to? :to_hash
147
+ value.to_hash
148
+ else
149
+ value
150
+ end
151
+ end
152
+ end
153
+ end
154
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -1,6 +1,7 @@
1
1
  # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
+ require 'logger'
4
5
 
5
6
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
7
  module OCI
@@ -1,6 +1,7 @@
1
1
  # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
+ require 'logger'
4
5
 
5
6
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
7
  module OCI
@@ -0,0 +1,155 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # Defines the requirements and properties of changeStackCompartment operation.
8
+ class ResourceManager::Models::ChangeStackCompartmentDetails
9
+ # **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment
10
+ # into which the Stack should be moved.
11
+ #
12
+ # @return [String]
13
+ attr_accessor :compartment_id
14
+
15
+ # Attribute mapping from ruby-style variable name to JSON key.
16
+ def self.attribute_map
17
+ {
18
+ # rubocop:disable Style/SymbolLiteral
19
+ 'compartment_id': :'compartmentId'
20
+ # rubocop:enable Style/SymbolLiteral
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.swagger_types
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'compartment_id': :'String'
29
+ # rubocop:enable Style/SymbolLiteral
30
+ }
31
+ end
32
+
33
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
34
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
35
+
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
47
+
48
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
49
+
50
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
51
+ end
52
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
53
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
54
+
55
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
56
+
57
+
58
+ # Checks equality by comparing each attribute.
59
+ # @param [Object] other the other object to be compared
60
+ def ==(other)
61
+ return true if equal?(other)
62
+
63
+ self.class == other.class &&
64
+ compartment_id == other.compartment_id
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, Layout/EmptyLines
75
+
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [compartment_id].hash
81
+ end
82
+ # rubocop:enable Metrics/AbcSize, 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
+
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
+ public_method("#{key}=").call(
99
+ attributes[self.class.attribute_map[key]]
100
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
101
+ )
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ public_method("#{key}=").call(
105
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
106
+ )
107
+ end
108
+ # or else data not found in attributes(hash), not an issue as the data can be optional
109
+ end
110
+
111
+ self
112
+ end
113
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
114
+
115
+ # Returns the string representation of the object
116
+ # @return [String] String presentation of the object
117
+ def to_s
118
+ to_hash.to_s
119
+ end
120
+
121
+ # Returns the object in the form of hash
122
+ # @return [Hash] Returns the object in the form of hash
123
+ def to_hash
124
+ hash = {}
125
+ self.class.attribute_map.each_pair do |attr, param|
126
+ value = public_method(attr).call
127
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
128
+
129
+ hash[param] = _to_hash(value)
130
+ end
131
+ hash
132
+ end
133
+
134
+ private
135
+
136
+ # Outputs non-array value in the form of hash
137
+ # For object, use to_hash. Otherwise, just return the value
138
+ # @param [Object] value Any valid value
139
+ # @return [Hash] Returns the value in the form of hash
140
+ def _to_hash(value)
141
+ if value.is_a?(Array)
142
+ value.compact.map { |v| _to_hash(v) }
143
+ elsif value.is_a?(Hash)
144
+ {}.tap do |hash|
145
+ value.each { |k, v| hash[k] = _to_hash(v) }
146
+ end
147
+ elsif value.respond_to? :to_hash
148
+ value.to_hash
149
+ else
150
+ value
151
+ end
152
+ end
153
+ end
154
+ end
155
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,293 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
+ module OCI
8
+ # The status of a work request.
9
+ class ResourceManager::Models::WorkRequest
10
+ OPERATION_TYPE_ENUM = [
11
+ OPERATION_TYPE_CHANGE_STACK_COMPARTMENT = 'CHANGE_STACK_COMPARTMENT'.freeze,
12
+ OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
13
+ ].freeze
14
+
15
+ STATUS_ENUM = [
16
+ STATUS_ACCEPTED = 'ACCEPTED'.freeze,
17
+ STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
18
+ STATUS_FAILED = 'FAILED'.freeze,
19
+ STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
20
+ STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
21
+ ].freeze
22
+
23
+ # **[Required]** The asynchronous operation tracked by this work request.
24
+ # @return [String]
25
+ attr_reader :operation_type
26
+
27
+ # **[Required]** The status of the work request.
28
+ # @return [String]
29
+ attr_reader :status
30
+
31
+ # **[Required]** OCID identifying this work request.
32
+ # @return [String]
33
+ attr_accessor :id
34
+
35
+ # **[Required]** The OCID of the compartment containing this work request.
36
+ # @return [String]
37
+ attr_accessor :compartment_id
38
+
39
+ # **[Required]** The resources affected by this work request.
40
+ # @return [Array<OCI::ResourceManager::Models::WorkRequestResource>]
41
+ attr_accessor :resources
42
+
43
+ # **[Required]** The amount of work done relative to the total amount of work.
44
+ # @return [Float]
45
+ attr_accessor :percent_complete
46
+
47
+ # **[Required]** When the work request was created.
48
+ # @return [DateTime]
49
+ attr_accessor :time_accepted
50
+
51
+ # When the work request transitioned from ACCEPTED to IN_PROGRESS.
52
+ # @return [DateTime]
53
+ attr_accessor :time_started
54
+
55
+ # When the work request reached a terminal state (FAILED or SUCCEEDED).
56
+ # @return [DateTime]
57
+ attr_accessor :time_finished
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ # rubocop:disable Style/SymbolLiteral
63
+ 'operation_type': :'operationType',
64
+ 'status': :'status',
65
+ 'id': :'id',
66
+ 'compartment_id': :'compartmentId',
67
+ 'resources': :'resources',
68
+ 'percent_complete': :'percentComplete',
69
+ 'time_accepted': :'timeAccepted',
70
+ 'time_started': :'timeStarted',
71
+ 'time_finished': :'timeFinished'
72
+ # rubocop:enable Style/SymbolLiteral
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.swagger_types
78
+ {
79
+ # rubocop:disable Style/SymbolLiteral
80
+ 'operation_type': :'String',
81
+ 'status': :'String',
82
+ 'id': :'String',
83
+ 'compartment_id': :'String',
84
+ 'resources': :'Array<OCI::ResourceManager::Models::WorkRequestResource>',
85
+ 'percent_complete': :'Float',
86
+ 'time_accepted': :'DateTime',
87
+ 'time_started': :'DateTime',
88
+ 'time_finished': :'DateTime'
89
+ # rubocop:enable Style/SymbolLiteral
90
+ }
91
+ end
92
+
93
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
94
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
95
+
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @option attributes [String] :operation_type The value to assign to the {#operation_type} property
100
+ # @option attributes [String] :status The value to assign to the {#status} property
101
+ # @option attributes [String] :id The value to assign to the {#id} property
102
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
103
+ # @option attributes [Array<OCI::ResourceManager::Models::WorkRequestResource>] :resources The value to assign to the {#resources} property
104
+ # @option attributes [Float] :percent_complete The value to assign to the {#percent_complete} property
105
+ # @option attributes [DateTime] :time_accepted The value to assign to the {#time_accepted} property
106
+ # @option attributes [DateTime] :time_started The value to assign to the {#time_started} property
107
+ # @option attributes [DateTime] :time_finished The value to assign to the {#time_finished} property
108
+ def initialize(attributes = {})
109
+ return unless attributes.is_a?(Hash)
110
+
111
+ # convert string to symbol for hash key
112
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
113
+
114
+ self.operation_type = attributes[:'operationType'] if attributes[:'operationType']
115
+
116
+ raise 'You cannot provide both :operationType and :operation_type' if attributes.key?(:'operationType') && attributes.key?(:'operation_type')
117
+
118
+ self.operation_type = attributes[:'operation_type'] if attributes[:'operation_type']
119
+
120
+ self.status = attributes[:'status'] if attributes[:'status']
121
+
122
+ self.id = attributes[:'id'] if attributes[:'id']
123
+
124
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
125
+
126
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
127
+
128
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
129
+
130
+ self.resources = attributes[:'resources'] if attributes[:'resources']
131
+
132
+ self.percent_complete = attributes[:'percentComplete'] if attributes[:'percentComplete']
133
+
134
+ raise 'You cannot provide both :percentComplete and :percent_complete' if attributes.key?(:'percentComplete') && attributes.key?(:'percent_complete')
135
+
136
+ self.percent_complete = attributes[:'percent_complete'] if attributes[:'percent_complete']
137
+
138
+ self.time_accepted = attributes[:'timeAccepted'] if attributes[:'timeAccepted']
139
+
140
+ raise 'You cannot provide both :timeAccepted and :time_accepted' if attributes.key?(:'timeAccepted') && attributes.key?(:'time_accepted')
141
+
142
+ self.time_accepted = attributes[:'time_accepted'] if attributes[:'time_accepted']
143
+
144
+ self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']
145
+
146
+ raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started')
147
+
148
+ self.time_started = attributes[:'time_started'] if attributes[:'time_started']
149
+
150
+ self.time_finished = attributes[:'timeFinished'] if attributes[:'timeFinished']
151
+
152
+ raise 'You cannot provide both :timeFinished and :time_finished' if attributes.key?(:'timeFinished') && attributes.key?(:'time_finished')
153
+
154
+ self.time_finished = attributes[:'time_finished'] if attributes[:'time_finished']
155
+ end
156
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
157
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
158
+
159
+ # Custom attribute writer method checking allowed values (enum).
160
+ # @param [Object] operation_type Object to be assigned
161
+ def operation_type=(operation_type)
162
+ # rubocop:disable Style/ConditionalAssignment
163
+ if operation_type && !OPERATION_TYPE_ENUM.include?(operation_type)
164
+ OCI.logger.debug("Unknown value for 'operation_type' [" + operation_type + "]. Mapping to 'OPERATION_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
165
+ @operation_type = OPERATION_TYPE_UNKNOWN_ENUM_VALUE
166
+ else
167
+ @operation_type = operation_type
168
+ end
169
+ # rubocop:enable Style/ConditionalAssignment
170
+ end
171
+
172
+ # Custom attribute writer method checking allowed values (enum).
173
+ # @param [Object] status Object to be assigned
174
+ def status=(status)
175
+ # rubocop:disable Style/ConditionalAssignment
176
+ if status && !STATUS_ENUM.include?(status)
177
+ OCI.logger.debug("Unknown value for 'status' [" + status + "]. Mapping to 'STATUS_UNKNOWN_ENUM_VALUE'") if OCI.logger
178
+ @status = STATUS_UNKNOWN_ENUM_VALUE
179
+ else
180
+ @status = status
181
+ end
182
+ # rubocop:enable Style/ConditionalAssignment
183
+ end
184
+
185
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
186
+
187
+
188
+ # Checks equality by comparing each attribute.
189
+ # @param [Object] other the other object to be compared
190
+ def ==(other)
191
+ return true if equal?(other)
192
+
193
+ self.class == other.class &&
194
+ operation_type == other.operation_type &&
195
+ status == other.status &&
196
+ id == other.id &&
197
+ compartment_id == other.compartment_id &&
198
+ resources == other.resources &&
199
+ percent_complete == other.percent_complete &&
200
+ time_accepted == other.time_accepted &&
201
+ time_started == other.time_started &&
202
+ time_finished == other.time_finished
203
+ end
204
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
205
+
206
+ # @see the `==` method
207
+ # @param [Object] other the other object to be compared
208
+ def eql?(other)
209
+ self == other
210
+ end
211
+
212
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
213
+
214
+
215
+ # Calculates hash code according to all attributes.
216
+ # @return [Fixnum] Hash code
217
+ def hash
218
+ [operation_type, status, id, compartment_id, resources, percent_complete, time_accepted, time_started, time_finished].hash
219
+ end
220
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
221
+
222
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
223
+
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def build_from_hash(attributes)
229
+ return nil unless attributes.is_a?(Hash)
230
+
231
+ self.class.swagger_types.each_pair do |key, type|
232
+ if type =~ /^Array<(.*)>/i
233
+ # check to ensure the input is an array given that the the attribute
234
+ # is documented as an array but the input is not
235
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
236
+ public_method("#{key}=").call(
237
+ attributes[self.class.attribute_map[key]]
238
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
239
+ )
240
+ end
241
+ elsif !attributes[self.class.attribute_map[key]].nil?
242
+ public_method("#{key}=").call(
243
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
244
+ )
245
+ end
246
+ # or else data not found in attributes(hash), not an issue as the data can be optional
247
+ end
248
+
249
+ self
250
+ end
251
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # Returns the object in the form of hash
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_hash
262
+ hash = {}
263
+ self.class.attribute_map.each_pair do |attr, param|
264
+ value = public_method(attr).call
265
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ private
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+ end
292
+ end
293
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength