Class: OCI::Oda::Models::WorkRequestResource
- Inherits:
-
Object
- Object
- OCI::Oda::Models::WorkRequestResource
- Defined in:
- lib/oci/oda/models/work_request_resource.rb
Overview
A resource created or operated on by a work request.
Constant Summary collapse
- RESOURCE_ACTION_ENUM =
[ RESOURCE_ACTION_CREATE = 'CREATE'.freeze, RESOURCE_ACTION_DELETE = 'DELETE'.freeze, RESOURCE_ACTION_PURGE = 'PURGE'.freeze, RESOURCE_ACTION_RECOVER = 'RECOVER'.freeze, RESOURCE_ACTION_CHANGE_COMPARTMENT = 'CHANGE_COMPARTMENT'.freeze, RESOURCE_ACTION_CREATE_ASSOCIATION = 'CREATE_ASSOCIATION'.freeze, RESOURCE_ACTION_DELETE_ASSOCIATION = 'DELETE_ASSOCIATION'.freeze, RESOURCE_ACTION_UPDATE_ENTITLEMENTS_FOR_CACCT = 'UPDATE_ENTITLEMENTS_FOR_CACCT'.freeze, RESOURCE_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- STATUS_ENUM =
[ STATUS_ACCEPTED = 'ACCEPTED'.freeze, STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze, STATUS_SUCCEEDED = 'SUCCEEDED'.freeze, STATUS_FAILED = 'FAILED'.freeze, STATUS_CANCELING = 'CANCELING'.freeze, STATUS_CANCELED = 'CANCELED'.freeze, STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#resource_action ⇒ String
[Required] The action to take against the Digital Assistant instance.
-
#resource_id ⇒ String
[Required] The identifier of the Digital Assistant instance that is the subject of the request.
-
#resource_type ⇒ String
[Required] The resource type that the work request affects.
-
#resource_uri ⇒ String
The URI path that the user can do a GET on to access the resource metadata.
-
#status ⇒ String
[Required] The current state of the work request.
-
#status_message ⇒ String
Short message providing more detail for the current status.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ WorkRequestResource
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ WorkRequestResource
Initializes the object
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 100 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.resource_action = attributes[:'resourceAction'] if attributes[:'resourceAction'] raise 'You cannot provide both :resourceAction and :resource_action' if attributes.key?(:'resourceAction') && attributes.key?(:'resource_action') self.resource_action = attributes[:'resource_action'] if attributes[:'resource_action'] self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType'] raise 'You cannot provide both :resourceType and :resource_type' if attributes.key?(:'resourceType') && attributes.key?(:'resource_type') self.resource_type = attributes[:'resource_type'] if attributes[:'resource_type'] self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId'] raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id'] self.status = attributes[:'status'] if attributes[:'status'] self. = attributes[:'statusMessage'] if attributes[:'statusMessage'] raise 'You cannot provide both :statusMessage and :status_message' if attributes.key?(:'statusMessage') && attributes.key?(:'status_message') self. = attributes[:'status_message'] if attributes[:'status_message'] self.resource_uri = attributes[:'resourceUri'] if attributes[:'resourceUri'] raise 'You cannot provide both :resourceUri and :resource_uri' if attributes.key?(:'resourceUri') && attributes.key?(:'resource_uri') self.resource_uri = attributes[:'resource_uri'] if attributes[:'resource_uri'] end |
Instance Attribute Details
#resource_action ⇒ String
[Required] The action to take against the Digital Assistant instance.
34 35 36 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 34 def resource_action @resource_action end |
#resource_id ⇒ String
[Required] The identifier of the Digital Assistant instance that is the subject of the request.
42 43 44 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 42 def resource_id @resource_id end |
#resource_type ⇒ String
[Required] The resource type that the work request affects.
38 39 40 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 38 def resource_type @resource_type end |
#resource_uri ⇒ String
The URI path that the user can do a GET on to access the resource metadata.
58 59 60 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 58 def resource_uri @resource_uri end |
#status ⇒ String
[Required] The current state of the work request. The ‘SUCCEEDED`, `FAILED`, AND `CANCELED` states correspond to the action being performed.
48 49 50 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 48 def status @status end |
#status_message ⇒ String
Short message providing more detail for the current status. For example, if an operation fails this may include information about the reason for the failure and a possible resolution.
54 55 56 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 54 def @status_message end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 61 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'resource_action': :'resourceAction', 'resource_type': :'resourceType', 'resource_id': :'resourceId', 'status': :'status', 'status_message': :'statusMessage', 'resource_uri': :'resourceUri' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 75 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'resource_action': :'String', 'resource_type': :'String', 'resource_id': :'String', 'status': :'String', 'status_message': :'String', 'resource_uri': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 172 def ==(other) return true if equal?(other) self.class == other.class && resource_action == other.resource_action && resource_type == other.resource_type && resource_id == other.resource_id && status == other.status && == other. && resource_uri == other.resource_uri end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 207 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
187 188 189 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 187 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
196 197 198 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 196 def hash [resource_action, resource_type, resource_id, status, , resource_uri].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
240 241 242 243 244 245 246 247 248 249 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 240 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
234 235 236 |
# File 'lib/oci/oda/models/work_request_resource.rb', line 234 def to_s to_hash.to_s end |