lever

package module
v0.0.0-...-9b12781 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

lever-data-api-go

Golang interface to the Lever data API

Using the API

To use this library, first add the required modules to your Go project:

go mod add github.com/corbaltcode/lever-data-api-go
go mod add github.com/corbaltcode/lever-data-api-go/model

To create a client handle, use NewClient and specify any options required. You will almost certainly need to specify WithAPIKey.

const apiKey = "EXAMPLE_API_KEY"

c := lever.NewClient(lever.WithAPIKey(apiKey))

Options include:

  • WithAPIKey: Specify the API key to use in calls to the Lever API.
  • WithBaseURL: Override the default base URL for the Lever API (default: https://api.lever.co/v1).
  • WithHeader: Add headers to each request.
  • WithHTTPClient: Use the specified HTTP client instead of creating a default.
  • WithUserAgent: Override the default user agent (default: lever-data-api-go/0.0.1).

This library uses request and response objects for each API call. Required parameters are specified in the NewXxxRequest function. Optional parameters can be set on the request before performing the call.

const userID = "526e1010-b7f8-48e1-aba8-ecce327775ca"

func testGetUser(c *lever.Client) error {
    getUserReq := lever.NewGetUserRequest(userId)
    getUserReq.Include = []string{"username", "accessRole"}
    
    getUserResp, err := c.GetUser(getUserReq)
    if err != nil {
        return err
    }

    fmt.Printf("Retrieved user: %v\n", getUserResp.User)
    return nil
}

All request objects inherit (via composition) from lever.BaseRequest, which includes the following optional parameters:

// Base type for all requests.
// This adds the includes and expands parameters.
type BaseRequest struct {
	// Parameters to include the the response. This is optional.
	Include []string

	// Parameters to expand in the response. This is optional.
	Expand []string
}

All responses give access to the original HTTP response object (though the body will have been closed):

type BaseResponse struct {
	HTTPResponse *http.Response `json:"-"`
}
Pagination

List requests add two additional optional parameters from lever.BaseListRequest:

// Base type for all list requests.
// This builds on BaseRequest by adding limit and offset parameters.
type BaseListRequest struct {
	BaseRequest

	// The number of items to include in the response. This is optional.
	Limit int

	// The pagination offset. This is optional.
	Offset string
}

All list responses include a Next and HasNext parameter for pagination:

// Base type for all list responses.
// This adds the next and hasNext parameters for pagination.
type BaseListResponse struct {
	BaseResponse

	// The next pagination offset.
	Next string `json:"next,omitempty"`

	// Whether there is a next page.
	HasNext bool `json:"hasNext,omitempty"`
}

You may not be able to retrieve all items in a single List API call, so you will have to paginate through the results by passing the Next field from the response into the Offset field for the next request:

func testListAllUsers(c *lever.Client) error {
    listReq := lever.NewListUsersRequest()
    for {
        listResp, err := c.ListUsers(listReq)
        if err != nil {
            return err
        }

        for _, user := range listResp.Users {
            fmt.Printf("Found user %v", user.Name)
        }

        if !listResp.HasNext {
            break
        }

        listReq.Offset = listResp.Next
    }

    return nil
}

API support status

The following APIs have been implemented.

The following APIs are in progress.

The following APIs are not yet implemented.

The following are deprecated APIs and will not be implemented.

Documentation

Overview

Basic request/response types, interfaces, and helper methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAPIKey

func WithAPIKey(apiKey string) func(*Client)

Option for setting the API key for the client.

func WithBaseURL

func WithBaseURL(baseURL string) func(*Client)

Option for setting the base URL for the client.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) func(*Client)

Option for setting the HTTP client for the client.

func WithHeader

func WithHeader(header, value string) func(*Client)

Option for setting an arbitrary header.

func WithUserAgent

func WithUserAgent(userAgent string) func(*Client)

Option for setting the user-agent for the client.

Types

type AddOpportunityLinksRequest

type AddOpportunityLinksRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// Array of links to add to the contact
	Links []string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for adding contact links to a contact by opportunity.

func NewAddOpportunityLinksRequest

func NewAddOpportunityLinksRequest(opportunityID string, links []string) *AddOpportunityLinksRequest

Create a new AddOpportunityLinksRequest with the required fields.

func (*AddOpportunityLinksRequest) AddAPIQueryParams

func (r *AddOpportunityLinksRequest) AddAPIQueryParams(query *url.Values)

func (*AddOpportunityLinksRequest) GetBody

func (r *AddOpportunityLinksRequest) GetBody() (io.Reader, error)

func (*AddOpportunityLinksRequest) GetMethod

func (r *AddOpportunityLinksRequest) GetMethod() string

func (*AddOpportunityLinksRequest) GetPath

func (r *AddOpportunityLinksRequest) GetPath() string

type AddOpportunityLinksResponse

type AddOpportunityLinksResponse struct {
	BaseResponse
}

Response for adding contact links to a contact by opportunity.

type AddOpportunitySourcesRequest

type AddOpportunitySourcesRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// Array of sources to add to the contact
	Sources []string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for adding contact sources to a contact by opportunity.

func NewAddOpportunitySourcesRequest

func NewAddOpportunitySourcesRequest(opportunityID string, sources []string) *AddOpportunitySourcesRequest

Create a new AddOpportunitySourcesRequest with the required fields.

func (*AddOpportunitySourcesRequest) AddAPIQueryParams

func (r *AddOpportunitySourcesRequest) AddAPIQueryParams(query *url.Values)

func (*AddOpportunitySourcesRequest) GetBody

func (r *AddOpportunitySourcesRequest) GetBody() (io.Reader, error)

func (*AddOpportunitySourcesRequest) GetMethod

func (r *AddOpportunitySourcesRequest) GetMethod() string

func (*AddOpportunitySourcesRequest) GetPath

func (r *AddOpportunitySourcesRequest) GetPath() string

type AddOpportunitySourcesResponse

type AddOpportunitySourcesResponse struct {
	BaseResponse
}

Response for adding contact sources to a contact by opportunity.

type AddOpportunityTagsRequest

type AddOpportunityTagsRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// Array of tags to add to the contact
	Tags []string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for adding contact tags to a contact by opportunity.

func NewAddOpportunityTagsRequest

func NewAddOpportunityTagsRequest(opportunityID string, tags []string) *AddOpportunityTagsRequest

Create a new AddOpportunityTagsRequest with the required fields.

func (*AddOpportunityTagsRequest) AddAPIQueryParams

func (r *AddOpportunityTagsRequest) AddAPIQueryParams(query *url.Values)

func (*AddOpportunityTagsRequest) GetBody

func (r *AddOpportunityTagsRequest) GetBody() (io.Reader, error)

func (*AddOpportunityTagsRequest) GetMethod

func (r *AddOpportunityTagsRequest) GetMethod() string

func (*AddOpportunityTagsRequest) GetPath

func (r *AddOpportunityTagsRequest) GetPath() string

type AddOpportunityTagsResponse

type AddOpportunityTagsResponse struct {
	BaseResponse
}

Response for adding contact tags to a contact by opportunity.

type ApplicationClientInterface

type ApplicationClientInterface interface {
	ClientInterface

	// Retrieve a single application.
	//
	// This method returns the full application record for a single application.
	//
	// WARNING: This endpoint is deprecated but maintained for backwards compatibility. Use the
	// OpportunityClient GetOpportunity() method, specifying the expand parameter to include
	// applications.
	GetApplication(ctx context.Context, req *GetApplicationRequest) (*GetApplicationResponse, error)

	// Lists all applications for a candidate.
	//
	// WARNING: This endpoint is deprecated but maintained for backwards compatibility. Use the
	// OpportunityClient ListAllOpportunities() method, specifying the relevant contact UID in the
	// contact_id parameter and specifying the expand parameter to include applications.
	ListApplications(ctx context.Context, req *ListApplicationsRequest) (*ListApplicationsResponse, error)
}

Lever data application client interface

type ArchiveReasonsClientInterface

type ArchiveReasonsClientInterface interface {
	ClientInterface

	// Retrieve a single archive reason.
	GetArchiveReason(ctx context.Context, req *GetArchiveReasonRequest) (*GetArchiveReasonResponse, error)

	// List all archive reasons
	//
	// Lists all archive reasons in your Lever account.
	ListArchiveReasons(ctx context.Context, req *ListArchiveReasonsRequest) (*ListArchiveReasonsResponse, error)
}

Lever data archive reasons client interface

type BaseListRequest

type BaseListRequest struct {
	BaseRequest

	// The number of items to include in the response. This is optional.
	Limit int

	// The pagination offset. This is optional.
	Offset string
}

Base type for all list requests. This builds on BaseRequest by adding limit and offset parameters.

func (*BaseListRequest) AddAPIQueryParams

func (blr *BaseListRequest) AddAPIQueryParams(query *url.Values)

Add include=, expand=, limit=, and offset= query parameters to a URL.

type BaseListResponse

type BaseListResponse struct {
	BaseResponse

	// The next pagination offset.
	Next string `json:"next,omitempty"`

	// Whether there is a next page.
	HasNext bool `json:"hasNext,omitempty"`
}

Base type for all list responses. This adds the next and hasNext parameters for pagination.

type BaseRequest

type BaseRequest struct {
	// Parameters to include the the response. This is optional.
	Include []string

	// Parameters to expand in the response. This is optional.
	Expand []string
}

Base type for all requests. This adds the includes and expands parameters.

func (*BaseRequest) AddAPIQueryParams

func (br *BaseRequest) AddAPIQueryParams(query *url.Values)

Add include= and expand= query parameters to a URL.

func (*BaseRequest) GetBody

func (br *BaseRequest) GetBody() (io.Reader, error)

Default body for HTTP request.

func (*BaseRequest) GetContentType

func (br *BaseRequest) GetContentType() string

Default content type for HTTP request

func (*BaseRequest) GetHTTPMethod

func (br *BaseRequest) GetHTTPMethod() string

Default method for HTTP request.

type BaseResponse

type BaseResponse struct {
	HTTPResponse *http.Response `json:"-"`
}

Base type for all responses that includes the HTTP response.

func (*BaseResponse) SetHTTPResponse

func (r *BaseResponse) SetHTTPResponse(resp *http.Response)

Set the HTTP response on this API response.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Actual client implementation

func NewClient

func NewClient(opts ...func(*Client)) *Client

Create a new client with the given options.

func (c *Client) AddOpportunityLinks(ctx context.Context, req *AddOpportunityLinksRequest) (*AddOpportunityLinksResponse, error)

Add contact links to a contact by opportunity

Add links to a Contact by an Opportunity

func (*Client) AddOpportunitySources

Add sources to an opportunity

func (*Client) AddOpportunityTags

func (c *Client) AddOpportunityTags(ctx context.Context, req *AddOpportunityTagsRequest) (*AddOpportunityTagsResponse, error)

Add tags to an opportunity

func (*Client) CreateOpportunity

func (c *Client) CreateOpportunity(ctx context.Context, req *CreateOpportunityRequest) (*CreateOpportunityResponse, error)

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error)

Create a user

This endpoint enables integrations to create users in your Lever account.

Users will be created with the Interviewer access role by default. Users may be created with Interviewer, Limited Team Member, Team Member, Admin, or Super Admin access.

Note: This will not send an invite to the user, so direct auth users will need to go through the direct auth password flow.

func (*Client) DeactivateUser

func (c *Client) DeactivateUser(ctx context.Context, req *DeactivateUserRequest) (*DeactivateUserResponse, error)

Deactivate a user

Deactivated users remain in the system for historical record keeping, but can no longer log in and use Lever.

func (*Client) DownloadResume

func (c *Client) DownloadResume(ctx context.Context, req *DownloadResumeRequest) (*http.Response, error)

Download a resume file.

Downloads a resume file if it exists

func (*Client) GetApplication

func (c *Client) GetApplication(ctx context.Context, req *GetApplicationRequest) (*GetApplicationResponse, error)

Retrieve a single application.

This method returns the full application record for a single application.

WARNING: This endpoint is deprecated but maintained for backwards compatibility. Use the OpportunityClient GetOpportunity() method, specifying the expand parameter to include applications.

func (*Client) GetArchiveReason

func (c *Client) GetArchiveReason(ctx context.Context, req *GetArchiveReasonRequest) (*GetArchiveReasonResponse, error)

Retrieve a single archive reason.

func (*Client) GetBaseURL

func (c *Client) GetBaseURL() string

Returns the base URL for the client.

func (*Client) GetOpportunity

func (c *Client) GetOpportunity(ctx context.Context, req *GetOpportunityRequest) (*GetOpportunityResponse, error)

Retrieve a single opportunity

func (*Client) GetResume

func (c *Client) GetResume(ctx context.Context, req *GetResumeRequest) (*GetResumeResponse, error)

Retrieve information about a single resume.

This endpoint retrieves the metadata for a single resume. To download a resume, see the resume download endpoint.

func (*Client) GetStage

func (c *Client) GetStage(ctx context.Context, req *GetStageRequest) (*GetStageResponse, error)

Retrieve a single stage.

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error)

Retrieve a single user.

This method returns the full user record for a single user.

func (*Client) ListApplications

func (c *Client) ListApplications(ctx context.Context, req *ListApplicationsRequest) (*ListApplicationsResponse, error)

Lists all applications for a candidate.

WARNING: This endpoint is deprecated but maintained for backwards compatibility. Use the OpportunityClient ListAllOpportunities() method, specifying the relevant contact UID in the contact_id parameter and specifying the expand parameter to include applications.

func (*Client) ListArchiveReasons

func (c *Client) ListArchiveReasons(ctx context.Context, req *ListArchiveReasonsRequest) (*ListArchiveReasonsResponse, error)

List all archive reasons

Lists all archive reasons in your Lever account.

func (*Client) ListDeletedOpportunities

List deleted opportunities

Lists all deleted Opportunities in your Lever account.

func (*Client) ListOpportunities

func (c *Client) ListOpportunities(ctx context.Context, req *ListOpportunitiesRequest) (*ListOpportunitiesResponse, error)

List all opportunities

Lists all pipeline Opportunities for Contacts in your Lever account.

func (*Client) ListResumes

func (c *Client) ListResumes(ctx context.Context, req *ListResumesRequest) (*ListResumesResponse, error)

Lists all resumes associated with an opportunity in your Lever account.

func (*Client) ListSources

