Categorygithub.com/FlatFilers/flatfile-go
modulepackage
0.0.18
Repository: https://github.com/flatfilers/flatfile-go.git
Documentation: pkg.go.dev

# README

Flatfile Go Library

fern shield go shield

The Flatfile Go library provides convenient access to the Flatfile API from Go.

Documentation

API reference documentation is available here.

Requirements

This module requires Go version >= 1.13.

Installation

Run the following command to use the Flatfile Go library in your module:

go get github.com/FlatFilers/flatfile-go

Usage

import flatfileclient "github.com/FlatFilers/flatfile-go/client"

client := flatfileclient.NewClient(flatfileclient.WithToken("<YOUR_AUTH_TOKEN>"))

Create Environment

import (
  flatfile       "github.com/FlatFilers/flatfile-go"
  flatfileclient "github.com/FlatFilers/flatfile-go/client"
)

client := flatfileclient.NewClient(flatfileclient.WithToken("<YOUR_AUTH_TOKEN>"))
response, err := client.Environments.Create(
  context.TODO(),
  &flatfile.EnvironmentConfigCreate{
    Name:   "development",
    IsProd: false,
  },
)

Timeouts

Setting a timeout for each individual request is as simple as using the standard context library. Setting a one second timeout for an individual API call looks like the following:

ctx, cancel := context.WithTimeout(context.TODO(), time.Second)
defer cancel()

response, err := client.Environments.Create(
  context.TODO(),
  &flatfile.EnvironmentConfigCreate{
    Name:   "development",
    IsProd: false,
  },
)

Client Options

A variety of client options are included to adapt the behavior of the library, which includes configuring authorization tokens to be sent on every request, or providing your own instrumented *http.Client. Both of these options are shown below:

client := flatfileclient.NewClient(
  flatfileclient.WithToken("<YOUR_AUTH_TOKEN>"),
  flatfileclient.WithHTTPClient(
    &http.Client{
      Timeout: 5 * time.Second,
    },
  ),
)

Providing your own *http.Client is recommended. Otherwise, the http.DefaultClient will be used, and your client will wait indefinitely for a response (unless the per-request, context-based timeout is used).

Errors

Structured error types are returned from API calls that return non-success status codes. For example, you can check if the error was due to a bad request (i.e. status code 400) with the following:

response, err := client.Environments.GetEnvironmentEventToken(
  context.TODO(),
  &flatfile.GetEnvironmentEventTokenRequest{
    EnvironmentId: "invalid-id",
  },
)
if err != nil {
  if badRequestErr, ok := err.(*flatfile.BadRequestError);
    // Do something with the bad request ...
  }
  return err
}

These errors are also compatible with the errors.Is and errors.As APIs, so you can access the error like so:

response, err := client.Environments.GetEnvironmentEventToken(
  context.TODO(),
  &flatfile.GetEnvironmentEventTokenRequest{
    EnvironmentId: "invalid-id",
  },
)
if err != nil {
  var badRequestErr *flatfile.BadRequestError
  if errors.As(err, badRequestErr) {
    // Do something with the bad request ...
  }
  return err
}

If you'd like to wrap the errors with additional information and still retain the ability to access the type with errors.Is and errors.As, you can use the %w directive:

response, err := client.Environments.GetEnvironmentEventToken(
  context.TODO(),
  &flatfile.GetEnvironmentEventTokenRequest{
    EnvironmentId: "invalid-id",
  },
)
if err != nil {
  return fmt.Errorf("failed to generate response: %w", err)
}

Beta Status

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

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Bool returns a pointer to the given bool value.
Byte returns a pointer to the given byte value.
Complex128 returns a pointer to the given complex128 value.
Complex64 returns a pointer to the given complex64 value.
Float32 returns a pointer to the given float32 value.
Float64 returns a pointer to the given float64 value.
Int returns a pointer to the given int value.
Int16 returns a pointer to the given int16 value.
Int32 returns a pointer to the given int32 value.
Int64 returns a pointer to the given int64 value.
Int8 returns a pointer to the given int8 value.
MustParseDate attempts to parse the given string as a date time.Time, and panics upon failure.
MustParseDateTime attempts to parse the given string as a datetime time.Time, and panics upon failure.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Rune returns a pointer to the given rune value.
String returns a pointer to the given string value.
Time returns a pointer to the given time.Time value.
Uint returns a pointer to the given uint value.
Uint16 returns a pointer to the given uint16 value.
Uint32 returns a pointer to the given uint32 value.
Uint64 returns a pointer to the given uint64 value.
Uint8 returns a pointer to the given uint8 value.
Uintptr returns a pointer to the given uintptr value.
UUID returns a pointer to the given uuid.UUID value.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The values of the fields will be concatenated to determine uniqueness.
A hash of the fields will be used to determine uniqueness.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
4gb.
16mb.
64kb (default).
up to 255 characters.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

An account.
Properties used to update an account.
No description provided by the author
No description provided by the author
No description provided by the author
This constraint requires that all records are valid before the action can be performed.
This constraint requires that at least one record exists before the action can be performed.
This constraint requires that at least one record is selected before the action can be performed.
No description provided by the author
No description provided by the author
Used to mount this action on documents.
Used to mount this action on Sheet Columns.
Used to mount this action on files.
Used to mount this action on Sheets.
Used to mount this action on Workbooks.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Properties used to create a new agent.
A log of an agent execution.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Configuration for AI-powered rule creation jobs that generate or replace field constraints.
No description provided by the author
An app.
No description provided by the author
Create an app.
Update an app.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A `true` or `false` value type.
No description provided by the author
No description provided by the author
CellConfig.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A commit version.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The context of the event.
No description provided by the author
Properties used to create a new event.
No description provided by the author
No description provided by the author
No description provided by the author
Properties used to create a new Workbook.
A data retention policy belonging to an environment.
No description provided by the author
No description provided by the author
Store a field as a GMT date.
No description provided by the author
No description provided by the author
No description provided by the author
The configuration for a delete job.
No description provided by the author
No description provided by the author
No description provided by the author
A log of an agent execution.
No description provided by the author
No description provided by the author
No description provided by the author
A document (markdown components) belong to a space.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
An entitlement belonging to a resource.
Only available if one or more of the destination fields is of type enum.
Defines an array of values selected from an enumerated list of options.
Defines an enumerated list of options for the user to select from.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Properties used to create a new environment.
Properties used to update an environment.
No description provided by the author
No description provided by the author
No description provided by the author
An event that tracks an activity within an environment.
The attributes of the event.
No description provided by the author
No description provided by the author
Properties used to allow users to connect to the event bus.
No description provided by the author
An execution of an agent.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Control the appearance of this field when it's displayed in a table or input.
No description provided by the author
Any uploaded file of any type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A list of records with optional record counts.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Configurations for the guests.
Properties used to update an existing guest.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A single unit of work that will execute asynchronously.
Details about the user who acknowledged the job.
Info about the reason the job was canceled.
Outcome summary of a job.
A single unit of work that a pipeline will execute.
The execution plan for a job, for example, for a map job, the execution plan is the mapping of the source sheet to the destination sheet.
The execution plan for a job, for example, for a map job, the execution plan is the mapping of the source sheet to the destination sheet.
No description provided by the author
No description provided by the author
Outcome summary of a job.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Details about the trigger for the job outcome.
Info about the number of parts to create.
The job/plan tuple that contains the full plan and the jobs status.
No description provided by the author
No description provided by the author
Info about the reason the job was split.
Subject parameters for this job type.
A single unit of work that will be executed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
List of Space objects.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Defines a property that should be stored and read as either an integer or floating point number.
The origin resource of the event.
pagination info.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The progress of the event within a collection of iterable events.
No description provided by the author
Create a prompts.
Update a prompts.
No description provided by the author
No description provided by the author
No description provided by the author
A single row of data in a Sheet.
No description provided by the author
Configuration of a record or specific fields in the record.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A single row of data in a Sheet, including links to related rows.
Defines an array of values referenced from another sheet.
No description provided by the author
Defines a reference to another sheet.
No description provided by the author
Conflict resolutions for a record.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The value of a secret.
No description provided by the author
A place to store tabular data.
Describes shape of data as well as behavior.
No description provided by the author
Changes to make to an existing sheet config.
No description provided by the author
No description provided by the author
Changes to make to an existing sheet.
Changes to make to an existing sheet.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A place to store your workbooks.
Properties used to create a new Space.
No description provided by the author
Settings for a space.
No description provided by the author
The size of a space.
No description provided by the author
No description provided by the author
Defines a property that should be stored and read as an array of strings.
Defines a property that should be stored and read as a basic string.
Informs whether or not a request was successful.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Configurations for the user.
Properties used to create a new user.
Properties used to create a new user.
No description provided by the author
No description provided by the author
No description provided by the author
Record data validation messages.
No description provided by the author
No description provided by the author
No description provided by the author
A view.
The configuration of a view.
No description provided by the author
No description provided by the author
No description provided by the author
A collection of one or more sheets.
Settings for a workbook.
No description provided by the author
The updates to be made to an existing workbook.
The properties required to write to a secret.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

