Class: Merge::Ats::ActivityRequest
- Inherits:
-
Object
- Object
- Merge::Ats::ActivityRequest
- Defined in:
- lib/merge_ruby_client/ats/types/activity_request.rb
Overview
# The Activity Object
### Description
The `Activity` object is used to represent an activity for a candidate performed
by a user.
### Usage Example
Fetch from the `LIST Activities` endpoint and filter by `ID` to show all
activities.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#activity_type ⇒ Merge::Ats::ActivityTypeEnum
readonly
The activity’s type.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#body ⇒ String
readonly
The activity’s body.
- #candidate ⇒ String readonly
- #integration_params ⇒ Hash{String => Object} readonly
- #linked_account_params ⇒ Hash{String => Object} readonly
-
#subject ⇒ String
readonly
The activity’s subject.
-
#user ⇒ Merge::Ats::ActivityRequestUser
readonly
The user that performed the action.
-
#visibility ⇒ Merge::Ats::VisibilityEnum
readonly
The activity’s visibility.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ats::ActivityRequest
Deserialize a JSON object to an instance of ActivityRequest.
-
.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.
Instance Method Summary collapse
- #initialize(user: OMIT, activity_type: OMIT, subject: OMIT, body: OMIT, visibility: OMIT, candidate: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Ats::ActivityRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ActivityRequest to a JSON object.
Constructor Details
#initialize(user: OMIT, activity_type: OMIT, subject: OMIT, body: OMIT, visibility: OMIT, candidate: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Ats::ActivityRequest
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 65 def initialize(user: OMIT, activity_type: OMIT, subject: OMIT, body: OMIT, visibility: OMIT, candidate: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) @user = user if user != OMIT @activity_type = activity_type if activity_type != OMIT @subject = subject if subject != OMIT @body = body if body != OMIT @visibility = visibility if visibility != OMIT @candidate = candidate if candidate != OMIT @integration_params = integration_params if integration_params != OMIT @linked_account_params = linked_account_params if linked_account_params != OMIT @additional_properties = additional_properties @_field_set = { "user": user, "activity_type": activity_type, "subject": subject, "body": body, "visibility": visibility, "candidate": candidate, "integration_params": integration_params, "linked_account_params": linked_account_params }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#activity_type ⇒ Merge::Ats::ActivityTypeEnum (readonly)
Returns The activity’s type.
-
‘NOTE` - NOTE
-
‘EMAIL` - EMAIL
-
‘OTHER` - OTHER.
25 26 27 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 25 def activity_type @activity_type end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
42 43 44 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 42 def additional_properties @additional_properties end |
#body ⇒ String (readonly)
Returns The activity’s body.
29 30 31 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 29 def body @body end |
#candidate ⇒ String (readonly)
36 37 38 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 36 def candidate @candidate end |
#integration_params ⇒ Hash{String => Object} (readonly)
38 39 40 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 38 def integration_params @integration_params end |
#linked_account_params ⇒ Hash{String => Object} (readonly)
40 41 42 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 40 def linked_account_params @linked_account_params end |
#subject ⇒ String (readonly)
Returns The activity’s subject.
27 28 29 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 27 def subject @subject end |
#user ⇒ Merge::Ats::ActivityRequestUser (readonly)
Returns The user that performed the action.
20 21 22 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 20 def user @user end |
#visibility ⇒ Merge::Ats::VisibilityEnum (readonly)
Returns The activity’s visibility.
-
‘ADMIN_ONLY` - ADMIN_ONLY
-
‘PUBLIC` - PUBLIC
-
‘PRIVATE` - PRIVATE.
34 35 36 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 34 def visibility @visibility end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Ats::ActivityRequest
Deserialize a JSON object to an instance of ActivityRequest
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 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 94 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["user"].nil? user = nil else user = parsed_json["user"].to_json user = Merge::Ats::ActivityRequestUser.from_json(json_object: user) end activity_type = parsed_json["activity_type"] subject = parsed_json["subject"] body = parsed_json["body"] visibility = parsed_json["visibility"] candidate = parsed_json["candidate"] integration_params = parsed_json["integration_params"] linked_account_params = parsed_json["linked_account_params"] new( user: user, activity_type: activity_type, subject: subject, body: body, visibility: visibility, candidate: candidate, integration_params: integration_params, linked_account_params: linked_account_params, 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.
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 136 def self.validate_raw(obj:) obj.user.nil? || Merge::Ats::ActivityRequestUser.validate_raw(obj: obj.user) obj.activity_type&.is_a?(Merge::Ats::ActivityTypeEnum) != false || raise("Passed value for field obj.activity_type is not the expected type, validation failed.") obj.subject&.is_a?(String) != false || raise("Passed value for field obj.subject is not the expected type, validation failed.") obj.body&.is_a?(String) != false || raise("Passed value for field obj.body is not the expected type, validation failed.") obj.visibility&.is_a?(Merge::Ats::VisibilityEnum) != false || raise("Passed value for field obj.visibility is not the expected type, validation failed.") obj.candidate&.is_a?(String) != false || raise("Passed value for field obj.candidate is not the expected type, validation failed.") obj.integration_params&.is_a?(Hash) != false || raise("Passed value for field obj.integration_params is not the expected type, validation failed.") obj.linked_account_params&.is_a?(Hash) != false || raise("Passed value for field obj.linked_account_params is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ActivityRequest to a JSON object
126 127 128 |
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 126 def to_json(*_args) @_field_set&.to_json end |