All URIs are relative to https://api.segmentapis.com
Method | HTTP request | Description |
---|---|---|
CreateComputedTrait | Post /spaces/{spaceId}/computed-traits | Create Computed Trait |
GetComputedTrait | Get /spaces/{spaceId}/computed-traits/{id} | Get Computed Trait |
ListComputedTraits | Get /spaces/{spaceId}/computed-traits | List Computed Traits |
RemoveComputedTraitFromSpace | Delete /spaces/{spaceId}/computed-traits/{id} | Remove Computed Trait from Space |
UpdateComputedTraitForSpace | Patch /spaces/{spaceId}/computed-traits/{id} | Update Computed Trait for Space |
CreateComputedTrait200Response CreateComputedTrait(ctx, spaceId).CreateComputedTraitAlphaInput(createComputedTraitAlphaInput).Execute()
Create Computed Trait
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
spaceId := "spaceId" // string |
createComputedTraitAlphaInput := *api.NewCreateComputedTraitAlphaInput("Name_example", *api.NewTraitDefinition("Type_example", "Query_example")) // CreateComputedTraitAlphaInput |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.ComputedTraitsAPI.CreateComputedTrait(ctx, spaceId).CreateComputedTraitAlphaInput(createComputedTraitAlphaInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ComputedTraitsAPI.CreateComputedTrait``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `CreateComputedTrait`: CreateComputedTrait200Response
fmt.Fprintf(os.Stdout, "Response from `ComputedTraitsAPI.CreateComputedTrait`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string |
Other parameters are passed through a pointer to a apiCreateComputedTraitRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
createComputedTraitAlphaInput | CreateComputedTraitAlphaInput | |
CreateComputedTrait200Response
- Content-Type: application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1alpha+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetComputedTrait200Response GetComputedTrait(ctx, spaceId, id).Execute()
Get Computed Trait
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
spaceId := "spaceId" // string |
id := "id" // string |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.ComputedTraitsAPI.GetComputedTrait(ctx, spaceId, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ComputedTraitsAPI.GetComputedTrait``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `GetComputedTrait`: GetComputedTrait200Response
fmt.Fprintf(os.Stdout, "Response from `ComputedTraitsAPI.GetComputedTrait`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string | ||
id | string |
Other parameters are passed through a pointer to a apiGetComputedTraitRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/vnd.segment.v1alpha+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListComputedTraits200Response ListComputedTraits(ctx, spaceId).Pagination(pagination).Execute()
List Computed Traits
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
spaceId := "spaceId" // string |
pagination := *api.NewPaginationInput(10) // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.ComputedTraitsAPI.ListComputedTraits(ctx, spaceId).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ComputedTraitsAPI.ListComputedTraits``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `ListComputedTraits`: ListComputedTraits200Response
fmt.Fprintf(os.Stdout, "Response from `ComputedTraitsAPI.ListComputedTraits`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string |
Other parameters are passed through a pointer to a apiListComputedTraitsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
pagination | PaginationInput | Information about the pagination of this response. See pagination for more info. This parameter exists in alpha. |
- Content-Type: Not defined
- Accept: application/vnd.segment.v1alpha+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveComputedTraitFromSpace200Response RemoveComputedTraitFromSpace(ctx, spaceId, id).Execute()
Remove Computed Trait from Space
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
spaceId := "spaceId" // string |
id := "id" // string |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.ComputedTraitsAPI.RemoveComputedTraitFromSpace(ctx, spaceId, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ComputedTraitsAPI.RemoveComputedTraitFromSpace``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `RemoveComputedTraitFromSpace`: RemoveComputedTraitFromSpace200Response
fmt.Fprintf(os.Stdout, "Response from `ComputedTraitsAPI.RemoveComputedTraitFromSpace`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string | ||
id | string |
Other parameters are passed through a pointer to a apiRemoveComputedTraitFromSpaceRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
RemoveComputedTraitFromSpace200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1alpha+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateComputedTraitForSpace200Response UpdateComputedTraitForSpace(ctx, spaceId, id).UpdateComputedTraitForSpaceAlphaInput(updateComputedTraitForSpaceAlphaInput).Execute()
Update Computed Trait for Space
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
spaceId := "spaceId" // string |
id := "id" // string |
updateComputedTraitForSpaceAlphaInput := *api.NewUpdateComputedTraitForSpaceAlphaInput() // UpdateComputedTraitForSpaceAlphaInput |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.ComputedTraitsAPI.UpdateComputedTraitForSpace(ctx, spaceId, id).UpdateComputedTraitForSpaceAlphaInput(updateComputedTraitForSpaceAlphaInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ComputedTraitsAPI.UpdateComputedTraitForSpace``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `UpdateComputedTraitForSpace`: UpdateComputedTraitForSpace200Response
fmt.Fprintf(os.Stdout, "Response from `ComputedTraitsAPI.UpdateComputedTraitForSpace`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
spaceId | string | ||
id | string |
Other parameters are passed through a pointer to a apiUpdateComputedTraitForSpaceRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateComputedTraitForSpaceAlphaInput | UpdateComputedTraitForSpaceAlphaInput | |
UpdateComputedTraitForSpace200Response
- Content-Type: application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1alpha+json, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]