Class: OCI::DelegateAccessControl::Models::DelegatedResourceAccessRequestApprovalDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb

Overview

Approval info for initial access or extension of a Delegated Resource Access Request

Constant Summary collapse

APPROVAL_ACTION_ENUM =
[
  APPROVAL_ACTION_APPROVE = 'APPROVE'.freeze,
  APPROVAL_ACTION_REJECT = 'REJECT'.freeze,
  APPROVAL_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
APPROVAL_TYPE_ENUM =
[
  APPROVAL_TYPE_INITIAL = 'INITIAL'.freeze,
  APPROVAL_TYPE_EXTENSION = 'EXTENSION'.freeze,
  APPROVAL_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DelegatedResourceAccessRequestApprovalDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



89
90
91
92
93
94
95
96
97
98
99
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
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 89

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.approval_action = attributes[:'approvalAction'] if attributes[:'approvalAction']

  raise 'You cannot provide both :approvalAction and :approval_action' if attributes.key?(:'approvalAction') && attributes.key?(:'approval_action')

  self.approval_action = attributes[:'approval_action'] if attributes[:'approval_action']

  self.time_approved_for_access = attributes[:'timeApprovedForAccess'] if attributes[:'timeApprovedForAccess']

  raise 'You cannot provide both :timeApprovedForAccess and :time_approved_for_access' if attributes.key?(:'timeApprovedForAccess') && attributes.key?(:'time_approved_for_access')

  self.time_approved_for_access = attributes[:'time_approved_for_access'] if attributes[:'time_approved_for_access']

  self.approval_type = attributes[:'approvalType'] if attributes[:'approvalType']

  raise 'You cannot provide both :approvalType and :approval_type' if attributes.key?(:'approvalType') && attributes.key?(:'approval_type')

  self.approval_type = attributes[:'approval_type'] if attributes[:'approval_type']

  self.approver_comment = attributes[:'approverComment'] if attributes[:'approverComment']

  raise 'You cannot provide both :approverComment and :approver_comment' if attributes.key?(:'approverComment') && attributes.key?(:'approver_comment')

  self.approver_comment = attributes[:'approver_comment'] if attributes[:'approver_comment']

  self.approver_id = attributes[:'approverId'] if attributes[:'approverId']

  raise 'You cannot provide both :approverId and :approver_id' if attributes.key?(:'approverId') && attributes.key?(:'approver_id')

  self.approver_id = attributes[:'approver_id'] if attributes[:'approver_id']

  self.approver_additional_message = attributes[:'approverAdditionalMessage'] if attributes[:'approverAdditionalMessage']

  raise 'You cannot provide both :approverAdditionalMessage and :approver_additional_message' if attributes.key?(:'approverAdditionalMessage') && attributes.key?(:'approver_additional_message')

  self.approver_additional_message = attributes[:'approver_additional_message'] if attributes[:'approver_additional_message']
end

Instance Attribute Details

#approval_actionString

Indicated whether the request is approved or rejected.

Returns:

  • (String)


27
28
29
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 27

def approval_action
  @approval_action
end

#approval_typeString

approval type, initial or extension

Returns:

  • (String)


35
36
37
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 35

def approval_type
  @approval_type
end

#approver_additional_messageString

Additional message specified by the approver of the request.

Returns:

  • (String)


47
48
49
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 47

def approver_additional_message
  @approver_additional_message
end

#approver_commentString

[Required] Comment specified by the approver of the request.

Returns:

  • (String)


39
40
41
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 39

def approver_comment
  @approver_comment
end

#approver_idString

User ID of the approver.

Returns:

  • (String)


43
44
45
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 43

def approver_id
  @approver_id
end

#time_approved_for_accessDateTime

Access start time that is actually approved by the customer in 3339[https://tools.ietf.org/html/rfc3339]timestamp format, e.g. '2020-05-22T21:10:29.600Z'.

Returns:

  • (DateTime)


31
32
33
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 31

def time_approved_for_access
  @time_approved_for_access
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 50

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'approval_action': :'approvalAction',
    'time_approved_for_access': :'timeApprovedForAccess',
    'approval_type': :'approvalType',
    'approver_comment': :'approverComment',
    'approver_id': :'approverId',
    'approver_additional_message': :'approverAdditionalMessage'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'approval_action': :'String',
    'time_approved_for_access': :'DateTime',
    'approval_type': :'String',
    'approver_comment': :'String',
    'approver_id': :'String',
    'approver_additional_message': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



165
166
167
168
169
170
171
172
173
174
175
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 165

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    approval_action == other.approval_action &&
    time_approved_for_access == other.time_approved_for_access &&
    approval_type == other.approval_type &&
    approver_comment == other.approver_comment &&
    approver_id == other.approver_id &&
    approver_additional_message == other.approver_additional_message
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 200

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


180
181
182
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 180

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



189
190
191
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 189

def hash
  [approval_action, time_approved_for_access, approval_type, approver_comment, approver_id, approver_additional_message].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



233
234
235
236
237
238
239
240
241
242
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 233

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



227
228
229
# File 'lib/oci/delegate_access_control/models/delegated_resource_access_request_approval_details.rb', line 227

def to_s
  to_hash.to_s
end