Account ID.
Action ID.
No description provided by the author
Foreground actions will prevent interacting with the resource until complete.
Name of an action.
No description provided by the author
No description provided by the author
No description provided by the author
Actor Role ID.
Agent ID.
Agent version ID.
App ID.
No description provided by the author
Cell values grouped by field key.
No description provided by the author
Options to filter records in a snapshot.
Commit ID.
The compiler of the agent.
No description provided by the author
Constraint ID.
No description provided by the author
Data Clip ID.
The type of data retention policy on an environment.
Data Retention Policy ID.
No description provided by the author
List of DiffRecord objects.
When true, excludes duplicate values.
Document ID.
The domain of the event.
The driver to use for extracting data from the file.
Environment ID.
Event ID.
The topic of the event.
Mapping Family ID.
Returns results from the given field only.
The default visual sizing.
File ID.
No description provided by the author
Options to filter records.
Use this to narrow the valid/error filter results to a specific field.
No description provided by the author
The type of authentication to use for guests.
Guest ID.
When both distinct and includeCounts are true, the count of distinct field values will be returned.
No description provided by the author
No description provided by the author
The id of the workbook where extracted file data will be sent.
Pipeline Job ID.
the mode of the job.
For whom the job outcome's next effect should be triggered automatically.
Whether a job outcome's effect should be triggered automatically.
No description provided by the author
Data for each of the job parts.
The id of a file, workbook, sheet, or app.
the status of the job.
The type of job.
A JSONPath string - https://www.rfc-editor.org/rfc/rfc9535.
No description provided by the author
Mapping Rule ID.
No description provided by the author
No description provided by the author
Based on pageSize, which page of records to return.
Number of logs to return in a page (default 20).
Mapping Program ID.
Prompt ID.
No description provided by the author
No description provided by the author
A single row of data in a Sheet.
A single row of data in a Sheet, including links to related rows.
Record ID.
List of Record objects.
List of Record objects, including links to related rows.
No description provided by the author
No description provided by the author
No description provided by the author
Role ID.
No description provided by the author
No description provided by the author
No description provided by the author
Use this to narrow the searchValue results to a specific field.
Search for the given value, returning matching rows.
Secret ID.
The name of a secret.
The value of a secret.
No description provided by the author
Sheet ID.
Sheet Slug.
Snapshot ID.
Sort direction - asc (ascending) or desc (descending).
Name of field by which to sort records.
No description provided by the author
Space Config ID.
Space ID.
How much text should be storeable in this field.
Boolean.
The type of trigger to use for this job.
No description provided by the author
User ID.
No description provided by the author
No description provided by the author
Version ID.
View ID.
Workbook ID.
Available treatments for a workbook.