Class: Merge::Ats::UrlRequest
- Inherits:
-
Object
- Object
- Merge::Ats::UrlRequest
- Defined in:
- lib/merge_ruby_client/ats/types/url_request.rb
Overview
# The Url Object
### Description
The `Url` object is used to represent hyperlinks associated with the parent
model.
### Usage Example
Fetch from the `GET Candidate` endpoint and view their website urls.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #integration_params ⇒ Hash{String => Object} readonly
- #linked_account_params ⇒ Hash{String => Object} readonly
-
#url_type ⇒ Merge::Ats::UrlTypeEnum
readonly
The type of site.
-
#value ⇒ String
readonly
The site’s url.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ats::UrlRequest
Deserialize a JSON object to an instance of UrlRequest.
-
.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(value: OMIT, url_type: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Ats::UrlRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UrlRequest to a JSON object.
Constructor Details
#initialize(value: OMIT, url_type: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Ats::UrlRequest
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 52 def initialize(value: OMIT, url_type: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) @value = value if value != OMIT @url_type = url_type if url_type != 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 = { "value": value, "url_type": url_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.
32 33 34 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 32 def additional_properties @additional_properties end |
#integration_params ⇒ Hash{String => Object} (readonly)
28 29 30 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 28 def integration_params @integration_params end |
#linked_account_params ⇒ Hash{String => Object} (readonly)
30 31 32 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 30 def linked_account_params @linked_account_params end |
#url_type ⇒ Merge::Ats::UrlTypeEnum (readonly)
Returns The type of site.
-
‘PERSONAL` - PERSONAL
-
‘COMPANY` - COMPANY
-
‘PORTFOLIO` - PORTFOLIO
-
‘BLOG` - BLOG
-
‘SOCIAL_MEDIA` - SOCIAL_MEDIA
-
‘OTHER` - OTHER
-
‘JOB_POSTING` - JOB_POSTING.
26 27 28 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 26 def url_type @url_type end |
#value ⇒ String (readonly)
Returns The site’s url.
17 18 19 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 17 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Ats::UrlRequest
Deserialize a JSON object to an instance of UrlRequest
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 73 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) value = parsed_json["value"] url_type = parsed_json["url_type"] integration_params = parsed_json["integration_params"] linked_account_params = parsed_json["linked_account_params"] new( value: value, url_type: url_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.
102 103 104 105 106 107 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 102 def self.validate_raw(obj:) obj.value&.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj.url_type&.is_a?(Merge::Ats::UrlTypeEnum) != false || raise("Passed value for field obj.url_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 UrlRequest to a JSON object
92 93 94 |
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 92 def to_json(*_args) @_field_set&.to_json end |