func (c *Client) ListSources(ctx context.Context, req *ListSourcesRequest) (*ListSourcesResponse, error)

Lists all sources in your Lever account.

func (*Client) ListStages

func (c *Client) ListStages(ctx context.Context, req *ListStagesRequest) (*ListStagesResponse, error)

Lists all pipeline stages in your Lever account.

func (*Client) ListTags

func (c *Client) ListTags(ctx context.Context, req *ListTagsRequest) (*ListTagsResponse, error)

Lists all tags in your Lever account.

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error)

List users

Lists the users in your Lever account. Only active users are returned by default.

func (*Client) ReactivateUser

func (c *Client) ReactivateUser(ctx context.Context, req *ReactivateUserRequest) (*ReactivateUserResponse, error)

Reactivate a user

Reactivate a user that has been previously deactivated

Remove contact links from a contact by opportunity

Remove links from a Contact by an Opportunity

func (*Client) RemoveOpportunitySources

Remove sources from an opportunity

func (*Client) RemoveOpportunityTags

Remove tags from an opportunity

func (*Client) UpdateOpportunityArchivedState

Update opportunity archived state

Update an Opportunity's archived state. If an Opportunity is already archived, its archive reason can be changed or if null is specified as the reason, it will be unarchived. If an Opportunity is active, it will be archived with the reason provided.

The requisitionId is optional. If the provided reason maps to ‘Hired’ and a requisition is provided, the Opportunity will be marked as Hired, the active offer is removed from the requisition, and the hired count for the requisition will be incremented.

If a requisition is specified and there are multiple active applications on the profile, you will receive an error. If the specific requisition is closed, you will receive an error. If there is an offer extended, it must be signed, and the offer must be associated with an application for a posting linked to the provided requisition. You can hire a candidate against a requisition without an offer.

func (*Client) UpdateOpportunityStage

Update opportunity stage

Change an Opportunity's current stage

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, req *UpdateUserRequest) (*UpdateUserResponse, error)

Update a user

When you update a user, Lever expects you to send the entire resource. Every field will be overwritten by the body of the request. If you don't include a field, it will be deleted or reset to its default. Be sure to include all fields you still want to be populated. name, email, and accessRole are required fields. Note that resetting accessRole to interviewer will result in a user losing all of their followed profiles.

type ClientInterface

type ClientInterface interface {
	// Returns the base URL for the client.
	GetBaseURL() string
}

Common client interface

type ContactInterface

type ContactInterface interface {
	ClientInterface

	// Retrieve a single contact.
	GetContact(ctx context.Context, req *GetContactRequest) (*GetContactResponse, error)

	// Update a contact.
	UpdateContact(ctx context.Context, req *UpdateContactRequest) (*UpdateContactResponse, error)
}

Lever data contact client interface

type CreateOpportunityRequest

type CreateOpportunityRequest struct {
	BaseRequest

	// Perform this create on behalf of a specified user. The creator and the owner of this
	// Opportunity will default to the PerformAsID user. The owner can be explicitly specified in
	// the request body if you want the owner to be a different person.
	PerformAsID string

	// If unspecified, assumed to be false. If set to true and a resume file is provided, the
	// resume will be parsed and extracted data will be used to autofill information about the
	// contact such as email and phone number. Any fields manually passed to the endpoint take
	// precedence over any parsed data.
	Parse bool

	// If unspecified, assumed to be false and the Opportunity owner will default to the
	// PerformAsID user. If set to true, an array containing a single posting UID must be
	// passed in via the postings field. The Opportunity owner will be set to that of the posting
	// owner for the single posting. If the posting does not have an owner, the Opportunity owner
	// will default to the PerformAsUserID user.
	PerformAsPostingOwner bool

	// Contact full name
	Name string

	// Contact headline, typically a list of previous companies where the contact has worked or
	// schools that the contact has attended This field can also be populated by parsing a provided
	// resume file.
	Headline string

	// The stage ID of this Opportunity's current stage If omitted, the Opportunity will be placed
	// into the "New Lead" stage.
	StageID string

	// Contact current location
	Location string

	// Contact phone number(s)
	Phones []model.Phone

	// Contact emails
	Emails []string

	// List of Contact links (e.g. personal website, LinkedIn profile, etc.)
	Links []string

	// An array containing a list of tags to apply to this Opportunity. Tags are specified as
	// strings, identical to the ones displayed in the Lever interface. If you specify a tag that
	// does not exist yet, it will be created.
	Tags []string

	// An array containing a list of sources to apply to this Opportunity. Sources are specified as
	// strings, identical to the ones displayed in the Lever interface. If you specify a source that
	// does not exist yet, it will be created.
	Sources []string

	// The way this Opportunity was added to Lever. Can be one of the following values: agency,
	// applied, internal, referred, sourced, university
	Origin string

	// The user ID of the owner of this Opportunity. If not specified, Opportunity owner defaults
	// to the PerformAsID user.
	OwnerID string

	// An array of user IDs that should be added as followers to this Opportunity. The Opportunity
	// creator will always be added as a follower.
	FollowerIDs []string

	// Resume file for this Opportunity.
	ResumeFile *model.Reader

	// File(s) relating to this Opportunity.
	Files []model.Reader

	// Posting ID for this opportunity.
	PostingID string

	// To create a historical Opportunity, set the create time for an Opportunity in the past.
	// Default is current datetime. Note that time travel in the other direction is not permitted;
	// you cannot create a candidate in the future.
	CreatedAt *int64

	// Opportunity archived status. You must specify this field if you would like the candidate to
	// be archived for the created Opportunity. This is useful if you'd like to import historical
	// data into Lever and the Opportunities you are creating are not active. The archive reason
	// must be specified for an archived Opportunity (if you just set the ArchivedAt we will ignore
	// it). If you only specify an archive reason, archivedAt defaults to the current datetime. If
	// you specify an ArchivedAt datetime, you must specify a createdAt datetime that occurs before
	// ArchivedAt.
	Archived *model.Archived

	// The contact ID of an existing candidate's contact to be associated with an opportunity. If
	// specified, the created opportunity will be linked to the existing candidate's contact. If
	// not specified, the attempt to dedupe a candidate by finding a match to the email provided in
	// the POST request will be done.
	ContactID string
	// contains filtered or unexported fields
}

Parameters for creating an opportunity.

func NewCreateOpportunityRequest

func NewCreateOpportunityRequest(performAsID string) *CreateOpportunityRequest

Create a new CreateOpportunityRequest with the required fields.

func (*CreateOpportunityRequest) AddAPIQueryParams

func (r *CreateOpportunityRequest) AddAPIQueryParams(query *url.Values)

func (*CreateOpportunityRequest) GetBody

func (r *CreateOpportunityRequest) GetBody() (io.Reader, error)

func (*CreateOpportunityRequest) GetContentType

func (r *CreateOpportunityRequest) GetContentType() string

func (*CreateOpportunityRequest) GetHTTPMethod

func (r *CreateOpportunityRequest) GetHTTPMethod() string

func (*CreateOpportunityRequest) GetPath

func (r *CreateOpportunityRequest) GetPath() string

type CreateOpportunityResponse

type CreateOpportunityResponse struct {
	BaseResponse

	// Whether this opportunity was deduplicated.
	Deduped bool

	// The opportunity record.
	Opportunity *model.Opportunity
}

Response for creating an opportunity.

type CreateUserRequest

type CreateUserRequest struct {
	BaseRequest

	// User's preferred name
	Name string `json:"name"`

	// User's email address
	Email string `json:"email"`

	// User's access role. One of: 'super admin', 'admin', 'team member', 'limited team member',
	// 'interviewer'
	AccessRole string `json:"accessRole,omitempty"`

	// Unique id for user in external HR directory
	ExternalDirectoryID string `json:"externalDirectoryId,omitempty"`

	// User's job title
	JobTitle string `json:"jobTitle,omitempty"`

	// User's manager ID
	ManagerID string `json:"manager,omitempty"`
}

Parameters for creating a user.

func NewCreateUserRequest

func NewCreateUserRequest(name, email string) *CreateUserRequest

Create a new CreateUserRequest with the required fields.

func (*CreateUserRequest) GetBody

func (r *CreateUserRequest) GetBody() (io.Reader, error)

func (*CreateUserRequest) GetHTTPMethod

func (r *CreateUserRequest) GetHTTPMethod() string

func (*CreateUserRequest) GetPath

func (r *CreateUserRequest) GetPath() string

type CreateUserResponse

type CreateUserResponse struct {
	BaseResponse

	// The user record.
	User *model.User `json:"data"`
}

Response for creating a user.

type DeactivateUserRequest

type DeactivateUserRequest struct {
	BaseRequest

	// The user id. This is required.
	UserId string
}

Parameters for deactivating a user.

func NewDeactivateUserRequest

func NewDeactivateUserRequest(userId string) *DeactivateUserRequest

Create a new DeactivateUserRequest with the required fields.

func (*DeactivateUserRequest) GetHTTPMethod

func (r *DeactivateUserRequest) GetHTTPMethod() string

func (*DeactivateUserRequest) GetPath

func (r *DeactivateUserRequest) GetPath() string

type DeactivateUserResponse

type DeactivateUserResponse struct {
	BaseResponse

	// The user record.
	User *model.User `json:"data"`
}

Response for deactivating a user.

type DownloadResumeRequest

type DownloadResumeRequest struct {
	BaseRequest

	// The ID of the opportunity associated with the resume.
	OpportunityID string

	// The ID of the resume to retrieve.
	ID string
}

Parameters for downloading a single resume.

func NewDownloadResumeRequest

func NewDownloadResumeRequest(opportunityID, id string) *DownloadResumeRequest

Create a new download resume request with the required fields.

func (*DownloadResumeRequest) GetPath

func (r *DownloadResumeRequest) GetPath() string

type GetApplicationRequest

type GetApplicationRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityId string

	// The application id. This is required.
	ApplicationId string
}

Parameters for retrieving a single application.

func NewGetApplicationRequest

func NewGetApplicationRequest(opportunityId, applicationId string) *GetApplicationRequest

Create a new GetApplicationRequest with the required fields.

func (*GetApplicationRequest) GetPath

func (r *GetApplicationRequest) GetPath() string

type GetApplicationResponse

type GetApplicationResponse struct {
	BaseResponse

	// The application record.
	Application *model.Application `json:"data"`
}

Response for retrieving a single application.

type GetArchiveReasonRequest

type GetArchiveReasonRequest struct {
	BaseRequest

	// The archive reason id. This is required.
	ArchiveReasonId string
}

Parameters for retrieving a single archive reason.

func NewGetArchiveReasonRequest

func NewGetArchiveReasonRequest(archiveReasonId string) *GetArchiveReasonRequest

Create a new GetArchiveReasonRequest with the required fields.

func (*GetArchiveReasonRequest) GetPath

func (r *GetArchiveReasonRequest) GetPath() string

type GetArchiveReasonResponse

type GetArchiveReasonResponse struct {
	BaseResponse

	// The archive reason record.
	ArchiveReason *model.ArchiveReason `json:"data"`
}

Response for retrieving a single archive reason.

type GetContactRequest

type GetContactRequest struct {
	BaseRequest

	// The contact UID.
	ContactUID string
}

Parameters for retrieving a single contact.

func NewGetContactRequest

func NewGetContactRequest(contactUID string) *GetContactRequest

Create a new GetContactRequest with the required fields.

func (*GetContactRequest) GetPath

func (r *GetContactRequest) GetPath() string

type GetContactResponse

type GetContactResponse struct {
	BaseResponse

	// The contact record.
	Contact *model.Contact `json:"data"`
}

Response for retrieving a single contact.

type GetOpportunityRequest

type GetOpportunityRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string
}

Parameters for retrieving a single opportunity.

func NewGetOpportunityRequest

func NewGetOpportunityRequest(opportunityID string) *GetOpportunityRequest

Create a new GetOpportunityRequest with the required fields.

func (*GetOpportunityRequest) GetPath

func (r *GetOpportunityRequest) GetPath() string

type GetOpportunityResponse

type GetOpportunityResponse struct {
	BaseResponse

	// The opportunity record.
	Opportunity *model.Opportunity `json:"data"`
}

Response for retrieving a single opportunity; returned to client users.

type GetResumeRequest

type GetResumeRequest struct {
	BaseRequest

	// The ID of the opportunity associated with the resume.
	OpportunityID string

	// The ID of the resume to retrieve.
	ID string
}

Parameters for retrieving a single resume.

func NewGetResumeRequest

func NewGetResumeRequest(opportunityID, id string) *GetResumeRequest

Create a new get resume request with the required fields.

func (*GetResumeRequest) GetPath

func (r *GetResumeRequest) GetPath() string

type GetResumeResponse

type GetResumeResponse struct {
	BaseResponse

	// The resume.
	Data model.Resume `json:"data"`
}

Response for retrieving a single resume.

type GetStageRequest

type GetStageRequest struct {
	BaseRequest

	// The ID of the stage to retrieve.
	ID string
}

Parameters for retrieving a single stage.

func NewGetStageRequest

func NewGetStageRequest(id string) *GetStageRequest

Create a new get stage request with the required fields.

func (*GetStageRequest) GetPath

func (r *GetStageRequest) GetPath() string

type GetStageResponse

type GetStageResponse struct {
	BaseResponse

	// The stage.
	Stage model.Stage `json:"data"`
}

Response for retrieving a single stage.

type GetUserRequest

type GetUserRequest struct {
	BaseRequest

	// The user id. This is required.
	UserId string
}

Parameters for retrieving a single user.

func NewGetUserRequest

func NewGetUserRequest(userId string) *GetUserRequest

Create a new GetUserRequest with the required fields.

func (*GetUserRequest) GetPath

func (r *GetUserRequest) GetPath() string

type GetUserResponse

type GetUserResponse struct {
	BaseResponse

	// The user record.
	User *model.User `json:"data"`
}

Response for retrieving a single user.

type ListApplicationsRequest

type ListApplicationsRequest struct {
	BaseListRequest

	// The opportunity id. This is required.
	OpportunityId string
}

Parameters for listing applications for a candidate.

func NewListApplicationsRequest

func NewListApplicationsRequest(opportunityId string) *ListApplicationsRequest

Create a new ListApplications with the required fields.

func (*ListApplicationsRequest) GetPath

func (r *ListApplicationsRequest) GetPath() string

type ListApplicationsResponse

type ListApplicationsResponse struct {
	BaseListResponse

	// The application records.
	Applications []*model.Application `json:"data"`
}

Response for listing applications for a candidate.

type ListArchiveReasonsRequest

type ListArchiveReasonsRequest struct {
	BaseListRequest
}

Parameters for listing archive reasons.

func NewListArchiveReasonsRequest

func NewListArchiveReasonsRequest() *ListArchiveReasonsRequest

Create a new ListArchiveReasonsRequest with the required fields.

func (*ListArchiveReasonsRequest) GetPath

func (r *ListArchiveReasonsRequest) GetPath() string

type ListArchiveReasonsResponse

type ListArchiveReasonsResponse struct {
	BaseListResponse

	// The archive reason records.
	ArchiveReasons []model.ArchiveReason `json:"data"`
}

Response for listing archive reasons.

type ListDeletedOpportunitiesRequest

type ListDeletedOpportunitiesRequest struct {
	BaseListRequest

	// If specified, filter deleted Opportunities by the timestamp they were deleted. If only
	// DeletedAtStart is specified, all Opportunities deleted from that timestamp (inclusive) to
	// the present will be included. If only DeletedAtEnd is specified, all Opportunities deleted
	// before that timestamp (inclusive) are included.
	DeletedAtStart *int64
	DeletedAtEnd   *int64
}

Parameters for listing deleted opportunities.

func NewListDeletedOpportunitiesRequest

func NewListDeletedOpportunitiesRequest() *ListDeletedOpportunitiesRequest

Create a new ListDeletedOpportunitiesRequest with the required fields.

func (*ListDeletedOpportunitiesRequest) AddAPIQueryParams

func (r *ListDeletedOpportunitiesRequest) AddAPIQueryParams(query *url.Values)

func (*ListDeletedOpportunitiesRequest) GetPath

type ListDeletedOpportunitiesResponse

type ListDeletedOpportunitiesResponse struct {
	BaseListResponse

	// The opportunity records.
	Opportunities []model.Opportunity `json:"data"`
}

Response for listing deleted opportunities; returned to client users.

type ListOpportunitiesRequest

type ListOpportunitiesRequest struct {
	BaseListRequest

	// If specified, filter Opportunities by tag (case sensitive). Results will include
	// Opportunities that contain the specified tag. Multiple tags can be specified and results
	// will include a union of result sets (i.e. Opportunities that have either tag).
	Tags []string

	// If specified, filter Opportunities by email addresses. Results will include Opportunities
	// for Contacts that contain the canonicalized email address.
	Emails []string

	// If specified, filter Opportunities by origin. Results will include Opportunities that
	// contain the specified origin. Multiple origins can be specified and results will include a
	// union of result sets (i.e. Opportunities from either origin).
	Origins []string

	// If specified, filter Opportunities by source. Results will include Opportunities that
	// contain the specified source tag. Multiple sources can be specified and results will include
	// a union of result sets (i.e. Opportunities from either source).
	Sources []string

	// If specified, filter opportunities by confidentiality. If unspecified, defaults to
	// non-confidential. To get both confidential and non-confidential opportunities you must
	// specify all. Learn more about confidential data in the API.
	Confidentiality []string

	// If specified, filter Opportunities by current stage. Results will include Opportunities that
	// are currently in the specified stage. Multiple stages can be specified and results will
	// include a union of result sets (i.e. Opportunities that are in either stage).
	StageIDs []string

	// If specified, filter Opportunities by posting. Results will include Opportunities that are
	// applied to the specified posting. Multiple postings can be specified and results will
	// include a union of result sets (i.e. Opportunities that are applied to either posting).
	PostingIDs []string

	// If specified, filter Opportunities by postings for which they have been archived. Results
	// will include opportunities for candidates that applied to the specified posting and then the
	// application was archived. Multiple postings can be specified and results will include a
	// union of result sets (i.e. Opportunities that were applied to either posting).
	ArchivedPostingIDs []string

	// Filter Opportunities by the timestamp they were created. If only CreatedAtStart is
	// Specified, all Opportunities created from that timestamp (inclusive) to the present will be
	// included. If only CreatedAtEnd is specified, all Opportunities created before that timestamp
	// (inclusive) are included.
	CreatedAtStart *int64
	CreatedAtEnd   *int64

	// Filter Opportunities by the timestamp they were last updated. If only UpdatedAtStart is
	// specified, all Opportunities updated from that timestamp (inclusive) to the present will be
	// included. If only UpdatedAtEnd is specified, all Opportunities updated before that timestamp
	// (inclusive) are included.
	UpdatedAtStart *int64
	UpdatedAtEnd   *int64

	// Filter Opportunities by the timestamp they were advanced to their current stage. If only
	// AdvancedAtStart is specified, all Opportunities advanced from that timestamp (inclusive) to
	// the present will be included. If only AdvancedAtEnd is specified, all Opportunities advanced
	// before that timestamp (inclusive) are included.
	AdvancedAtStart *int64
	AdvancedAtEnd   *int64

	// Filter Opportunities by the timestamp they were archived. If only ArchivedAtStart is
	// specified, all Opportunities archived from that timestamp (inclusive) to the present will be
	// included. If only ArchivedAtEnd is specified, all Opportunities archived before that
	// timestamp (inclusive) are included.
	ArchivedAtStart *int64
	ArchivedAtEnd   *int64

	// If specified, filter Opportunities by archive status. If unspecified, results include both
	// archived and unarchived Opportunities. If true, results only include archived Opportunities.
	// If false, results only include active Opportunities.
	Archived *bool

	// If specified, filter Opportunities by archive reason ID. Results will include Opportunities
	// that have been archived with the specified reason. Multiple archive reasons can be specified
	// and results will include a union of result sets (i.e. Opportunities that have been archived
	// for either reason).
	ArchiveReasonIDs []string

	// If specified, filter Opportunities by snoozed status. If unspecified, results include both
	// snoozed and unsnoozed Opportunities. If true, results only include snoozed Opportunities. If
	// false, results only include unsnoozed Opportunities.
	Snoozed *bool

	// If specified, filter Opportunities by contact ID. Results will include the Opportunities
	// that match the specified contact. Multiple contacts can be specified and results will
	// include a union of result sets (i.e. Opportunities that match each of the contacts).
	ContactIDs []string

	// If specified, filter opportunities by the posting location associated with the opportunity.
	// Results will include Opportunities that contain the specified opportunity location. Multiple
	// opportunity locations can be specified and results will include a union of result sets (i.e.
	// Opportunities that have either opportunity location).
	Locations []string
}

Parameters for listing opportunities.

func NewListOpportunitiesRequest

func NewListOpportunitiesRequest() *ListOpportunitiesRequest

Create a new ListOpportunitiesRequest with the required fields.

func (*ListOpportunitiesRequest) AddAPIQueryParams

func (r *ListOpportunitiesRequest) AddAPIQueryParams(query *url.Values)

func (*ListOpportunitiesRequest) GetPath

func (r *ListOpportunitiesRequest) GetPath() string

type ListOpportunitiesResponse

type ListOpportunitiesResponse struct {
	BaseListResponse

	// The opportunity records.
	Opportunities []model.Opportunity
}

Response for listing opportunities; returned to client users.

type ListResumesRequest

type ListResumesRequest struct {
	BaseListRequest

	// The opportunity id associated with the resumes to list.
	OpportunityID string

	// If set, filter resumes by the timestamp they were uploaded at. If only UploadedAtStart is
	// specified, all resumes uploaded from that timestamp (inclusive) to the present will be
	// included. If only UploadedAtEnd is specified, all resumes uploaded before that timestamp
	// (inclusive) are included. If either value is not a proper timestamp a 400 error will be
	// returned for a malformed request. If there is no uploadedAt date on the resume (for example,
	// resumes parsed from online sources such as LinkedIn or GitHub) the createdAt date will be
	// used instead.
	UploadedAtStart *int64
	UploadedAtEnd   *int64
}

Parameters for listing resumes.

func NewListResumesRequest

func NewListResumesRequest(opportunityID string) *ListResumesRequest

Create a new list resumes request with the required fields.

func (*ListResumesRequest) AddAPIQueryParams

func (r *ListResumesRequest) AddAPIQueryParams(v *url.Values)

func (*ListResumesRequest) GetPath

func (r *ListResumesRequest) GetPath() string

type ListResumesResponse

type ListResumesResponse struct {
	BaseListResponse

	// The resumes in your Lever account.
	Data []model.Resume `json:"data"`
}

Response for listing resumes.

type ListSourcesRequest

type ListSourcesRequest struct {
	BaseListRequest
}

Parameters for listing sources.

func NewListSourcesRequest

func NewListSourcesRequest() *ListSourcesRequest

Create a new list sources request with the required fields.

func (*ListSourcesRequest) GetPath

func (r *ListSourcesRequest) GetPath() string

type ListSourcesResponse

type ListSourcesResponse struct {
	BaseListResponse

	// The sources in your Lever account.
	Sources []model.Tag `json:"data"`
}

Response for listing sources.

type ListStagesRequest

type ListStagesRequest struct {
	BaseListRequest
}

Parameters for listing stages.

func NewListStagesRequest

func NewListStagesRequest() *ListStagesRequest

Create a new list stages request with the required fields.

func (*ListStagesRequest) GetPath

func (r *ListStagesRequest) GetPath() string

type ListStagesResponse

type ListStagesResponse struct {
	BaseListResponse

	// The stages in your Lever account.
	Stages []model.Stage `json:"data"`
}

Response for listing stages.

type ListTagsRequest

type ListTagsRequest struct {
	BaseListRequest
}

Parameters for listing tags.

func NewListTagsRequest

func NewListTagsRequest() *ListTagsRequest

Create a new list tags request with the required fields.

func (*ListTagsRequest) GetPath

func (r *ListTagsRequest) GetPath() string

type ListTagsResponse

type ListTagsResponse struct {
	BaseListResponse

	// The tags in your Lever account.
	Tags []model.Tag `json:"data"`
}

Response for listing tags.

type ListUsersRequest

type ListUsersRequest struct {
	BaseListRequest

	// If set, filter results to users that match an email address. Provided email must exactly
	// match the canonicalized version of the user's email.
	Email []string

	// If set, filter by access role. One of: 'super admin', 'admin', 'team member',
	// 'limited team member', 'interviewer', or the ID for a custom role listed on your roles page.
	AccessRole []string

	// If set, include deactivated users along with activated users.
	IncludeDeactivated bool

	// If set, filter results that match a user's external directory id.
	ExternalDirectoryID []string
}

Parameters for listing users.

func NewListUsersRequest

func NewListUsersRequest() *ListUsersRequest

Create a new ListUsersRequest with the required fields.

func (*ListUsersRequest) AddAPIQueryParams

func (r *ListUsersRequest) AddAPIQueryParams(query *url.Values)

func (*ListUsersRequest) GetPath

func (r *ListUsersRequest) GetPath() string

type ListUsersResponse

type ListUsersResponse struct {
	BaseListResponse

	// The user records.
	Users []model.User `json:"data"`
}

Response for listing users.

type OpportunitiesClientInterface

type OpportunitiesClientInterface interface {
	// Retrieve a single opportunity
	GetOpportunity(ctx context.Context, req *GetOpportunityRequest) (*GetOpportunityResponse, error)

	// List all opportunities
	//
	// Lists all pipeline Opportunities for Contacts in your Lever account.
	ListOpportunities(ctx context.Context, req *ListOpportunitiesRequest) (*ListOpportunitiesResponse, error)

	// List deleted opportunities
	//
	// Lists all deleted Opportunities in your Lever account.
	ListDeletedOpportunities(ctx context.Context, req *ListDeletedOpportunitiesRequest) (*ListDeletedOpportunitiesResponse, error)

	// Create an opportunity
	//
	// This endpoint enables integrations to create candidates and opportunities in your Lever
	// account.
	//
	// If you want to apply a candidate to a job posting or create a custom job site, you should
	// use the Lever Postings API instead of the Lever Data API.
	//
	// We accept requests of type application/json and multipart/form-data. If you are including a
	// resume or other files, you must use the multipart/form-data type.
	//
	// There are many ways to create a candidate. Here are some examples:
	//
	// * Provide a JSON representation of a candidate with basic information like candidate name,
	// email, and phone number
	//
	// * Upload just a resume file and specify you'd like the resume parsed. Information parsed
	// from the resume will be used to create the candidate—their name, email, and phone number,
	// for example.
	//
	// Note: If you are creating a confidential opportunity, you must provide a posting UID for a
	// confidential job posting. Learn more about confidential data in the API.
	//
	// If candidate information is provided in the POST request and resume parsing is requested,
	// the manually provided information will always take precedence over the parsed information
	// from the candidate resume.
	//
	// All fields are optional, but an empty candidate is not particularly interesting. All query
	// parameters except the perform_as parameter are optional.
	//
	// If an email address is provided, we will always attempt to dedupe the candidate. If a match
	// is found, we will create a new Opportunity that is linked to the existing matching
	// candidate’s contact (i.e. we never create a new contact, or person, if a match has been
	// found). The existing candidate’s contact data will take precedence over new manually
	// provided information.
	//
	// If a contact already exists for a candidate, the ID of the existing contact may be provided
	// in the POST request to create an opportunity associated with the existing candidate's
	// contact (the candidate will be deduped). If additional contact details are included in the
	// request (emails, phones, tags, web links), these will be added to the existing candidate's
	// contact information.
	CreateOpportunity(ctx context.Context, req *CreateOpportunityRequest) (*CreateOpportunityResponse, error)

	// Update opportunity stage
	//
	// Change an Opportunity's current stage
	UpdateOpportunityStage(ctx context.Context, req *UpdateOpportunityStageRequest) (*UpdateOpportunityStageResponse, error)

	// Update opportunity archived state
	//
	// Update an Opportunity's archived state. If an Opportunity is already archived, its archive
	// reason can be changed or if null is specified as the reason, it will be unarchived. If an
	// Opportunity is active, it will be archived with the reason provided.
	//
	// The requisitionId is optional. If the provided reason maps to ‘Hired’ and a requisition is
	// provided, the Opportunity will be marked as Hired, the active offer is removed from the
	// requisition, and the hired count for the requisition will be incremented.
	//
	// If a requisition is specified and there are multiple active applications on the profile,
	// you will receive an error. If the specific requisition is closed, you will receive an error.
	// If there is an offer extended, it must be signed, and the offer must be associated with an
	// application for a posting linked to the provided requisition. You can hire a candidate
	// against a requisition without an offer.
	UpdateOpportunityArchivedState(ctx context.Context, req *UpdateOpportunityArchivedStateRequest) (*UpdateOpportunityArchivedStateResponse, error)

	// Add contact links to a contact by opportunity
	//
	// Add links to a Contact by an Opportunity
	AddOpportunityLinks(ctx context.Context, req *AddOpportunityLinksRequest) (*AddOpportunityLinksResponse, error)

	// Remove contact links from a contact by opportunity
	//
	// Remove links from a Contact by an Opportunity
	RemoveOpportunityLinks(ctx context.Context, req *RemoveOpportunityLinksRequest) (*RemoveOpportunityLinksResponse, error)

	// Add tags to an opportunity
	AddOpportunityTags(ctx context.Context, req *AddOpportunityTagsRequest) (*AddOpportunityTagsResponse, error)

	// Remove tags from an opportunity
	RemoveOpportunityTags(ctx context.Context, req *RemoveOpportunityTagsRequest) (*RemoveOpportunityTagsResponse, error)

	// Add sources to an opportunity
	AddOpportunitySources(ctx context.Context, req *AddOpportunitySourcesRequest) (*AddOpportunitySourcesResponse, error)

	// Remove sources from an opportunity
	RemoveOpportunitySources(ctx context.Context, req *RemoveOpportunitySourcesRequest) (*RemoveOpportunitySourcesResponse, error)
}

Lever opportunities client interface

type ReactivateUserRequest

type ReactivateUserRequest struct {
	BaseRequest

	// The user id. This is required.
	UserId string
}

Parameters for reactivating a user.

func NewReactivateUserRequest

func NewReactivateUserRequest(userId string) *ReactivateUserRequest

Create a new ReactivateUserRequest with the required fields.

func (*ReactivateUserRequest) GetHTTPMethod

func (r *ReactivateUserRequest) GetHTTPMethod() string

func (*ReactivateUserRequest) GetPath

func (r *ReactivateUserRequest) GetPath() string

type ReactivateUserResponse

type ReactivateUserResponse struct {
	BaseResponse

	// The user record.
	User *model.User `json:"data"`
}

Response for reactivating a user.

type RemoveOpportunityLinksRequest

type RemoveOpportunityLinksRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// Array of links to remove to the contact
	Links []string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for removeing contact links to a contact by opportunity.

func NewRemoveOpportunityLinksRequest

func NewRemoveOpportunityLinksRequest(opportunityID string, links []string) *RemoveOpportunityLinksRequest

Create a new RemoveOpportunityLinksRequest with the required fields.

func (*RemoveOpportunityLinksRequest) GetBody

func (r *RemoveOpportunityLinksRequest) GetBody() (io.Reader, error)

func (*RemoveOpportunityLinksRequest) GetMethod

func (r *RemoveOpportunityLinksRequest) GetMethod() string

func (*RemoveOpportunityLinksRequest) GetPath

func (*RemoveOpportunityLinksRequest) RemoveAPIQueryParams

func (r *RemoveOpportunityLinksRequest) RemoveAPIQueryParams(query *url.Values)

type RemoveOpportunityLinksResponse

type RemoveOpportunityLinksResponse struct {
	BaseResponse
}

Response for removeing contact links to a contact by opportunity.

type RemoveOpportunitySourcesRequest

type RemoveOpportunitySourcesRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// Array of sources to remove to the contact
	Sources []string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for removeing contact sources to a contact by opportunity.

func NewRemoveOpportunitySourcesRequest

func NewRemoveOpportunitySourcesRequest(opportunityID string, sources []string) *RemoveOpportunitySourcesRequest

Create a new RemoveOpportunitySourcesRequest with the required fields.

func (*RemoveOpportunitySourcesRequest) GetBody

func (*RemoveOpportunitySourcesRequest) GetMethod

func (r *RemoveOpportunitySourcesRequest) GetMethod() string

func (*RemoveOpportunitySourcesRequest) GetPath

func (*RemoveOpportunitySourcesRequest) RemoveAPIQueryParams

func (r *RemoveOpportunitySourcesRequest) RemoveAPIQueryParams(query *url.Values)

type RemoveOpportunitySourcesResponse

type RemoveOpportunitySourcesResponse struct {
	BaseResponse
}

Response for removeing contact sources to a contact by opportunity.

type RemoveOpportunityTagsRequest

type RemoveOpportunityTagsRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// Array of tags to remove to the contact
	Tags []string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for removeing contact tags to a contact by opportunity.

func NewRemoveOpportunityTagsRequest

func NewRemoveOpportunityTagsRequest(opportunityID string, tags []string) *RemoveOpportunityTagsRequest

Create a new RemoveOpportunityTagsRequest with the required fields.

func (*RemoveOpportunityTagsRequest) GetBody

func (r *RemoveOpportunityTagsRequest) GetBody() (io.Reader, error)

func (*RemoveOpportunityTagsRequest) GetMethod

func (r *RemoveOpportunityTagsRequest) GetMethod() string

func (*RemoveOpportunityTagsRequest) GetPath

func (r *RemoveOpportunityTagsRequest) GetPath() string

func (*RemoveOpportunityTagsRequest) RemoveAPIQueryParams

func (r *RemoveOpportunityTagsRequest) RemoveAPIQueryParams(query *url.Values)

type RemoveOpportunityTagsResponse

type RemoveOpportunityTagsResponse struct {
	BaseResponse
}

Response for removeing contact tags to a contact by opportunity.

type RequestInterface

type RequestInterface interface {
	// Retrieve the path for the request, relative to the base URL.
	GetPath() string

	// Retrieve the HTTP method for the request.
	GetHTTPMethod() string

	// Retrieve the content type for the request body (if any).
	GetContentType() string

	// Retrieve the data to send in the request body.
	GetBody() (io.Reader, error)

	// Add standard query parameters.
	AddAPIQueryParams(query *url.Values)
}

Interface that all requests must implement.

type ResponseInterface

type ResponseInterface interface {
	// Set the HTTP response on this API response.
	SetHTTPResponse(resp *http.Response)
}

Interface that all responses must implement.

type ResumesClientInterface

type ResumesClientInterface interface {
	ClientInterface

	// Retrieve information about a single resume.
	//
	// This endpoint retrieves the metadata for a single resume. To download a resume, see the
	// resume download endpoint.
	GetResume(ctx context.Context, req *GetResumeRequest) (*GetResumeResponse, error)

	// Download a resume file.
	//
	// Downloads a resume file if it exists
	//
	// The caller is responsible for closing the response body after consuming it.
	DownloadResume(ctx context.Context, req *DownloadResumeRequest) (*http.Response, error)

	// Lists all resumes associated with an opportunity in your Lever account.
	ListResumes(ctx context.Context, req *ListResumesRequest) (*ListResumesResponse, error)
}

Lever resumes client interface

type SourcesClientInterface

type SourcesClientInterface interface {
	ClientInterface

	// Lists all sources in your Lever account.
	ListSources(ctx context.Context, req *ListSourcesRequest) (*ListSourcesResponse, error)
}

Lever sources client interface

type StagesClientInterface

type StagesClientInterface interface {
	ClientInterface

	// Retrieve a single stage.
	GetStage(ctx context.Context, req *GetStageRequest) (*GetStageResponse, error)

	// Lists all pipeline stages in your Lever account.
	ListStages(ctx context.Context, req *ListStagesRequest) (*ListStagesResponse, error)
}

Lever stages client interface.

type TagsClientInterface

type TagsClientInterface interface {
	ClientInterface

	// Lists all tags in your Lever account.
	ListTags(ctx context.Context, req *ListTagsRequest) (*ListTagsResponse, error)
}

Lever tags client interface

type UpdateContactRequest

type UpdateContactRequest struct {
	BaseRequest

	// The contact data. This is required.
	Contact *model.Contact
}

Parameters for updating a contact.

func NewUpdateContactRequest

func NewUpdateContactRequest(contact *model.Contact) *UpdateContactRequest

Create a new UpdateContactRequest with the required fields.

func (*UpdateContactRequest) GetBody

func (r *UpdateContactRequest) GetBody() (io.Reader, error)

func (*UpdateContactRequest) GetMethod

func (r *UpdateContactRequest) GetMethod() string

func (*UpdateContactRequest) GetPath

func (r *UpdateContactRequest) GetPath() string

type UpdateContactResponse

type UpdateContactResponse struct {
	BaseResponse

	// The contact record.
	Contact *model.Contact `json:"data"`
}

Response for updating a contact.

type UpdateOpportunityArchivedStateRequest

type UpdateOpportunityArchivedStateRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// The archive reason id why this candidate is archived for this Opportunity
	ReasonID string

	// Remove pending interviews from Opportunity when it is archived.
	CleanInterviews bool

	// Hire a candidate for the Opportunity against the specific requisition. The active offer on
	// the profile must be associated with an application for a posting linked to this requisition.
	RequisitionID string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for updating an opportunity archived state.

func NewUpdateOpportunityArchivedStateRequest

func NewUpdateOpportunityArchivedStateRequest(opportunityID, reasonID string) *UpdateOpportunityArchivedStateRequest

Create a new UpdateOpportunityStageRequest with the required fields.

func (*UpdateOpportunityArchivedStateRequest) AddAPIQueryParams

func (r *UpdateOpportunityArchivedStateRequest) AddAPIQueryParams(query *url.Values)

func (*UpdateOpportunityArchivedStateRequest) GetBody

func (*UpdateOpportunityArchivedStateRequest) GetMethod

func (*UpdateOpportunityArchivedStateRequest) GetPath

type UpdateOpportunityArchivedStateResponse

type UpdateOpportunityArchivedStateResponse struct {
	BaseResponse
}

Response for updating an opportunity stage.

type UpdateOpportunityStageRequest

type UpdateOpportunityStageRequest struct {
	BaseRequest

	// The opportunity id. This is required.
	OpportunityID string

	// The stage id of this Opportunity's current stage.
	StageID string

	// Perform this update on behalf of a specified user.
	PerformAsID string
}

Parameters for updating an opportunity stage.

func NewUpdateOpportunityStageRequest

func NewUpdateOpportunityStageRequest(opportunityID, stageID string) *UpdateOpportunityStageRequest

Create a new UpdateOpportunityStageRequest with the required fields.

func (*UpdateOpportunityStageRequest) AddAPIQueryParams

func (r *UpdateOpportunityStageRequest) AddAPIQueryParams(query *url.Values)

func (*UpdateOpportunityStageRequest) GetBody

func (r *UpdateOpportunityStageRequest) GetBody() (io.Reader, error)

func (*UpdateOpportunityStageRequest) GetMethod

func (r *UpdateOpportunityStageRequest) GetMethod() string

func (*UpdateOpportunityStageRequest) GetPath

type UpdateOpportunityStageResponse

type UpdateOpportunityStageResponse struct {
	BaseResponse
}

Response for updating an opportunity stage.

type UpdateUserRequest

type UpdateUserRequest struct {
	BaseRequest

	// User UID
	ID string `json:"id,omitempty"`

	// User's preferred name
	Name string `json:"name,omitempty"`

	// User's email address
	Email string `json:"email,omitempty"`

	// User's access role. One of: 'super admin', 'admin', 'team member', 'limited team member',
	// 'interviewer'
	AccessRole string `json:"accessRole,omitempty"`

	// URL for user's gravatar, if enabled
	Photo string `json:"photo,omitempty"`

	// Unique id for user in external HR directory
	ExternalDirectoryID string `json:"externalDirectoryId,omitempty"`

	// An array of contact IDs which helps identify all contacts associated with a User. This can
	// be used to control User access to any Opportunities linked to a User.
	LinkedContactIds []string `json:"linkedContactIds,omitempty"`

	// User's job title
	JobTitle string `json:"jobTitle,omitempty"`

	// User's manager ID
	ManagerID string `json:"manager,omitempty"`
}

Parameters for updating a user.

func NewUpdateUserRequest

func NewUpdateUserRequest(id, name, email, accessRole string) *UpdateUserRequest

Create a new UpdateUserRequest with the required fields.

func NewUpdateUserRequestFromUser

func NewUpdateUserRequestFromUser(user *model.User) *UpdateUserRequest

Create a new UpdateUserRequest based on an existing User struct.

func (*UpdateUserRequest) GetBody

func (r *UpdateUserRequest) GetBody() (io.Reader, error)

func (*UpdateUserRequest) GetHTTPMethod

func (r *UpdateUserRequest) GetHTTPMethod() string

func (*UpdateUserRequest) GetPath

func (r *UpdateUserRequest) GetPath() string

type UpdateUserResponse

type UpdateUserResponse struct {
	BaseResponse

	// The user record.
	User *model.User `json:"data"`
}

Response for updating a user.

type UsersClientInterface

type UsersClientInterface interface {
	ClientInterface

	// Retrieve a single user.
	//
	// This method returns the full user record for a single user.
	GetUser(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error)

	// List users
	//
	// Lists the users in your Lever account. Only active users are returned by default.
	ListUsers(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error)

	// Create a user
	//
	// This endpoint enables integrations to create users in your Lever account.
	//
	// Users will be created with the Interviewer access role by default. Users may be created with
	// Interviewer, Limited Team Member, Team Member, Admin, or Super Admin access.
	//
	// Note: This will not send an invite to the user, so direct auth users will need to go through
	// the direct auth password flow.
	CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error)

	// Update a user
	//
	// When you update a user, Lever expects you to send the entire resource. Every field will be
	// overwritten by the body of the request. If you don't include a field, it will be deleted or
	// reset to its default. Be sure to include all fields you still want to be populated. name,
	// email, and accessRole are required fields. Note that resetting accessRole to interviewer
	// will result in a user losing all of their followed profiles.
	UpdateUser(ctx context.Context, req *UpdateUserRequest) (*UpdateUserResponse, error)

	// Deactivate a user
	//
	// Deactivated users remain in the system for historical record keeping, but can no longer log
	// in and use Lever.
	DeactivateUser(ctx context.Context, req *DeactivateUserRequest) (*DeactivateUserResponse, error)

	// Reactivate a user
	//
	// Reactivate a user that has been previously deactivated
	ReactivateUser(ctx context.Context, req *ReactivateUserRequest) (*ReactivateUserResponse, error)
}

Lever users client interface

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL