Class: OCI::DelegateAccessControl::Models::UpdateDelegationControlDetails

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

Overview

Information about the new Delegation Control.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateDelegationControlDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
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
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 120

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.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.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.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.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.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

#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>>)


63
64
65
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 63

def defined_tags
  @defined_tags
end

#delegation_subscription_idsArray<String>

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>)


25
26
27
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 25

def delegation_subscription_ids
  @delegation_subscription_ids
end

#descriptionString

Description of the Delegation Control.

Returns:

  • (String)


17
18
19
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 17

def description
  @description
end

#display_nameString

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

Returns:

  • (String)


13
14
15
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 13

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>)


55
56
57
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 55

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)


29
30
31
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 29

def is_auto_approve_during_maintenance
  @is_auto_approve_during_maintenance
end

#notification_message_formatString

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

Returns:

  • (String)


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

def notification_message_format
  @notification_message_format
end

#notification_topic_idString

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

Returns:

  • (String)


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

def notification_topic_id
  @notification_topic_id
end

#num_approvals_requiredInteger

number of approvals required.

Returns:

  • (Integer)


21
22
23
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 21

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>)


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

def pre_approved_service_provider_action_names
  @pre_approved_service_provider_action_names
end

#resource_idsArray<String>

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

Returns:

  • (Array<String>)


33
34
35
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 33

def resource_ids
  @resource_ids
end

Class Method Details

.attribute_mapObject

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



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 66

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

.swagger_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 85

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



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 196

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

  self.class == other.class &&
    display_name == other.display_name &&
    description == other.description &&
    num_approvals_required == other.num_approvals_required &&
    delegation_subscription_ids == other.delegation_subscription_ids &&
    is_auto_approve_during_maintenance == other.is_auto_approve_during_maintenance &&
    resource_ids == other.resource_ids &&
    pre_approved_service_provider_action_names == other.pre_approved_service_provider_action_names &&
    notification_topic_id == other.notification_topic_id &&
    notification_message_format == other.notification_message_format &&
    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



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 236

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


216
217
218
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 216

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



225
226
227
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 225

def hash
  [display_name, description, num_approvals_required, delegation_subscription_ids, is_auto_approve_during_maintenance, resource_ids, pre_approved_service_provider_action_names, notification_topic_id, notification_message_format, 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



269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 269

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



263
264
265
# File 'lib/oci/delegate_access_control/models/update_delegation_control_details.rb', line 263

def to_s
  to_hash.to_s
end