Class: Merge::Ats::ActivityRequest

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • user (Merge::Ats::ActivityRequestUser) (defaults to: OMIT)

    The user that performed the action.

  • activity_type (Merge::Ats::ActivityTypeEnum) (defaults to: OMIT)

    The activity’s type.

    • ‘NOTE` - NOTE

    • ‘EMAIL` - EMAIL

    • ‘OTHER` - OTHER

  • subject (String) (defaults to: OMIT)

    The activity’s subject.

  • body (String) (defaults to: OMIT)

    The activity’s body.

  • visibility (Merge::Ats::VisibilityEnum) (defaults to: OMIT)

    The activity’s visibility.

    • ‘ADMIN_ONLY` - ADMIN_ONLY

    • ‘PUBLIC` - PUBLIC

    • ‘PRIVATE` - PRIVATE

  • candidate (String) (defaults to: OMIT)
  • integration_params (Hash{String => Object}) (defaults to: OMIT)
  • linked_account_params (Hash{String => Object}) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 =  if  != 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": 
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#activity_typeMerge::Ats::ActivityTypeEnum (readonly)

Returns The activity’s type.

  • ‘NOTE` - NOTE

  • ‘EMAIL` - EMAIL

  • ‘OTHER` - OTHER.

Returns:



25
26
27
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 25

def activity_type
  @activity_type
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#bodyString (readonly)

Returns The activity’s body.

Returns:

  • (String)

    The activity’s body.



29
30
31
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 29

def body
  @body
end

#candidateString (readonly)

Returns:

  • (String)


36
37
38
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 36

def candidate
  @candidate
end

#integration_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


38
39
40
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 38

def integration_params
  @integration_params
end

#linked_account_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


40
41
42
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 40

def 
  @linked_account_params
end

#subjectString (readonly)

Returns The activity’s subject.

Returns:

  • (String)

    The activity’s subject.



27
28
29
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 27

def subject
  @subject
end

#userMerge::Ats::ActivityRequestUser (readonly)

Returns The user that performed the action.

Returns:



20
21
22
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 20

def user
  @user
end

#visibilityMerge::Ats::VisibilityEnum (readonly)

Returns The activity’s visibility.

  • ‘ADMIN_ONLY` - ADMIN_ONLY

  • ‘PUBLIC` - PUBLIC

  • ‘PRIVATE` - PRIVATE.

Returns:

  • (Merge::Ats::VisibilityEnum)

    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

Parameters:

  • json_object (String)

Returns:



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"]
   = 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: ,
    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)


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

Returns:

  • (String)


126
127
128
# File 'lib/merge_ruby_client/ats/types/activity_request.rb', line 126

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