Class: Merge::Crm::AuditLogEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/crm/types/audit_log_event.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(role:, ip_address:, event_type:, event_description:, id: OMIT, user_name: OMIT, user_email: OMIT, created_at: OMIT, additional_properties: nil) ⇒ Merge::Crm::AuditLogEvent

Parameters:

  • id (String) (defaults to: OMIT)
  • user_name (String) (defaults to: OMIT)

    The User’s full name at the time of this Event occurring.

  • user_email (String) (defaults to: OMIT)

    The User’s email at the time of this Event occurring.

  • role (Merge::Crm::RoleEnum)

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    • ‘ADMIN` - ADMIN

    • ‘DEVELOPER` - DEVELOPER

    • ‘MEMBER` - MEMBER

    • ‘API` - API

    • ‘SYSTEM` - SYSTEM

    • ‘MERGE_TEAM` - MERGE_TEAM

  • ip_address (String)
  • event_type (Merge::Crm::EventTypeEnum)

    Designates the type of event that occurred.

    • ‘CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY

    • ‘DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY

    • ‘CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY

    • ‘DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY

    • ‘REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY

    • ‘INVITED_USER` - INVITED_USER

    • ‘TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED

    • ‘TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED

    • ‘DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT

    • ‘CREATED_DESTINATION` - CREATED_DESTINATION

    • ‘DELETED_DESTINATION` - DELETED_DESTINATION

    • ‘CHANGED_DESTINATION` - CHANGED_DESTINATION

    • ‘CHANGED_SCOPES` - CHANGED_SCOPES

    • ‘CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION

    • ‘CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS

    • ‘ENABLED_INTEGRATION` - ENABLED_INTEGRATION

    • ‘DISABLED_INTEGRATION` - DISABLED_INTEGRATION

    • ‘ENABLED_CATEGORY` - ENABLED_CATEGORY

    • ‘DISABLED_CATEGORY` - DISABLED_CATEGORY

    • ‘CHANGED_PASSWORD` - CHANGED_PASSWORD

    • ‘RESET_PASSWORD` - RESET_PASSWORD

    • ‘ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` -

    ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION

    • ‘ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` -

    ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT

    • ‘DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` -

    DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION

    • ‘DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` -

    DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT

    • ‘CREATED_INTEGRATION_WIDE_FIELD_MAPPING` -

    CREATED_INTEGRATION_WIDE_FIELD_MAPPING

    • ‘CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - CREATED_LINKED_ACCOUNT_FIELD_MAPPING

    • ‘CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` -

    CHANGED_INTEGRATION_WIDE_FIELD_MAPPING

    • ‘CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING

    • ‘DELETED_INTEGRATION_WIDE_FIELD_MAPPING` -

    DELETED_INTEGRATION_WIDE_FIELD_MAPPING

    • ‘DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - DELETED_LINKED_ACCOUNT_FIELD_MAPPING

    • ‘FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC

    • ‘MUTED_ISSUE` - MUTED_ISSUE

    • ‘GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK

    • ‘ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK

    • ‘DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK

    • ‘MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED

    • ‘END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED

  • event_description (String)
  • created_at (DateTime) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 150

def initialize(role:, ip_address:, event_type:, event_description:, id: OMIT, user_name: OMIT, user_email: OMIT,
               created_at: OMIT, additional_properties: nil)
  @id = id if id != OMIT
  @user_name = user_name if user_name != OMIT
  @user_email = user_email if user_email != OMIT
  @role = role
  @ip_address = ip_address
  @event_type = event_type
  @event_description = event_description
  @created_at = created_at if created_at != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "user_name": user_name,
    "user_email": user_email,
    "role": role,
    "ip_address": ip_address,
    "event_type": event_type,
    "event_description": event_description,
    "created_at": created_at
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



81
82
83
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 81

def additional_properties
  @additional_properties
end

#created_atDateTime (readonly)

Returns:

  • (DateTime)


79
80
81
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 79

def created_at
  @created_at
end

#event_descriptionString (readonly)

Returns:

  • (String)


77
78
79
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 77

def event_description
  @event_description
end

#event_typeMerge::Crm::EventTypeEnum (readonly)

Returns Designates the type of event that occurred.

  • ‘CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY

  • ‘DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY

  • ‘CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY

  • ‘DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY

  • ‘REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY

  • ‘INVITED_USER` - INVITED_USER

  • ‘TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED

  • ‘TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED

  • ‘DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT

  • ‘CREATED_DESTINATION` - CREATED_DESTINATION

  • ‘DELETED_DESTINATION` - DELETED_DESTINATION

  • ‘CHANGED_DESTINATION` - CHANGED_DESTINATION

  • ‘CHANGED_SCOPES` - CHANGED_SCOPES

  • ‘CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION

  • ‘CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS

  • ‘ENABLED_INTEGRATION` - ENABLED_INTEGRATION

  • ‘DISABLED_INTEGRATION` - DISABLED_INTEGRATION

  • ‘ENABLED_CATEGORY` - ENABLED_CATEGORY

  • ‘DISABLED_CATEGORY` - DISABLED_CATEGORY

  • ‘CHANGED_PASSWORD` - CHANGED_PASSWORD

  • ‘RESET_PASSWORD` - RESET_PASSWORD

  • ‘ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` -

ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION

  • ‘ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` -

ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT

  • ‘DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` -

DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION

  • ‘DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` -

DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT

  • ‘CREATED_INTEGRATION_WIDE_FIELD_MAPPING` -

CREATED_INTEGRATION_WIDE_FIELD_MAPPING

  • ‘CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - CREATED_LINKED_ACCOUNT_FIELD_MAPPING

  • ‘CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` -

CHANGED_INTEGRATION_WIDE_FIELD_MAPPING

  • ‘CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING

  • ‘DELETED_INTEGRATION_WIDE_FIELD_MAPPING` -

DELETED_INTEGRATION_WIDE_FIELD_MAPPING

  • ‘DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - DELETED_LINKED_ACCOUNT_FIELD_MAPPING

  • ‘FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC

  • ‘MUTED_ISSUE` - MUTED_ISSUE

  • ‘GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK

  • ‘ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK

  • ‘DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK

  • ‘MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED

  • ‘END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED.

Returns:

  • (Merge::Crm::EventTypeEnum)

    Designates the type of event that occurred.

    • ‘CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY

    • ‘DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY

    • ‘CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY

    • ‘DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY

    • ‘REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY

    • ‘INVITED_USER` - INVITED_USER

    • ‘TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED

    • ‘TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED

    • ‘DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT

    • ‘CREATED_DESTINATION` - CREATED_DESTINATION

    • ‘DELETED_DESTINATION` - DELETED_DESTINATION

    • ‘CHANGED_DESTINATION` - CHANGED_DESTINATION

    • ‘CHANGED_SCOPES` - CHANGED_SCOPES

    • ‘CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION

    • ‘CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS

    • ‘ENABLED_INTEGRATION` - ENABLED_INTEGRATION

    • ‘DISABLED_INTEGRATION` - DISABLED_INTEGRATION

    • ‘ENABLED_CATEGORY` - ENABLED_CATEGORY

    • ‘DISABLED_CATEGORY` - DISABLED_CATEGORY

    • ‘CHANGED_PASSWORD` - CHANGED_PASSWORD

    • ‘RESET_PASSWORD` - RESET_PASSWORD

    • ‘ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` -

    ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION

    • ‘ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` -

    ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT

    • ‘DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` -

    DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION

    • ‘DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` -

    DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT

    • ‘CREATED_INTEGRATION_WIDE_FIELD_MAPPING` -

    CREATED_INTEGRATION_WIDE_FIELD_MAPPING

    • ‘CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - CREATED_LINKED_ACCOUNT_FIELD_MAPPING

    • ‘CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` -

    CHANGED_INTEGRATION_WIDE_FIELD_MAPPING

    • ‘CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING

    • ‘DELETED_INTEGRATION_WIDE_FIELD_MAPPING` -

    DELETED_INTEGRATION_WIDE_FIELD_MAPPING

    • ‘DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - DELETED_LINKED_ACCOUNT_FIELD_MAPPING

    • ‘FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC

    • ‘MUTED_ISSUE` - MUTED_ISSUE

    • ‘GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK

    • ‘ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK

    • ‘DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK

    • ‘MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED

    • ‘END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED



75
76
77
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 75

def event_type
  @event_type
end

#idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 13

def id
  @id
end

#ip_addressString (readonly)

Returns:

  • (String)


28
29
30
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 28

def ip_address
  @ip_address
end

#roleMerge::Crm::RoleEnum (readonly)

Returns Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

  • ‘ADMIN` - ADMIN

  • ‘DEVELOPER` - DEVELOPER

  • ‘MEMBER` - MEMBER

  • ‘API` - API

  • ‘SYSTEM` - SYSTEM

  • ‘MERGE_TEAM` - MERGE_TEAM.

Returns:

  • (Merge::Crm::RoleEnum)

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    • ‘ADMIN` - ADMIN

    • ‘DEVELOPER` - DEVELOPER

    • ‘MEMBER` - MEMBER

    • ‘API` - API

    • ‘SYSTEM` - SYSTEM

    • ‘MERGE_TEAM` - MERGE_TEAM



26
27
28
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 26

def role
  @role
end

#user_emailString (readonly)

Returns The User’s email at the time of this Event occurring.

Returns:

  • (String)

    The User’s email at the time of this Event occurring.



17
18
19
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 17

def user_email
  @user_email
end

#user_nameString (readonly)

Returns The User’s full name at the time of this Event occurring.

Returns:

  • (String)

    The User’s full name at the time of this Event occurring.



15
16
17
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 15

def user_name
  @user_name
end

Class Method Details

.from_json(json_object:) ⇒ Merge::Crm::AuditLogEvent

Deserialize a JSON object to an instance of AuditLogEvent

Parameters:

  • json_object (String)

Returns:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 179

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  user_name = parsed_json["user_name"]
  user_email = parsed_json["user_email"]
  role = parsed_json["role"]
  ip_address = parsed_json["ip_address"]
  event_type = parsed_json["event_type"]
  event_description = parsed_json["event_description"]
  created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
  new(
    id: id,
    user_name: user_name,
    user_email: user_email,
    role: role,
    ip_address: ip_address,
    event_type: event_type,
    event_description: event_description,
    created_at: created_at,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


216
217
218
219
220
221
222
223
224
225
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 216

def self.validate_raw(obj:)
  obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.user_name&.is_a?(String) != false || raise("Passed value for field obj.user_name is not the expected type, validation failed.")
  obj.user_email&.is_a?(String) != false || raise("Passed value for field obj.user_email is not the expected type, validation failed.")
  obj.role.is_a?(Merge::Crm::RoleEnum) != false || raise("Passed value for field obj.role is not the expected type, validation failed.")
  obj.ip_address.is_a?(String) != false || raise("Passed value for field obj.ip_address is not the expected type, validation failed.")
  obj.event_type.is_a?(Merge::Crm::EventTypeEnum) != false || raise("Passed value for field obj.event_type is not the expected type, validation failed.")
  obj.event_description.is_a?(String) != false || raise("Passed value for field obj.event_description is not the expected type, validation failed.")
  obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AuditLogEvent to a JSON object

Returns:

  • (String)


206
207
208
# File 'lib/merge_ruby_client/crm/types/audit_log_event.rb', line 206

def to_json(*_args)
  @_field_set&.to_json
end