api

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidRequestError = "invalid_request_error"
	APIError            = "api_error"
)

Common error reasons

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

type ApiClient struct {
	BaseUrl              string
	ServiceName          string
	UrlBasedAccessKey    string
	HeaderBasedAccessKey string
	HttpClient           *http.Client
}

func (*ApiClient) Get

func (apiClient *ApiClient) Get(path RequestPath, response interface{}) *ApiErrorResponse

func (*ApiClient) Post

func (apiClient *ApiClient) Post(path RequestPath, requestBody interface{}, response interface{}) *ApiErrorResponse

func (*ApiClient) PostForm

func (apiClient *ApiClient) PostForm(path RequestPath, requestBody map[string]interface{}, response interface{}) *ApiErrorResponse

func (*ApiClient) ProcessRequest

func (apiClient *ApiClient) ProcessRequest(method string,
	path RequestPath,
	request interface{}, response interface{}) *ApiErrorResponse

func (*ApiClient) ProcessRequestWithHeaders

func (apiClient *ApiClient) ProcessRequestWithHeaders(method string,
	path RequestPath,
	request interface{}, response interface{}, headers map[string]string) *ApiErrorResponse

func (*ApiClient) SendAndDeserialize

func (apiClient *ApiClient) SendAndDeserialize(
	method string,
	path RequestPath,
	request interface{}, response interface{}) (*http.Response, error)

func (*ApiClient) SendAndDeserializeWithHeaders

func (apiClient *ApiClient) SendAndDeserializeWithHeaders(
	method string,
	path RequestPath,
	request interface{}, response interface{}, headers map[string]string) (*http.Response, error)

type ApiErrorResponse

type ApiErrorResponse struct {
	Error         error                     // The raw error from the HTTP request
	HttpResponse  *http.Response            // The raw response from the HTTP request
	StatusCode    int                       // The status code, possibly adjusted by the API client
	ErrorResponse commonProto.ErrorResponse // A pre-built ErrorResponse
}

A method for tracking an API error and it's parts

func (*ApiErrorResponse) String

func (err *ApiErrorResponse) String() string

type ControlPlaneClient

type ControlPlaneClient struct {
	// contains filtered or unexported fields
}

func NewControlPlaneClient

func NewControlPlaneClient(c config.SDKConfig) *ControlPlaneClient

func (*ControlPlaneClient) ListRegions

type DataPlaneClient

type DataPlaneClient struct {
	// contains filtered or unexported fields
}

func NewDataPlaneClient

func NewDataPlaneClient(c config.SDKConfig) *DataPlaneClient

func (*DataPlaneClient) AddJourneyFeedback added in v0.2.0

func (client *DataPlaneClient) AddJourneyFeedback(journeyId string, feedback *journeyFeedbackProto.JourneyFeedback) *ApiErrorResponse

func (*DataPlaneClient) DescribeJourney added in v0.2.0

func (client *DataPlaneClient) DescribeJourney(journeyId string) (*dataPlaneProto.JourneyDetailResponse, *ApiErrorResponse)

func (*DataPlaneClient) DescribeSession

func (client *DataPlaneClient) DescribeSession(sessionId string, minimal bool) (*dataPlaneSDKProto.Session, *ApiErrorResponse)

func (*DataPlaneClient) GetJourneyFeedback added in v0.2.0

func (client *DataPlaneClient) GetJourneyFeedback(journeyId string) (*journeyFeedbackProto.JourneyFeedback, *ApiErrorResponse)

func (*DataPlaneClient) ListJourneys added in v0.2.0

func (client *DataPlaneClient) ListJourneys(listJourneyConfig config.ListJourneyConfig) (*dataPlaneProto.JourneyListResponse, *ApiErrorResponse)

func (*DataPlaneClient) ListSessionFeatures

func (client *DataPlaneClient) ListSessionFeatures(sessionId string, region *string) (*dataPlaneProto.SessionFeaturesResponse, *ApiErrorResponse)

func (*DataPlaneClient) ListSessionSignals

func (client *DataPlaneClient) ListSessionSignals(sessionId string, region *string) (*dataPlaneProto.SignalsResponse, *ApiErrorResponse)

func (*DataPlaneClient) ListSessions

func (client *DataPlaneClient) ListSessions(listSessionConfig config.ListSessionConfig) (*dataPlaneProto.SessionListResponse, *ApiErrorResponse)

func (*DataPlaneClient) ReadSession

func (client *DataPlaneClient) ReadSession(sessionId string, region *string) ([]*bundle.SealedBundle, *ApiErrorResponse)

func (*DataPlaneClient) UpdateSessionLabels

func (client *DataPlaneClient) UpdateSessionLabels(sessionId string, labels []string) *ApiErrorResponse

func (*DataPlaneClient) WhoAmI

type DynamicPath

type DynamicPath struct {
	DynamicPath string
	PathParams  map[string]string
	QueryParams url.Values
}

func NewDynamicPath

func NewDynamicPath(dynamicPath string, params map[string]string) *DynamicPath

func NewDynamicPathWithQueryParams

func NewDynamicPathWithQueryParams(dynamicPath string, params map[string]string, queryParams url.Values) *DynamicPath

func (*DynamicPath) Encode

func (d *DynamicPath) Encode() string

func (*DynamicPath) RawPath

func (s *DynamicPath) RawPath() string

type RequestPath

type RequestPath interface {
	Encode() string
	RawPath() string
}

Generic Path representation

type StaticPath

type StaticPath struct {
	Path string
}

Static Paths just store the path

func NewStaticPath

func NewStaticPath(path string) *StaticPath

func (*StaticPath) Encode

func (s *StaticPath) Encode() string

func (*StaticPath) RawPath

func (s *StaticPath) RawPath() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL