Class: OCI::Lockbox::Models::AccessRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/lockbox/models/access_request.rb

Overview

An access request to a customer's resource. An access request is a subsidiary resource of the Lockbox entity.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_WAITING = 'WAITING'.freeze,
  LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED'.freeze,
  LIFECYCLE_STATE_CANCELING = 'CANCELING'.freeze,
  LIFECYCLE_STATE_CANCELED = 'CANCELED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_DETAILS_ENUM =
[
  LIFECYCLE_STATE_DETAILS_PROCESSING = 'PROCESSING'.freeze,
  LIFECYCLE_STATE_DETAILS_WAITING_FOR_APPROVALS = 'WAITING_FOR_APPROVALS'.freeze,
  LIFECYCLE_STATE_DETAILS_APPROVED = 'APPROVED'.freeze,
  LIFECYCLE_STATE_DETAILS_AUTO_APPROVED = 'AUTO_APPROVED'.freeze,
  LIFECYCLE_STATE_DETAILS_CANCELLING_ACCESS = 'CANCELLING_ACCESS'.freeze,
  LIFECYCLE_STATE_DETAILS_EXPIRED = 'EXPIRED'.freeze,
  LIFECYCLE_STATE_DETAILS_REVOKED = 'REVOKED'.freeze,
  LIFECYCLE_STATE_DETAILS_DENIED = 'DENIED'.freeze,
  LIFECYCLE_STATE_DETAILS_ERROR = 'ERROR'.freeze,
  LIFECYCLE_STATE_DETAILS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AccessRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :lockbox_id (String)

    The value to assign to the #lockbox_id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :description (String)

    The value to assign to the #description property

  • :requestor_id (String)

    The value to assign to the #requestor_id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_state_details (String)

    The value to assign to the #lifecycle_state_details property

  • :access_duration (String)

    The value to assign to the #access_duration property

  • :context (Hash<String, String>)

    The value to assign to the #context property

  • :activity_logs (Array<OCI::Lockbox::Models::ActivityLog>)

    The value to assign to the #activity_logs property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :time_expired (DateTime)

    The value to assign to the #time_expired property

  • :time_reminded (DateTime)

    The value to assign to the #time_reminded property

  • :reminder_count (Integer)

    The value to assign to the #reminder_count property

  • :requestor_location (String)

    The value to assign to the #requestor_location property

  • :ticket_number (String)

    The value to assign to the #ticket_number property



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/oci/lockbox/models/access_request.rb', line 191

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

  self.lockbox_id = attributes[:'lockboxId'] if attributes[:'lockboxId']

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

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

  self.requestor_id = attributes[:'requestorId'] if attributes[:'requestorId']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_state_details = attributes[:'lifecycleStateDetails'] if attributes[:'lifecycleStateDetails']

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

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

  self.access_duration = attributes[:'accessDuration'] if attributes[:'accessDuration']

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

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

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

  self.activity_logs = attributes[:'activityLogs'] if attributes[:'activityLogs']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.time_expired = attributes[:'timeExpired'] if attributes[:'timeExpired']

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

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

  self.time_reminded = attributes[:'timeReminded'] if attributes[:'timeReminded']

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

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

  self.reminder_count = attributes[:'reminderCount'] if attributes[:'reminderCount']

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

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

  self.requestor_location = attributes[:'requestorLocation'] if attributes[:'requestorLocation']

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

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

  self.ticket_number = attributes[:'ticketNumber'] if attributes[:'ticketNumber']

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

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

Instance Attribute Details

#access_durationString

[Required] The maximum amount of time operator has access to associated resources.

Returns:

  • (String)


67
68
69
# File 'lib/oci/lockbox/models/access_request.rb', line 67

def access_duration
  @access_duration
end

#activity_logsArray<OCI::Lockbox::Models::ActivityLog>

[Required] The actions taken by different persona on the access request, e.g. approve/deny/revoke



75
76
77
# File 'lib/oci/lockbox/models/access_request.rb', line 75

def activity_logs
  @activity_logs
end

#contextHash<String, String>

The context object containing the access request specific details.

Returns:

  • (Hash<String, String>)


71
72
73
# File 'lib/oci/lockbox/models/access_request.rb', line 71

def context
  @context
end

#descriptionString

[Required] The rationale for requesting the access request and any other related details..

Returns:

  • (String)


51
52
53
# File 'lib/oci/lockbox/models/access_request.rb', line 51

def description
  @description
end

#display_nameString

[Required] The name of the access request.

Returns:

  • (String)


47
48
49
# File 'lib/oci/lockbox/models/access_request.rb', line 47

def display_name
  @display_name
end

#idString

[Required] The unique identifier (OCID) of the access request, which can't be changed after creation.

Returns:

  • (String)


39
40
41
# File 'lib/oci/lockbox/models/access_request.rb', line 39

def id
  @id
end

#lifecycle_stateString

[Required] Possible access request lifecycle states.

Returns:

  • (String)


59
60
61
# File 'lib/oci/lockbox/models/access_request.rb', line 59

def lifecycle_state
  @lifecycle_state
end

#lifecycle_state_detailsString

[Required] Details of access request lifecycle state.

Returns:

  • (String)


63
64
65
# File 'lib/oci/lockbox/models/access_request.rb', line 63

def lifecycle_state_details
  @lifecycle_state_details
end

#lockbox_idString

[Required] The unique identifier (OCID) of the lockbox box that the access request is associated with, which can't be changed after creation.

Returns:

  • (String)


43
44
45
# File 'lib/oci/lockbox/models/access_request.rb', line 43

def lockbox_id
  @lockbox_id
end

#reminder_countInteger

[Required] The count of times the access request was reminded.

Returns:

  • (Integer)


104
105
106
# File 'lib/oci/lockbox/models/access_request.rb', line 104

def reminder_count
  @reminder_count
end

#requestor_idString

[Required] The unique identifier of the requestor.

Returns:

  • (String)


55
56
57
# File 'lib/oci/lockbox/models/access_request.rb', line 55

def requestor_id
  @requestor_id
end

#requestor_locationString

[Required] The location of the requestor. Format with be two letters indicatiog operator's country code defined by jira-sd.mc1.oracleiaas.com/browse/SSD-17880 Example: US

Returns:

  • (String)


110
111
112
# File 'lib/oci/lockbox/models/access_request.rb', line 110

def requestor_location
  @requestor_location
end

#ticket_numberString

The ticket number raised by external customers Example: 3-37509643121

Returns:

  • (String)


116
117
118
# File 'lib/oci/lockbox/models/access_request.rb', line 116

def ticket_number
  @ticket_number
end

#time_createdDateTime

[Required] The time the access request was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Returns:

  • (DateTime)


81
82
83
# File 'lib/oci/lockbox/models/access_request.rb', line 81

def time_created
  @time_created
end

#time_expiredDateTime

[Required] The time the access request expired. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Returns:

  • (DateTime)


93
94
95
# File 'lib/oci/lockbox/models/access_request.rb', line 93

def time_expired
  @time_expired
end

#time_remindedDateTime

[Required] The time the access request was last reminded. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Returns:

  • (DateTime)


99
100
101
# File 'lib/oci/lockbox/models/access_request.rb', line 99

def time_reminded
  @time_reminded
end

#time_updatedDateTime

[Required] The time the access request was last updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Returns:

  • (DateTime)


87
88
89
# File 'lib/oci/lockbox/models/access_request.rb', line 87

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/lockbox/models/access_request.rb', line 119

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'lockbox_id': :'lockboxId',
    'display_name': :'displayName',
    'description': :'description',
    'requestor_id': :'requestorId',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_state_details': :'lifecycleStateDetails',
    'access_duration': :'accessDuration',
    'context': :'context',
    'activity_logs': :'activityLogs',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'time_expired': :'timeExpired',
    'time_reminded': :'timeReminded',
    'reminder_count': :'reminderCount',
    'requestor_location': :'requestorLocation',
    'ticket_number': :'ticketNumber'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/oci/lockbox/models/access_request.rb', line 144

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'lockbox_id': :'String',
    'display_name': :'String',
    'description': :'String',
    'requestor_id': :'String',
    'lifecycle_state': :'String',
    'lifecycle_state_details': :'String',
    'access_duration': :'String',
    'context': :'Hash<String, String>',
    'activity_logs': :'Array<OCI::Lockbox::Models::ActivityLog>',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'time_expired': :'DateTime',
    'time_reminded': :'DateTime',
    'reminder_count': :'Integer',
    'requestor_location': :'String',
    'ticket_number': :'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



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/oci/lockbox/models/access_request.rb', line 321

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

  self.class == other.class &&
    id == other.id &&
    lockbox_id == other.lockbox_id &&
    display_name == other.display_name &&
    description == other.description &&
    requestor_id == other.requestor_id &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_state_details == other.lifecycle_state_details &&
    access_duration == other.access_duration &&
    context == other.context &&
    activity_logs == other.activity_logs &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    time_expired == other.time_expired &&
    time_reminded == other.time_reminded &&
    reminder_count == other.reminder_count &&
    requestor_location == other.requestor_location &&
    ticket_number == other.ticket_number
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



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/oci/lockbox/models/access_request.rb', line 367

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


347
348
349
# File 'lib/oci/lockbox/models/access_request.rb', line 347

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



356
357
358
# File 'lib/oci/lockbox/models/access_request.rb', line 356

def hash
  [id, lockbox_id, display_name, description, requestor_id, lifecycle_state, lifecycle_state_details, access_duration, context, activity_logs, time_created, time_updated, time_expired, time_reminded, reminder_count, requestor_location, ticket_number].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



400
401
402
403
404
405
406
407
408
409
# File 'lib/oci/lockbox/models/access_request.rb', line 400

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



394
395
396
# File 'lib/oci/lockbox/models/access_request.rb', line 394

def to_s
  to_hash.to_s
end