Class: Merge::Ats::AttachmentRequest
- Inherits:
-
Object
- Object
- Merge::Ats::AttachmentRequest
- Defined in:
- lib/merge_ruby_client/ats/types/attachment_request.rb
Overview
# The Attachment Object
### Description
The `Attachment` object is used to represent a file attached to a candidate.
### Usage Example
Fetch from the `LIST Attachments` endpoint and view attachments accessible by a
company.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#attachment_type ⇒ Merge::Ats::AttachmentTypeEnum
readonly
The attachment’s type.
- #candidate ⇒ String readonly
-
#file_name ⇒ String
readonly
The attachment’s name.
-
#file_url ⇒ String
readonly
The attachment’s url.
- #integration_params ⇒ Hash{String => Object} readonly
- #linked_account_params ⇒ Hash{String => Object} readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ats::AttachmentRequest
Deserialize a JSON object to an instance of AttachmentRequest.
-
.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(file_name: OMIT, file_url: OMIT, candidate: OMIT, attachment_type: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Ats::AttachmentRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AttachmentRequest to a JSON object.
Constructor Details
#initialize(file_name: OMIT, file_url: OMIT, candidate: OMIT, attachment_type: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Ats::AttachmentRequest
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 52 def initialize(file_name: OMIT, file_url: OMIT, candidate: OMIT, attachment_type: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) @file_name = file_name if file_name != OMIT @file_url = file_url if file_url != OMIT @candidate = candidate if candidate != OMIT @attachment_type = if != 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 = { "file_name": file_name, "file_url": file_url, "candidate": candidate, "attachment_type": , "integration_params": integration_params, "linked_account_params": linked_account_params }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
33 34 35 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 33 def additional_properties @additional_properties end |
#attachment_type ⇒ Merge::Ats::AttachmentTypeEnum (readonly)
Returns The attachment’s type.
-
‘RESUME` - RESUME
-
‘COVER_LETTER` - COVER_LETTER
-
‘OFFER_LETTER` - OFFER_LETTER
-
‘OTHER` - OTHER.
27 28 29 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 27 def @attachment_type end |
#candidate ⇒ String (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 21 def candidate @candidate end |
#file_name ⇒ String (readonly)
Returns The attachment’s name.
17 18 19 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 17 def file_name @file_name end |
#file_url ⇒ String (readonly)
Returns The attachment’s url.
19 20 21 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 19 def file_url @file_url end |
#integration_params ⇒ Hash{String => Object} (readonly)
29 30 31 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 29 def integration_params @integration_params end |
#linked_account_params ⇒ Hash{String => Object} (readonly)
31 32 33 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 31 def linked_account_params @linked_account_params end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Ats::AttachmentRequest
Deserialize a JSON object to an instance of AttachmentRequest
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 77 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) file_name = parsed_json["file_name"] file_url = parsed_json["file_url"] candidate = parsed_json["candidate"] = parsed_json["attachment_type"] integration_params = parsed_json["integration_params"] linked_account_params = parsed_json["linked_account_params"] new( file_name: file_name, file_url: file_url, candidate: candidate, attachment_type: , 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.
110 111 112 113 114 115 116 117 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 110 def self.validate_raw(obj:) obj.file_name&.is_a?(String) != false || raise("Passed value for field obj.file_name is not the expected type, validation failed.") obj.file_url&.is_a?(String) != false || raise("Passed value for field obj.file_url 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.&.is_a?(Merge::Ats::AttachmentTypeEnum) != false || raise("Passed value for field obj.attachment_type 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 AttachmentRequest to a JSON object
100 101 102 |
# File 'lib/merge_ruby_client/ats/types/attachment_request.rb', line 100 def to_json(*_args) @_field_set&.to_json end |