Class: Merge::Ats::UrlRequest

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value: OMIT, url_type: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Ats::UrlRequest

Parameters:

  • value (String) (defaults to: OMIT)

    The site’s url.

  • url_type (Merge::Ats::UrlTypeEnum) (defaults to: OMIT)

    The type of site.

    • ‘PERSONAL` - PERSONAL

    • ‘COMPANY` - COMPANY

    • ‘PORTFOLIO` - PORTFOLIO

    • ‘BLOG` - BLOG

    • ‘SOCIAL_MEDIA` - SOCIAL_MEDIA

    • ‘OTHER` - OTHER

    • ‘JOB_POSTING` - JOB_POSTING

  • 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



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 =  if  != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "value": value,
    "url_type": url_type,
    "integration_params": integration_params,
    "linked_account_params": 
  }.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



32
33
34
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 32

def additional_properties
  @additional_properties
end

#integration_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


28
29
30
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 28

def integration_params
  @integration_params
end

#linked_account_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


30
31
32
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 30

def 
  @linked_account_params
end

#url_typeMerge::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.

Returns:

  • (Merge::Ats::UrlTypeEnum)

    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

#valueString (readonly)

Returns The site’s url.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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"]
   = parsed_json["linked_account_params"]
  new(
    value: value,
    url_type: url_type,
    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)


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

Returns:

  • (String)


92
93
94
# File 'lib/merge_ruby_client/ats/types/url_request.rb', line 92

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