roseflow-proxycurl 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3c7ca7800c548f6ce3653f6293ddb1f594c88e4a1917f79fb2c7e514450e853d
4
+ data.tar.gz: b958674834ce20eff5469ed53e319840c313fcaf96c2d11cabd83f644a273c38
5
+ SHA512:
6
+ metadata.gz: 9dbe708e052754805a27d5d144005e55694361b52a8e943f09f6861ace517fd7cb72778720f98527ec54843cbb888d60a9b9edafb788618a04d21cd585139fae
7
+ data.tar.gz: a53ac1c72f93c32a5dedc529786eba92d49ec5339c2fcbfae437b32592f42a2ae570dcdb84ac4ca407823e7dda06819ed7011a9f78bfbeaa24d1c84958a7ff4e
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/testdouble/standard
3
+ ruby_version: 2.6
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ ## [0.5.0] - 2023-05-18
2
+
3
+ - Initial release
4
+ - Implements [Company Profile endpoint](https://nubela.co/proxycurl/docs#company-api-company-profile-endpoint)
5
+ - Implements [Company Lookup endpoint](https://nubela.co/proxycurl/docs#company-api-company-lookup-endpoint)
6
+ - Implements [Person Profile endpoint](https://nubela.co/proxycurl/docs#people-api-person-profile-endpoint)
7
+ - Implements [Person Role Lookup endpoint](https://nubela.co/proxycurl/docs#people-api-role-lookup-endpoint)
8
+ - Implements [Person Lookup endpoint](https://nubela.co/proxycurl/docs#people-api-person-lookup-endpoint)
9
+ - Implements [Job Profile endpoint](https://nubela.co/proxycurl/docs#jobs-api-job-profile-endpoint)
10
+ - Implements [Job Search endpoint](https://nubela.co/proxycurl/docs#jobs-api-job-search-endpoint)
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at git@laurijutila.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in roseflow-proxycurl.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "standard", "~> 1.3"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Lauri Jutila
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # Proxycurl API support for Roseflow
2
+
3
+ This gem adds Proxycurl API support for Roseflow, making it easy to find people and businesses from LinkedIn.
4
+
5
+ ## What is Proxycurl?
6
+
7
+ Proxycurl is an enrichment API to fetch fresh data on people and businesses from LinkedIn.
8
+
9
+ Visit [Proxycurl's website](https://nubela.co/proxycurl) to learn more.
10
+
11
+ ## Installation
12
+
13
+ Install the gem and add to the application's Gemfile by executing:
14
+
15
+ $ bundle add roseflow-proxycurl
16
+
17
+ If bundler is not being used to manage dependencies, install the gem by executing:
18
+
19
+ $ gem install roseflow-proxycurl
20
+
21
+ ## Usage
22
+
23
+ See full documentation how to configure and use Proxycurl APIs with Roseflow at [docs.roseflow.ai](https://docs.roseflow.ai/support/proxycurl).
24
+
25
+ ## Contributing
26
+
27
+ Bug reports and pull requests are welcome on GitHub at https://github.com/roseflow-ai/roseflow-proxycurl.
28
+
29
+ ## Community
30
+
31
+ ### Discord
32
+
33
+ Join us in our [Discord](https://discord.gg/roseflow).
34
+
35
+ ### Twitter
36
+
37
+ Connect with the core team on Twitter.
38
+
39
+ <a href="https://twitter.com/ljuti" target="_blank">
40
+ <img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/ljuti?logo=twitter&style=social">
41
+ </a>
42
+
43
+ ## License
44
+
45
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
46
+
47
+ ## Code of Conduct
48
+
49
+ Everyone interacting in the `roseflow-proxycurl` project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://roseflow.ai/conduct).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[spec standard]
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry-validation"
4
+ require "roseflow/proxycurl/object"
5
+ require "roseflow/linkedin/company"
6
+ require "roseflow/types"
7
+
8
+ module Roseflow
9
+ module LinkedIn
10
+ class Company
11
+ end
12
+
13
+ class Company::LookupQuery < Proxycurl::ProxycurlObject
14
+ class LookupQueryContract < Dry::Validation::Contract
15
+ params do
16
+ optional(:domain).filled(:string)
17
+ optional(:name).filled(:string)
18
+ optional(:location).filled(:string)
19
+ optional(:enrich).filled(:bool)
20
+ end
21
+
22
+ rule(:domain, :name) do
23
+ unless values[:domain] || values[:name]
24
+ key.failure("must provide either company domain or company name")
25
+ end
26
+ end
27
+ end
28
+
29
+ contract_object LookupQueryContract
30
+
31
+ schema schema.strict
32
+
33
+ attribute? :domain, Types::String
34
+ attribute? :name, Types::String
35
+ attribute? :location, Types::String
36
+ attribute? :enrich, Types::Bool.default(false)
37
+
38
+ def self.new(input)
39
+ validation = self.contract_object.new.call(input)
40
+ raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
41
+ super(input)
42
+ end
43
+
44
+ def to_request_params
45
+ params = {
46
+ company_domain: domain,
47
+ company_name: name,
48
+ company_location: location,
49
+ enrich_profile: enrich,
50
+ }
51
+
52
+ params.each_pair do |key, value|
53
+ params.delete(key) unless value
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry-transformer"
4
+
5
+ module Roseflow
6
+ module LinkedIn
7
+ module CompanyTransformations
8
+ extend Dry::Transformer::Registry
9
+
10
+ import Dry::Transformer::ArrayTransformations
11
+ import Dry::Transformer::HashTransformations
12
+
13
+ rename_keys = t(:map_keys, linkedin_internal_id: :id, universal_name_id: :shorthand)
14
+
15
+ # Transformation = t(:compose, t(:symbolize_keys), rename_keys)
16
+ end
17
+
18
+ class CompanyMapper < Dry::Transformer::Pipe
19
+ import Dry::Transformer::HashTransformations
20
+
21
+ define! do
22
+ symbolize_keys
23
+ rename_keys linkedin_internal_id: :id, universal_name_id: :shorthand, website: :url
24
+ end
25
+ end
26
+
27
+ class Company
28
+ class Object < Dry::Struct
29
+ defines :contract_object
30
+
31
+ class CompanyContract < Dry::Validation::Contract
32
+ params do
33
+ required(:id).filled(:string)
34
+ required(:name).filled(:string)
35
+ required(:profile_url).filled(:string)
36
+ required(:url).filled(:string)
37
+ required(:shorthand).filled(:string)
38
+ required(:tagline).filled(:string)
39
+ required(:description).filled(:string)
40
+ required(:industry).filled(:string)
41
+ required(:company_type).filled(:string)
42
+ required(:locations).array(:hash) do
43
+ required(:country).filled(:string)
44
+ required(:city).filled(:string)
45
+ required(:is_hq).filled(:bool)
46
+ end
47
+ end
48
+
49
+ def call(input)
50
+ transformed = CompanyMapper.new.call(input)
51
+ super(transformed)
52
+ end
53
+ end
54
+
55
+ attribute :id, Types::String
56
+ attribute :name, Types::String
57
+ attribute :profile_url, Types::String
58
+ attribute :url, Types::String
59
+ attribute :shorthand, Types::String
60
+ attribute :tagline, Types::String
61
+ attribute :description, Types::String
62
+ attribute :industry, Types::String
63
+ attribute :company_type, Types::String
64
+ attribute :locations, Types::Array do
65
+ attribute :country, Types::String
66
+ attribute :city, Types::String
67
+ attribute :is_hq, Types::Bool
68
+ end
69
+
70
+ contract_object CompanyContract
71
+
72
+ schema schema.strict
73
+
74
+ def self.new(input)
75
+ validation = self.contract_object.new.call(input)
76
+ raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
77
+ super(validation.to_h)
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry-validation"
4
+ require "roseflow/proxycurl/object"
5
+ require "roseflow/linkedin/company"
6
+ require "roseflow/types"
7
+
8
+ module Roseflow
9
+ module LinkedIn
10
+ class Company
11
+ end
12
+
13
+ class Company::ProfileQuery < Proxycurl::ProxycurlObject
14
+ class ProfileQueryContract < Dry::Validation::Contract
15
+ params do
16
+ required(:url).filled(:string)
17
+ end
18
+
19
+ rule (:url) do
20
+ unless URI.parse(value).is_a?(URI::HTTP)
21
+ key.failure("must be a valid URL")
22
+ end
23
+
24
+ unless value.match?(/linkedin\.com\/company\/\w+/)
25
+ key.failure("must be a valid LinkedIn company URL")
26
+ end
27
+ end
28
+ end
29
+
30
+ contract_object ProfileQueryContract
31
+
32
+ schema schema.strict
33
+
34
+ attribute :url, Types::String
35
+ attribute :resolve_numeric_id, Types::Bool.default(false)
36
+ attribute :categories, Types::String.default("exclude")
37
+ attribute :funding_data, Types::String.default("exclude")
38
+ attribute :extra, Types::String.default("exclude")
39
+ attribute :exit_data, Types::String.default("exclude")
40
+ attribute :acquisitions, Types::String.default("exclude")
41
+ attribute :use_cache, Types::String.default("if-present")
42
+
43
+ def self.new(input)
44
+ validation = self.contract_object.new.call(input)
45
+ raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
46
+ super(input)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "roseflow/linkedin/company/profile_query"
4
+ require "roseflow/linkedin/company/lookup_query"
5
+
6
+ module Roseflow
7
+ module LinkedIn
8
+ class Company
9
+ def initialize(connection)
10
+ @connection = connection
11
+ end
12
+
13
+ def find(url, **options)
14
+ query = ProfileQuery.new(url: url, **options)
15
+ response = @connection.get("linkedin/company", query.to_h)
16
+ return Company::Object.new(JSON.parse(response.body).merge("profile_url" => url)) if company_found?(response)
17
+ return nil if company_not_found?(response)
18
+ end
19
+
20
+ def lookup(query)
21
+ query = LookupQuery.new(query)
22
+ response = @connection.get("linkedin/company/resolve", query.to_request_params)
23
+ return JSON.parse(response.body).dig("url") if company_found?(response)
24
+ return nil if company_not_found?(response)
25
+ end
26
+
27
+ private
28
+
29
+ def company_found?(response)
30
+ response.success? && response.status == 200
31
+ end
32
+
33
+ def company_not_found?(response)
34
+ response.success? && response.status == 404
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry-struct"
4
+ require "dry-validation"
5
+ require "dry-transformer"
6
+ require "roseflow/types"
7
+
8
+ module Roseflow
9
+ module LinkedIn
10
+ class Job
11
+ class Object < Dry::Struct
12
+ class Company < Dry::Struct
13
+ transform_keys(&:to_sym)
14
+
15
+ attribute :name, Types::String
16
+ attribute :url, Types::String
17
+ end
18
+
19
+ class Location < Dry::Struct
20
+ transform_keys(&:to_sym)
21
+
22
+ attribute :country, Types::String
23
+ attribute :city, Types::String
24
+ attribute :region, Types::String.optional
25
+ end
26
+
27
+ class JobMapper < Dry::Transformer::Pipe
28
+ import Dry::Transformer::HashTransformations
29
+
30
+ define! do
31
+ deep_symbolize_keys
32
+ rename_keys linkedin_internal_id: :id, industry: :industries, job_description: :description
33
+ end
34
+ end
35
+
36
+ defines :contract_object
37
+
38
+ class JobContract < Dry::Validation::Contract
39
+ params do
40
+ required(:id).filled(:string)
41
+ required(:title).filled(:string)
42
+ required(:description).filled(:string)
43
+ required(:location)
44
+ required(:company)
45
+ required(:seniority_level).filled(:string)
46
+ required(:employment_type).filled(:string)
47
+ required(:industries).filled(:array)
48
+ end
49
+
50
+ def call(input)
51
+ transformed = JobMapper.new.call(input)
52
+ super(transformed)
53
+ end
54
+ end
55
+
56
+ contract_object JobContract
57
+
58
+ schema schema.strict
59
+
60
+ attribute :id, Types::String
61
+ attribute :title, Types::String
62
+ attribute :description, Types::String
63
+ attribute :location, Location
64
+ attribute :company, Company
65
+ attribute :seniority_level, Types::String
66
+ attribute :employment_type, Types::String
67
+ attribute :industries, Types::Array
68
+
69
+ def self.new(input)
70
+ validation = self.contract_object.new.call(input)
71
+ raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
72
+ super(validation.to_h)
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry-validation"
4
+ require "roseflow/proxycurl/object"
5
+ require "roseflow/linkedin/job"
6
+ require "roseflow/types"
7
+
8
+ module Roseflow
9
+ module LinkedIn
10
+ class Job
11
+ class ProfileQuery < Proxycurl::ProxycurlObject
12
+ class ProfileQueryContract < Dry::Validation::Contract
13
+ params do
14
+ required(:url).filled(:string)
15
+ end
16
+ end
17
+
18
+ contract_object ProfileQueryContract
19
+
20
+ schema schema.strict
21
+
22
+ attribute :url, Types::String
23
+
24
+ def self.new(input)
25
+ validation = self.contract_object.new.call(input)
26
+ raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
27
+ super(input)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry-validation"
4
+ require "roseflow/proxycurl/object"
5
+ require "roseflow/linkedin/job"
6
+ require "roseflow/types"
7
+
8
+ module Roseflow
9
+ module LinkedIn
10
+ class Job
11
+ class SearchQuery < Proxycurl::ProxycurlObject
12
+ class SearchQueryContract < Dry::Validation::Contract
13
+ params do
14
+ optional(:keyword).filled(:string)
15
+ optional(:geo_id).filled(:integer)
16
+ optional(:search_id).filled(:string)
17
+ optional(:flexibility).filled(:string)
18
+ optional(:experience_level).filled(:string)
19
+ optional(:job_type).filled(:string)
20
+ optional(:when).filled(:string)
21
+ end
22
+ end
23
+
24
+ contract_object SearchQueryContract
25
+
26
+ schema schema.strict
27
+
28
+ attribute? :keyword, Types::String
29
+ attribute? :geo_id, Types::Integer.default(92000000)
30
+ attribute? :search_id, Types::String
31
+ attribute? :flexibility, Types::String.default("anything")
32
+ attribute? :experience_level, Types::String.default("anything")
33
+ attribute? :job_type, Types::String.default("anything")
34
+ attribute? :when, Types::String.default("anytime")
35
+
36
+ def self.new(input)
37
+ validation = self.contract_object.new.call(input)
38
+ raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
39
+ super(input)
40
+ end
41
+
42
+ def to_request_params
43
+ to_h
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "roseflow/linkedin/job/profile_query"
4
+ require "roseflow/linkedin/job/search_query"
5
+ require "roseflow/linkedin/job_list_entry"
6
+
7
+ module Roseflow
8
+ module LinkedIn
9
+ class Job
10
+ def initialize(connection)
11
+ @connection = connection
12
+ end
13
+
14
+ def find(url, **options)
15
+ query = ProfileQuery.new(url: url, **options)
16
+ response = @connection.get("linkedin/job", query.to_h)
17
+ return Job::Object.new(JSON.parse(response.body).merge(url: url)) if job_found?(response)
18
+ return nil if job_not_found?(response)
19
+ end
20
+
21
+ def search(query)
22
+ query = SearchQuery.new(query)
23
+ response = @connection.get("v2/linkedin/company/job", query.to_request_params)
24
+ return JobListEntry.from(JSON.parse(response.body)) if job_found?(response)
25
+ end
26
+
27
+ private
28
+
29
+ def job_found?(response)
30
+ response.success? && response.status == 200
31
+ end
32
+
33
+ def job_not_found?(response)
34
+ response.success? && response.status == 404
35
+ end
36
+ end # Job
37
+ end # LinkedIn
38
+ end # Roseflow
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Roseflow
4
+ module LinkedIn
5
+ class JobListEntry < Dry::Struct
6
+ attribute :company, Types::String
7
+ attribute :company_url, Types::String
8
+ attribute :job_title, Types::String
9
+ attribute :job_url, Types::String
10
+ attribute :list_date, Types::String
11
+ attribute :location, Types::String
12
+
13
+ def self.from(input)
14
+ entries = input.dig("job")
15
+ return [] unless entries
16
+ entries.map { |entry| new(entry.symbolize_keys) }
17
+ end
18
+ end
19
+ end
20
+ end