Skip to content

Commit

Permalink
Merge pull request #10 from Find-AI/release-please--branches--main--c…
Browse files Browse the repository at this point in the history
…hanges--next

release: 0.1.0-alpha.3
  • Loading branch information
philipithomas authored Oct 3, 2024
2 parents f00c647 + 217b050 commit 702f912
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 389 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.2"
".": "0.1.0-alpha.3"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-bf9b5b8a950e0a79b0bf1911bf01feb5a3575113be8f5d24f7b487351f3470c5.yml
configured_endpoints: 2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-703a90257c6ec20e6b67cbb97b6699e96ffef05e62249c4d98bd8fb5b197617d.yml
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
brew "go"
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.3 (2024-10-02)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/Find-AI/find-ai-go/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

### Features

* **api:** OpenAPI spec update via Stainless API ([#9](https://github.com/Find-AI/find-ai-go/issues/9)) ([d41d1a8](https://github.com/Find-AI/find-ai-go/commit/d41d1a890eb84119d69adb5dce51956f8aa473ec))


### Chores

* **internal:** codegen related update ([#11](https://github.com/Find-AI/find-ai-go/issues/11)) ([d0ee6be](https://github.com/Find-AI/find-ai-go/commit/d0ee6be7f1d08ec88d5ac64116dbcb61f8c8716c))

## 0.1.0-alpha.2 (2024-09-26)

Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/Find-AI/find-ai-go/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
Expand Down
33 changes: 20 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
## Setting up the environment

### Install Go 1.18+
To set up the repository, run:

Install go by following relevant directions [here](https://go.dev/doc/install).
```sh
$ ./scripts/bootstrap
$ ./scripts/build
```

This will install all the required dependencies and build the SDK.

You can also [install go 1.18+ manually](https://go.dev/doc/install).

## Modifying/Adding code

Expand All @@ -14,7 +21,7 @@ modify the contents of the `lib/` and `examples/` directories.

All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.

```bash
```go
# add an example to examples/<your-example>/main.go

package main
Expand All @@ -24,36 +31,36 @@ func main() {
}
```

```bash
go run ./examples/<your-example>
```sh
$ go run ./examples/<your-example>
```

## Using the repository from source

To use a local version of this library from source in another project, edit the `go.mod` with a replace
directive. This can be done through the CLI with the following:

```bash
go mod edit -replace github.com/Find-AI/find-ai-go=/path/to/find-ai-go
```sh
$ go mod edit -replace github.com/Find-AI/find-ai-go=/path/to/find-ai-go
```

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```bash
```sh
# you will need npm installed
npx prism mock path/to/your/openapi.yml
$ npx prism mock path/to/your/openapi.yml
```

```bash
go test ./...
```sh
$ ./scripts/test
```

## Formatting

This library uses the standard gofmt code formatter:

```bash
gofmt -s -w .
```sh
$ ./scripts/format
```
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/Find-AI/[email protected].2'
go get -u 'github.com/Find-AI/[email protected].3'
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -336,3 +336,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/Find-AI/find-ai-go/issues) with questions, bugs, or suggestions.

## Contributing

See [the contributing documentation](./CONTRIBUTING.md).
20 changes: 0 additions & 20 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,10 @@

## Enrich

Response Types:

- <a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#CompanyEnrichmentEnrichNewResponse">CompanyEnrichmentEnrichNewResponse</a>
- <a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#CompanyEnrichmentEnrichGetResponse">CompanyEnrichmentEnrichGetResponse</a>

Methods:

- <code title="post /v1/companies/enrich">client.CompanyEnrichment.Enrich.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#CompanyEnrichmentEnrichService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#CompanyEnrichmentEnrichNewParams">CompanyEnrichmentEnrichNewParams</a>) (<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#CompanyEnrichmentEnrichNewResponse">CompanyEnrichmentEnrichNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /v1/companies/enrich/{token}">client.CompanyEnrichment.Enrich.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#CompanyEnrichmentEnrichService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, token <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#CompanyEnrichmentEnrichGetResponse">CompanyEnrichmentEnrichGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

# PeopleEnrichment

## Enrich

Response Types:

- <a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#PeopleEnrichmentEnrichNewResponse">PeopleEnrichmentEnrichNewResponse</a>
- <a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#PeopleEnrichmentEnrichGetResponse">PeopleEnrichmentEnrichGetResponse</a>

Methods:

- <code title="post /v1/people/enrich">client.PeopleEnrichment.Enrich.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#PeopleEnrichmentEnrichService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#PeopleEnrichmentEnrichNewParams">PeopleEnrichmentEnrichNewParams</a>) (<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#PeopleEnrichmentEnrichNewResponse">PeopleEnrichmentEnrichNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /v1/people/enrich/{token}">client.PeopleEnrichment.Enrich.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#PeopleEnrichmentEnrichService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, token <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go">findai</a>.<a href="https://pkg.go.dev/github.com/Find-AI/find-ai-go#PeopleEnrichmentEnrichGetResponse">PeopleEnrichmentEnrichGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

# Searches

Response Types:
Expand Down
108 changes: 0 additions & 108 deletions companyenrichmentenrich.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
package findai

import (
"context"
"errors"
"fmt"
"net/http"

"github.com/Find-AI/find-ai-go/internal/apijson"
"github.com/Find-AI/find-ai-go/internal/param"
"github.com/Find-AI/find-ai-go/internal/requestconfig"
"github.com/Find-AI/find-ai-go/option"
)

Expand All @@ -32,103 +24,3 @@ func NewCompanyEnrichmentEnrichService(opts ...option.RequestOption) (r *Company
r.Options = opts
return
}

// Returns structured data about a company based on a domain input.
func (r *CompanyEnrichmentEnrichService) New(ctx context.Context, body CompanyEnrichmentEnrichNewParams, opts ...option.RequestOption) (res *CompanyEnrichmentEnrichNewResponse, err error) {
opts = append(r.Options[:], opts...)
path := "v1/companies/enrich"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

// The endpoint to poll to check the latest results when data about a company isn't
// immediately available.
func (r *CompanyEnrichmentEnrichService) Get(ctx context.Context, token string, opts ...option.RequestOption) (res *CompanyEnrichmentEnrichGetResponse, err error) {
opts = append(r.Options[:], opts...)
if token == "" {
err = errors.New("missing required token parameter")
return
}
path := fmt.Sprintf("v1/companies/enrich/%s", token)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}

type CompanyEnrichmentEnrichNewResponse struct {
// A list of facts we have on record about the company.
Facts []string `json:"facts,required"`
Name string `json:"name,required"`
// A summary of information about the company.
ShortDescription string `json:"short_description,required"`
Website string `json:"website,required"`
// The URL to the company's LinkedIn profile if one exists.
LinkedinURL string `json:"linkedin_url"`
// A URL to an image of the company's logo. Valid for 10 minutes.
PhotoURL string `json:"photo_url"`
JSON companyEnrichmentEnrichNewResponseJSON `json:"-"`
}

// companyEnrichmentEnrichNewResponseJSON contains the JSON metadata for the struct
// [CompanyEnrichmentEnrichNewResponse]
type companyEnrichmentEnrichNewResponseJSON struct {
Facts apijson.Field
Name apijson.Field
ShortDescription apijson.Field
Website apijson.Field
LinkedinURL apijson.Field
PhotoURL apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *CompanyEnrichmentEnrichNewResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r companyEnrichmentEnrichNewResponseJSON) RawJSON() string {
return r.raw
}

type CompanyEnrichmentEnrichGetResponse struct {
// A list of facts we have on record about the company.
Facts []string `json:"facts,required"`
Name string `json:"name,required"`
// A summary of information about the company.
ShortDescription string `json:"short_description,required"`
Website string `json:"website,required"`
// The URL to the company's LinkedIn profile if one exists.
LinkedinURL string `json:"linkedin_url"`
// A URL to an image of the company's logo. Valid for 10 minutes.
PhotoURL string `json:"photo_url"`
JSON companyEnrichmentEnrichGetResponseJSON `json:"-"`
}

// companyEnrichmentEnrichGetResponseJSON contains the JSON metadata for the struct
// [CompanyEnrichmentEnrichGetResponse]
type companyEnrichmentEnrichGetResponseJSON struct {
Facts apijson.Field
Name apijson.Field
ShortDescription apijson.Field
Website apijson.Field
LinkedinURL apijson.Field
PhotoURL apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *CompanyEnrichmentEnrichGetResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r companyEnrichmentEnrichGetResponseJSON) RawJSON() string {
return r.raw
}

type CompanyEnrichmentEnrichNewParams struct {
// The domain of the company.
Domain param.Field[string] `json:"domain"`
}

func (r CompanyEnrichmentEnrichNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
60 changes: 0 additions & 60 deletions companyenrichmentenrich_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.1.0-alpha.2" // x-release-please-version
const PackageVersion = "0.1.0-alpha.3" // x-release-please-version
Loading

0 comments on commit 702f912

Please sign in to comment.