Class: OCI::DelegateAccessControl::Models::CreateDelegationControlDetails

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

Overview

While creating the Delegation Control, specify how Service Provider Actions are approved and the users who have the privilege of approving the Service Provider Actions associated with the Delegation Control.

You must specify which Service Provider Actions must be pre-approved. The rest of the Service Provider Actions associated with the Delegation Control will require an explicit approval from the users selected either through the approver groups or individually.

You must name your Delegation Control appropriately so it reflects the resources that will be governed by the Delegation Control. Neither the Delegation Controls nor their assignments to resources are visible to the support operators.

Constant Summary collapse

RESOURCE_TYPE_ENUM =
[
  RESOURCE_TYPE_VMCLUSTER = 'VMCLUSTER'.freeze,
  RESOURCE_TYPE_CLOUDVMCLUSTER = 'CLOUDVMCLUSTER'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateDelegationControlDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
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
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 158

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

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

  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_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.num_approvals_required = attributes[:'numApprovalsRequired'] if attributes[:'numApprovalsRequired']

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

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

  self.pre_approved_service_provider_action_names = attributes[:'preApprovedServiceProviderActionNames'] if attributes[:'preApprovedServiceProviderActionNames']

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

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

  self.delegation_subscription_ids = attributes[:'delegationSubscriptionIds'] if attributes[:'delegationSubscriptionIds']

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

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

  self.is_auto_approve_during_maintenance = attributes[:'isAutoApproveDuringMaintenance'] unless attributes[:'isAutoApproveDuringMaintenance'].nil?

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

  self.is_auto_approve_during_maintenance = attributes[:'is_auto_approve_during_maintenance'] unless attributes[:'is_auto_approve_during_maintenance'].nil?

  self.resource_ids = attributes[:'resourceIds'] if attributes[:'resourceIds']

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

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

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

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

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

  self.notification_message_format = attributes[:'notificationMessageFormat'] if attributes[:'notificationMessageFormat']

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

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

  self.vault_id = attributes[:'vaultId'] if attributes[:'vaultId']

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

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

  self.vault_key_id = attributes[:'vaultKeyId'] if attributes[:'vaultKeyId']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#compartment_idString

[Required] The OCID of the compartment that contains this Delegation Control.

Returns:

  • (String)


23
24
25
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 23

def compartment_id
  @compartment_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


89
90
91
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 89

def defined_tags
  @defined_tags
end

#delegation_subscription_idsArray<String>

[Required] List of Delegation Subscription OCID that are allowed for this Delegation Control. The allowed subscriptions will determine the available Service Provider Actions. Only support operators for the allowed subscriptions are allowed to create Delegated Resource Access Request.

Returns:

  • (Array<String>)


45
46
47
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 45

def delegation_subscription_ids
  @delegation_subscription_ids
end

#descriptionString

Description of the Delegation Control.

Returns:

  • (String)


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

def description
  @description
end

#display_nameString

[Required] Name of the Delegation Control. The name does not need to be unique.

Returns:

  • (String)


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

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


81
82
83
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 81

def freeform_tags
  @freeform_tags
end

#is_auto_approve_during_maintenanceBOOLEAN

Set to true to allow all Delegated Resource Access Request to be approved automatically during maintenance.

Returns:

  • (BOOLEAN)


49
50
51
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 49

def is_auto_approve_during_maintenance
  @is_auto_approve_during_maintenance
end

#notification_message_formatString

[Required] The format of the OCI Notification messages for this Delegation Control.

Returns:

  • (String)


65
66
67
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 65

def notification_message_format
  @notification_message_format
end

#notification_topic_idString

[Required] The OCID of the OCI Notification topic to publish messages related to this Delegation Control.

Returns:

  • (String)


61
62
63
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 61

def notification_topic_id
  @notification_topic_id
end

#num_approvals_requiredInteger

number of approvals required.

Returns:

  • (Integer)


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

def num_approvals_required
  @num_approvals_required
end

#pre_approved_service_provider_action_namesArray<String>

List of pre-approved Service Provider Action names. The list of pre-defined Service Provider Actions can be obtained from the ListServiceProviderActions API. Delegated Resource Access Requests associated with a resource governed by this Delegation Control will be automatically approved if the Delegated Resource Access Request only contain Service Provider Actions in the pre-approved list.

Returns:

  • (Array<String>)


41
42
43
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 41

def pre_approved_service_provider_action_names
  @pre_approved_service_provider_action_names
end

#resource_idsArray<String>

[Required] The OCID of the selected resources that this Delegation Control is applicable to.

Returns:

  • (Array<String>)


53
54
55
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 53

def resource_ids
  @resource_ids
end

#resource_typeString

[Required] Resource type for which the Delegation Control is applicable to.

Returns:

  • (String)


57
58
59
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 57

def resource_type
  @resource_type
end

#vault_idString

The OCID of the OCI Vault that will store the secrets containing the SSH keys to access the resource governed by this Delegation Control by Delegate Access Control Service. This property is required when resourceType is CLOUDVMCLUSTER. Delegate Access Control Service will generate the SSH keys and store them as secrets in the OCI Vault.

Returns:

  • (String)


69
70
71
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 69

def vault_id
  @vault_id
end

#vault_key_idString

The OCID of the Master Encryption Key in the OCI Vault specified by vaultId. This key will be used to encrypt the SSH keys to access the resource governed by this Delegation Control by Delegate Access Control Service. This property is required when resourceType is CLOUDVMCLUSTER.

Returns:

  • (String)


73
74
75
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 73

def vault_key_id
  @vault_key_id
end

Class Method Details

.attribute_mapObject

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



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 92

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'display_name': :'displayName',
    'description': :'description',
    'num_approvals_required': :'numApprovalsRequired',
    'pre_approved_service_provider_action_names': :'preApprovedServiceProviderActionNames',
    'delegation_subscription_ids': :'delegationSubscriptionIds',
    'is_auto_approve_during_maintenance': :'isAutoApproveDuringMaintenance',
    'resource_ids': :'resourceIds',
    'resource_type': :'resourceType',
    'notification_topic_id': :'notificationTopicId',
    'notification_message_format': :'notificationMessageFormat',
    'vault_id': :'vaultId',
    'vault_key_id': :'vaultKeyId',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 115

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'display_name': :'String',
    'description': :'String',
    'num_approvals_required': :'Integer',
    'pre_approved_service_provider_action_names': :'Array<String>',
    'delegation_subscription_ids': :'Array<String>',
    'is_auto_approve_during_maintenance': :'BOOLEAN',
    'resource_ids': :'Array<String>',
    'resource_type': :'String',
    'notification_topic_id': :'String',
    'notification_message_format': :'String',
    'vault_id': :'String',
    'vault_key_id': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 266

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    display_name == other.display_name &&
    description == other.description &&
    num_approvals_required == other.num_approvals_required &&
    pre_approved_service_provider_action_names == other.pre_approved_service_provider_action_names &&
    delegation_subscription_ids == other.delegation_subscription_ids &&
    is_auto_approve_during_maintenance == other.is_auto_approve_during_maintenance &&
    resource_ids == other.resource_ids &&
    resource_type == other.resource_type &&
    notification_topic_id == other.notification_topic_id &&
    notification_message_format == other.notification_message_format &&
    vault_id == other.vault_id &&
    vault_key_id == other.vault_key_id &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 310

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


290
291
292
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 290

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



299
300
301
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 299

def hash
  [compartment_id, display_name, description, num_approvals_required, pre_approved_service_provider_action_names, delegation_subscription_ids, is_auto_approve_during_maintenance, resource_ids, resource_type, notification_topic_id, notification_message_format, vault_id, vault_key_id, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



343
344
345
346
347
348
349
350
351
352
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 343

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



337
338
339
# File 'lib/oci/delegate_access_control/models/create_delegation_control_details.rb', line 337

def to_s
  to_hash.to_s
end