Skip to content

speakeasy-sdks/merge-ats-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATS Go SDK

Merge is a single API to add hundreds of integrations to your app.

SDK Installation

go get github.com/speakeasy-sdks/merge-ats-go

SDK Example Usage

Example

package main

import (
	"context"
	mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
	"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
	"log"
)

func main() {
	s := mergeatsgo.New(
		mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	var xAccountToken string = "<value>"

	ctx := context.Background()
	res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
	if err != nil {
		log.Fatal(err)
	}
	if res.AccountDetails != nil {
		// handle response
	}
}

Available Resources and Operations

  • Retrieve - Get details for a linked account.
  • Retrieve - Returns the account token for the end user with the provided public token.
  • Create - Creates an Activity object with the given values.
  • List - Returns a list of Activity objects.
  • Retrieve - Returns an Activity object with the given id.
  • RetrievePostMetadata - Returns metadata for Activity POSTs.
  • Create - Creates an Application object with the given values.
  • List - Returns a list of Application objects.
  • Retrieve - Returns an Application object with the given id.
  • RetrievePostMetadata - Returns metadata for Application POSTs.
  • UpdateChangeState - Updates the current_stage field of an Application object
  • Create - Asynchronously pull data from an endpoint not currently supported by Merge.
  • Retrieve - Retrieves data from earlier async-passthrough POST request
  • Create - Creates an Attachment object with the given values.
  • List - Returns a list of Attachment objects.
  • Retrieve - Returns an Attachment object with the given id.
  • RetrievePostMetadata - Returns metadata for Attachment POSTs.
  • Retrieve - Returns a list of models and actions available for an account.
  • Create - Creates a Candidate object with the given values.
  • IgnoreCreate - Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes.
  • List - Returns a list of Candidate objects.
  • Retrieve - Returns a Candidate object with the given id.
  • RetrievePatchMetadata - Returns metadata for Candidate PATCHs.
  • RetrievePostMetadata - Returns metadata for Candidate POSTs.
  • Update - Updates a Candidate object with the given id.
  • List - Returns a list of Department objects.
  • Retrieve - Returns a Department object with the given id.
  • List - Returns a list of EEOC objects.
  • Retrieve - Returns an EEOC object with the given id.
  • Create - Create a remote key.
  • Create - Creates a ScheduledInterview object with the given values.
  • List - Returns a list of ScheduledInterview objects.
  • Retrieve - Returns a ScheduledInterview object with the given id.
  • RetrievePostMetadata - Returns metadata for ScheduledInterview POSTs.
  • List - Returns a list of JobInterviewStage objects.
  • Retrieve - Returns a JobInterviewStage object with the given id.
  • List - Returns a list of Job objects.
  • Retrieve - Returns a Job object with the given id.
  • Create - Creates a link token to be used when linking a new end user.
  • List - List linked accounts for your organization.
  • List - Returns a list of Offer objects.
  • Retrieve - Returns an Offer object with the given id.
  • List - Returns a list of Office objects.
  • Retrieve - Returns an Office object with the given id.
  • Create - Pull data from an endpoint not currently supported by Merge.
  • Create - Exchange remote keys.
  • List - Returns a list of RejectReason objects.
  • Retrieve - Returns a RejectReason object with the given id.
  • List - Returns a list of Scorecard objects.
  • Retrieve - Returns a Scorecard object with the given id.
  • List - Get a linked account's selective syncs.
  • RetrievePostMetadata - Get metadata for the conditions available to a linked account.
  • Update - Replace a linked account's selective syncs.
  • List - Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING
  • Create - Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account.
  • List - Returns a list of Tag objects.
  • List - Returns a list of RemoteUser objects.
  • Retrieve - Returns a RemoteUser object with the given id.
  • Create - Creates a WebhookReceiver object with the given values.
  • List - Returns a list of WebhookReceiver objects.

Special Types

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

Example

package main

import (
	"context"
	"errors"
	mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
	"github.com/speakeasy-sdks/merge-ats-go/pkg/models/sdkerrors"
	"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
	"log"
)

func main() {
	s := mergeatsgo.New(
		mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	var xAccountToken string = "<value>"

	ctx := context.Background()
	res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
	if err != nil {

		var e *sdkerrors.SDKError
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}
	}
}

Server Selection

Select Server by Index

You can override the default server globally using the WithServerIndex option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Variables
0 https://api.merge.dev/api/ats/v1 None
1 https://api-sandbox.merge.dev/api/ats/v1 None

Example

package main

import (
	"context"
	mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
	"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
	"log"
)

func main() {
	s := mergeatsgo.New(
		mergeatsgo.WithServerIndex(1),
		mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	var xAccountToken string = "<value>"

	ctx := context.Background()
	res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
	if err != nil {
		log.Fatal(err)
	}
	if res.AccountDetails != nil {
		// handle response
	}
}

Override Server URL Per-Client

The default server can also be overridden globally using the WithServerURL option when initializing the SDK client instance. For example:

package main

import (
	"context"
	mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
	"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
	"log"
)

func main() {
	s := mergeatsgo.New(
		mergeatsgo.WithServerURL("https://api.merge.dev/api/ats/v1"),
		mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	var xAccountToken string = "<value>"

	ctx := context.Background()
	res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
	if err != nil {
		log.Fatal(err)
	}
	if res.AccountDetails != nil {
		// handle response
	}
}

Custom HTTP Client

The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

The built-in net/http client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.

import (
	"net/http"
	"time"
	"github.com/myorg/your-go-sdk"
)

var (
	httpClient = &http.Client{Timeout: 30 * time.Second}
	sdkClient  = sdk.New(sdk.WithClient(httpClient))
)

This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
TokenAuth apiKey API key

You can configure it using the WithSecurity option when initializing the SDK client instance. For example:

package main

import (
	"context"
	mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
	"log"
)

func main() {
	s := mergeatsgo.New(
		mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
	)

	var xAccountToken string = "<value>"

	ctx := context.Background()
	res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
	if err != nil {
		log.Fatal(err)
	}
	if res.AccountDetails != nil {
		// handle response
	}
}

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy