All URIs are relative to https://api.gitbook.com/v1
Method | HTTP request | Description |
---|---|---|
CreateEnvironment | Post /orgs/{organizationId}/environments | Create a new environment within an organization |
DeleteEnvironment | Delete /orgs/{organizationId}/environments/{environmentName} | Delete an environment in an organization |
GetEnvironmentByName | Get /orgs/{organizationId}/environments/{environmentName} | Get an environment by its name |
ListEnvironments | Get /orgs/{organizationId}/environments | Get the environments in an organization |
UpdateEnvironment | Patch /orgs/{organizationId}/environments/{environmentName} | Update an existing environment within an organization |
Environment CreateEnvironment(ctx, organizationId).CreateEnvironment(createEnvironment).Execute()
Create a new environment within an organization
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
organizationId := "organizationId_example" // string | The unique id of the organization
createEnvironment := *openapiclient.NewCreateEnvironment("Name_example", "Title_example") // CreateEnvironment |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.CreateEnvironment(context.Background(), organizationId).CreateEnvironment(createEnvironment).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.CreateEnvironment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateEnvironment`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.CreateEnvironment`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
organizationId | string | The unique id of the organization |
Other parameters are passed through a pointer to a apiCreateEnvironmentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
createEnvironment | CreateEnvironment | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteEnvironment(ctx, organizationId, environmentName).Execute()
Delete an environment in an organization
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
organizationId := "organizationId_example" // string | The unique id of the organization
environmentName := "environmentName_example" // string | The unique name of the environment within the organization
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.EnvironmentsApi.DeleteEnvironment(context.Background(), organizationId, environmentName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.DeleteEnvironment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
organizationId | string | The unique id of the organization | |
environmentName | string | The unique name of the environment within the organization |
Other parameters are passed through a pointer to a apiDeleteEnvironmentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Environment GetEnvironmentByName(ctx, organizationId, environmentName).Execute()
Get an environment by its name
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
organizationId := "organizationId_example" // string | The unique id of the organization
environmentName := "environmentName_example" // string | The unique name of the environment within the organization
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.GetEnvironmentByName(context.Background(), organizationId, environmentName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.GetEnvironmentByName``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetEnvironmentByName`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.GetEnvironmentByName`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
organizationId | string | The unique id of the organization | |
environmentName | string | The unique name of the environment within the organization |
Other parameters are passed through a pointer to a apiGetEnvironmentByNameRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListEnvironments200Response ListEnvironments(ctx, organizationId).Page(page).Limit(limit).Execute()
Get the environments in an organization
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
organizationId := "organizationId_example" // string | The unique id of the organization
page := "page_example" // string | Identifier of the page results to fetch. (optional)
limit := float32(8.14) // float32 | The number of results per page (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.ListEnvironments(context.Background(), organizationId).Page(page).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.ListEnvironments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListEnvironments`: ListEnvironments200Response
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.ListEnvironments`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
organizationId | string | The unique id of the organization |
Other parameters are passed through a pointer to a apiListEnvironmentsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
page | string | Identifier of the page results to fetch. | limit | float32 | The number of results per page |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Environment UpdateEnvironment(ctx, organizationId, environmentName).UpdateEnvironment(updateEnvironment).Execute()
Update an existing environment within an organization
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/GitbookIO/go-gitbook"
)
func main() {
organizationId := "organizationId_example" // string | The unique id of the organization
environmentName := "environmentName_example" // string | The unique name of the environment within the organization
updateEnvironment := *openapiclient.NewUpdateEnvironment() // UpdateEnvironment |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.UpdateEnvironment(context.Background(), organizationId, environmentName).UpdateEnvironment(updateEnvironment).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.UpdateEnvironment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateEnvironment`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.UpdateEnvironment`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
organizationId | string | The unique id of the organization | |
environmentName | string | The unique name of the environment within the organization |
Other parameters are passed through a pointer to a apiUpdateEnvironmentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateEnvironment | UpdateEnvironment | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]