Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"clientName": "Namecom",
"enableWireTests": true
},
"originGitCommit": "c3ab257628a7366dab6a8ad857854de9416d2338",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"requestedVersion": "1.29.0",
"sdkVersion": "v1.29.0"
"invokedBy": "ci",
"requestedVersion": "1.31.0",
"ciProvider": "gitlab",
"sdkVersion": "v1.31.0"
}
16 changes: 16 additions & 0 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Specify files that shouldn't be modified by Fern
.fern/replay.lock
.fern/replay.yml
.gitattributes
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.fern/replay.lock linguist-generated=true
70 changes: 15 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Namecom Go Library
# name.com Core API Go Library

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fnamedotcom%2Fcore-api-go)

The Namecom Go library provides convenient access to the Namecom APIs from Go.
The name.com Core API Go library provides convenient access to the name.com Core API APIs from Go.

## Table of Contents

- [Documentation](#documentation)
- [Reference](#reference)
- [Usage](#usage)
- [Environments](#environments)
Expand All @@ -18,6 +19,10 @@ The Namecom Go library provides convenient access to the Namecom APIs from Go.
- [Explicit Null](#explicit-null)
- [Contributing](#contributing)

## Documentation

API reference documentation is available [here](https://docs.name.com).

## Reference

A full reference for this library is available [here](https://github.com/namedotcom/core-api-go/blob/HEAD/./reference.md).
Expand All @@ -32,7 +37,6 @@ package example
import (
context "context"

coreapigo "github.com/namedotcom/core-api-go"
client "github.com/namedotcom/core-api-go/client"
option "github.com/namedotcom/core-api-go/option"
)
Expand All @@ -44,52 +48,8 @@ func do() {
"<password>",
),
)
request := &coreapigo.CreateAccountRequest{
Account: &coreapigo.AccountRequest{
Contacts: &coreapigo.ContactsRequest{
Registrant: &coreapigo.RegistrantContactRequest{
FirstName: coreapigo.String(
"Jane",
),
LastName: coreapigo.String(
"Doe",
),
Address1: coreapigo.String(
"123 Main St.",
),
City: coreapigo.String(
"Denver",
),
State: coreapigo.String(
"CO",
),
Zip: coreapigo.String(
"12345",
),
Country: coreapigo.String(
"US",
),
Email: coreapigo.String(
"admin@example.net",
),
Phone: coreapigo.String(
"+13035551212",
),
},
},
AccountName: coreapigo.String(
"reseller_subaccount",
),
Password: coreapigo.String(
"SecureP4ss!",
),
},
APITos: true,
Tos: true,
}
client.Accounts.CreateAccount(
client.Hello(
context.TODO(),
request,
)
}
```
Expand All @@ -101,7 +61,7 @@ URL, which is particularly useful in test environments.

```go
client := client.NewClient(
option.WithBaseURL(api.Environments.Default),
option.WithBaseURL(api.Environments.Sandbox),
)
```

Expand All @@ -111,7 +71,7 @@ Structured error types are returned from API calls that return non-success statu
with the `errors.Is` and `errors.As` APIs, so you can access the error like so:

```go
response, err := client.Accounts.CreateAccount(...)
response, err := client.Hello(...)
if err != nil {
var apiError *core.APIError
if errors.As(err, apiError) {
Expand Down Expand Up @@ -145,7 +105,7 @@ client := client.NewClient(
)

// Specify options for an individual request.
response, err := client.Accounts.CreateAccount(
response, err := client.Hello(
...,
option.WithToken("<YOUR_API_KEY>"),
)
Expand All @@ -160,7 +120,7 @@ when you need to examine the response headers received from the API call. (When
the raw HTTP response data will be included automatically in the Page response object.)

```go
response, err := client.Accounts.WithRawResponse.CreateAccount(...)
response, err := client.WithRawResponse.Hello(...)
if err != nil {
return err
}
Expand Down Expand Up @@ -198,7 +158,7 @@ client := client.NewClient(
option.WithMaxAttempts(1),
)

response, err := client.Accounts.CreateAccount(
response, err := client.Hello(
...,
option.WithMaxAttempts(1),
)
Expand All @@ -212,7 +172,7 @@ Setting a timeout for each individual request is as simple as using the standard
ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()

response, err := client.Accounts.CreateAccount(ctx, ...)
response, err := client.Hello(ctx, ...)
```

### Explicit Null
Expand All @@ -234,7 +194,7 @@ type ExampleRequest struct {
request := &ExampleRequest{}
request.SetName(nil)

response, err := client.Accounts.CreateAccount(ctx, request, ...)
response, err := client.Hello(ctx, request, ...)
```

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions core/request_option.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 13 additions & 23 deletions dnsse_cs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 8 additions & 47 deletions dnsse_cs_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading