Skip to content

Latest commit

 

History

History
397 lines (265 loc) · 12.7 KB

TransformationsAPI.md

File metadata and controls

397 lines (265 loc) · 12.7 KB

\TransformationsAPI

All URIs are relative to https://api.segmentapis.com

Method HTTP request Description
CreateTransformation Post /transformations Create Transformation
DeleteTransformation Delete /transformations/{transformationId} Delete Transformation
GetTransformation Get /transformations/{transformationId} Get Transformation
ListTransformations Get /transformations List Transformations
UpdateTransformation Patch /transformations/{transformationId} Update Transformation

Operation: CreateTransformation

CreateTransformation200Response CreateTransformation(ctx).CreateTransformationV1Input(createTransformationV1Input).Execute()

Create Transformation

Example

package main

import (
    "context"
    "fmt"
    "os"
    api "github.com/segmentio/public-api-sdk-go"
)

func main() {
    createTransformationV1Input := *api.NewCreateTransformationV1Input("Name_example", "SourceId_example", false, "If_example") // CreateTransformationV1Input | 

    configuration := api.NewConfiguration()
    apiClient := api.NewAPIClient(configuration)
    token := "<BEARER_TOKEN>"
    ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
    resp, r, err := apiClient.TransformationsAPI.CreateTransformation(ctx).CreateTransformationV1Input(createTransformationV1Input).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TransformationsAPI.CreateTransformation``: %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 `CreateTransformation`: CreateTransformation200Response
    fmt.Fprintf(os.Stdout, "Response from `TransformationsAPI.CreateTransformation`: %v\n", resp.GetData())
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateTransformationRequest struct via the builder pattern

Name Type Description Notes
createTransformationV1Input CreateTransformationV1Input

Return type

CreateTransformation200Response

Authorization

token

HTTP request headers

  • Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
  • Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Operation: DeleteTransformation

DeleteTransformation200Response DeleteTransformation(ctx, transformationId).Execute()

Delete Transformation

Example

package main

import (
    "context"
    "fmt"
    "os"
    api "github.com/segmentio/public-api-sdk-go"
)

func main() {
    transformationId := "2c0vVuRdDmJ3UQkVjd5WxaA3dar" // string | 

    configuration := api.NewConfiguration()
    apiClient := api.NewAPIClient(configuration)
    token := "<BEARER_TOKEN>"
    ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
    resp, r, err := apiClient.TransformationsAPI.DeleteTransformation(ctx, transformationId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TransformationsAPI.DeleteTransformation``: %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 `DeleteTransformation`: DeleteTransformation200Response
    fmt.Fprintf(os.Stdout, "Response from `TransformationsAPI.DeleteTransformation`: %v\n", resp.GetData())
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
transformationId string

Other Parameters

Other parameters are passed through a pointer to a apiDeleteTransformationRequest struct via the builder pattern

Name Type Description Notes

Return type

DeleteTransformation200Response

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Operation: GetTransformation

GetTransformation200Response GetTransformation(ctx, transformationId).Execute()

Get Transformation

Example

package main

import (
    "context"
    "fmt"
    "os"
    api "github.com/segmentio/public-api-sdk-go"
)

func main() {
    transformationId := "pHrD51Ds35Zjfka84yXQE6" // string | 

    configuration := api.NewConfiguration()
    apiClient := api.NewAPIClient(configuration)
    token := "<BEARER_TOKEN>"
    ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
    resp, r, err := apiClient.TransformationsAPI.GetTransformation(ctx, transformationId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TransformationsAPI.GetTransformation``: %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 `GetTransformation`: GetTransformation200Response
    fmt.Fprintf(os.Stdout, "Response from `TransformationsAPI.GetTransformation`: %v\n", resp.GetData())
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
transformationId string

Other Parameters

Other parameters are passed through a pointer to a apiGetTransformationRequest struct via the builder pattern

Name Type Description Notes

Return type

GetTransformation200Response

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Operation: ListTransformations

ListTransformations200Response ListTransformations(ctx).Pagination(pagination).Execute()

List Transformations

Example

package main

import (
    "context"
    "fmt"
    "os"
    api "github.com/segmentio/public-api-sdk-go"
)

func main() {
    pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination options.  This parameter exists in v1. (optional)

    configuration := api.NewConfiguration()
    apiClient := api.NewAPIClient(configuration)
    token := "<BEARER_TOKEN>"
    ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
    resp, r, err := apiClient.TransformationsAPI.ListTransformations(ctx).Pagination(pagination).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TransformationsAPI.ListTransformations``: %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 `ListTransformations`: ListTransformations200Response
    fmt.Fprintf(os.Stdout, "Response from `TransformationsAPI.ListTransformations`: %v\n", resp.GetData())
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListTransformationsRequest struct via the builder pattern

Name Type Description Notes
pagination PaginationInput Pagination options. This parameter exists in v1.

Return type

ListTransformations200Response

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Operation: UpdateTransformation

UpdateTransformation200Response UpdateTransformation(ctx, transformationId).UpdateTransformationV1Input(updateTransformationV1Input).Execute()

Update Transformation

Example

package main

import (
    "context"
    "fmt"
    "os"
    api "github.com/segmentio/public-api-sdk-go"
)

func main() {
    transformationId := "pHrD51Ds35Zjfka84yXQE6" // string | 
    updateTransformationV1Input := *api.NewUpdateTransformationV1Input() // UpdateTransformationV1Input | 

    configuration := api.NewConfiguration()
    apiClient := api.NewAPIClient(configuration)
    token := "<BEARER_TOKEN>"
    ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
    resp, r, err := apiClient.TransformationsAPI.UpdateTransformation(ctx, transformationId).UpdateTransformationV1Input(updateTransformationV1Input).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TransformationsAPI.UpdateTransformation``: %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 `UpdateTransformation`: UpdateTransformation200Response
    fmt.Fprintf(os.Stdout, "Response from `TransformationsAPI.UpdateTransformation`: %v\n", resp.GetData())
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
transformationId string

Other Parameters

Other parameters are passed through a pointer to a apiUpdateTransformationRequest struct via the builder pattern

Name Type Description Notes

updateTransformationV1Input | UpdateTransformationV1Input | |

Return type

UpdateTransformation200Response

Authorization

token

HTTP request headers

  • Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
  • Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]