interactiveguidance

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package interactiveguidance provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.

Index

Constants

View Source
const (
	OAuth2Scopes = "OAuth2.Scopes"
)

Variables

This section is empty.

Functions

func NewIterateInteractiveSessionIdPostRequest

func NewIterateInteractiveSessionIdPostRequest(server string, sessionId string, params *IterateInteractiveSessionIdPostParams, body IterateInteractiveSessionIdPostJSONRequestBody) (*http.Request, error)

NewIterateInteractiveSessionIdPostRequest calls the generic IterateInteractiveSessionIdPost builder with application/json body

func NewIterateInteractiveSessionIdPostRequestWithBody

func NewIterateInteractiveSessionIdPostRequestWithBody(server string, sessionId string, params *IterateInteractiveSessionIdPostParams, contentType string, body io.Reader) (*http.Request, error)

NewIterateInteractiveSessionIdPostRequestWithBody generates requests for IterateInteractiveSessionIdPost with any type of body

func NewStartInteractivePostRequest

func NewStartInteractivePostRequest(server string, params *StartInteractivePostParams, body StartInteractivePostJSONRequestBody) (*http.Request, error)

NewStartInteractivePostRequest calls the generic StartInteractivePost builder with application/json body

func NewStartInteractivePostRequestWithBody

func NewStartInteractivePostRequestWithBody(server string, params *StartInteractivePostParams, contentType string, body io.Reader) (*http.Request, error)

NewStartInteractivePostRequestWithBody generates requests for StartInteractivePost with any type of body

func NewSubmitFeedbackInteractiveFeedbackSessionIdPostRequest

func NewSubmitFeedbackInteractiveFeedbackSessionIdPostRequest(server string, sessionId string, body SubmitFeedbackInteractiveFeedbackSessionIdPostJSONRequestBody) (*http.Request, error)

NewSubmitFeedbackInteractiveFeedbackSessionIdPostRequest calls the generic SubmitFeedbackInteractiveFeedbackSessionIdPost builder with application/json body

func NewSubmitFeedbackInteractiveFeedbackSessionIdPostRequestWithBody

func NewSubmitFeedbackInteractiveFeedbackSessionIdPostRequestWithBody(server string, sessionId string, contentType string, body io.Reader) (*http.Request, error)

NewSubmitFeedbackInteractiveFeedbackSessionIdPostRequestWithBody generates requests for SubmitFeedbackInteractiveFeedbackSessionIdPost with any type of body

Types

type Answer

type Answer struct {
	// Id The "id" field in the response structure represents the unique identifier of the question that was answered.
	// This identifier helps track which specific question the user's response corresponds to, ensuring the accuracy and continuity of the interactive session. It is used to maintain the sequence of interactions and to provide context for subsequent questions and answers.
	Id string `json:"id"`

	// Selected The "selected" field represents the index of the chosen option from the multiple-choice answers provided for a specific question.
	// This is a 0-based index, meaning the first option is represented by 0, the second by 1, and so on.
	// This field ensures that the system accurately records the user's choice and continues the interactive session based on the selected answer.
	Selected int `json:"selected"`
}

Answer defines model for Answer.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) IterateInteractiveSessionIdPost

func (c *Client) IterateInteractiveSessionIdPost(ctx context.Context, sessionId string, params *IterateInteractiveSessionIdPostParams, body IterateInteractiveSessionIdPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) IterateInteractiveSessionIdPostWithBody

func (c *Client) IterateInteractiveSessionIdPostWithBody(ctx context.Context, sessionId string, params *IterateInteractiveSessionIdPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) StartInteractivePost

func (c *Client) StartInteractivePost(ctx context.Context, params *StartInteractivePostParams, body StartInteractivePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) StartInteractivePostWithBody

func (c *Client) StartInteractivePostWithBody(ctx context.Context, params *StartInteractivePostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SubmitFeedbackInteractiveFeedbackSessionIdPost

func (c *Client) SubmitFeedbackInteractiveFeedbackSessionIdPost(ctx context.Context, sessionId string, body SubmitFeedbackInteractiveFeedbackSessionIdPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SubmitFeedbackInteractiveFeedbackSessionIdPostWithBody

func (c *Client) SubmitFeedbackInteractiveFeedbackSessionIdPostWithBody(ctx context.Context, sessionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// StartInteractivePostWithBody request with any body
	StartInteractivePostWithBody(ctx context.Context, params *StartInteractivePostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	StartInteractivePost(ctx context.Context, params *StartInteractivePostParams, body StartInteractivePostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SubmitFeedbackInteractiveFeedbackSessionIdPostWithBody request with any body
	SubmitFeedbackInteractiveFeedbackSessionIdPostWithBody(ctx context.Context, sessionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SubmitFeedbackInteractiveFeedbackSessionIdPost(ctx context.Context, sessionId string, body SubmitFeedbackInteractiveFeedbackSessionIdPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// IterateInteractiveSessionIdPostWithBody request with any body
	IterateInteractiveSessionIdPostWithBody(ctx context.Context, sessionId string, params *IterateInteractiveSessionIdPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	IterateInteractiveSessionIdPost(ctx context.Context, sessionId string, params *IterateInteractiveSessionIdPostParams, body IterateInteractiveSessionIdPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) IterateInteractiveSessionIdPostWithBodyWithResponse

func (c *ClientWithResponses) IterateInteractiveSessionIdPostWithBodyWithResponse(ctx context.Context, sessionId string, params *IterateInteractiveSessionIdPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IterateInteractiveSessionIdPostResponse, error)

IterateInteractiveSessionIdPostWithBodyWithResponse request with arbitrary body returning *IterateInteractiveSessionIdPostResponse

func (*ClientWithResponses) StartInteractivePostWithBodyWithResponse

func (c *ClientWithResponses) StartInteractivePostWithBodyWithResponse(ctx context.Context, params *StartInteractivePostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartInteractivePostResponse, error)

StartInteractivePostWithBodyWithResponse request with arbitrary body returning *StartInteractivePostResponse

func (*ClientWithResponses) StartInteractivePostWithResponse

func (*ClientWithResponses) SubmitFeedbackInteractiveFeedbackSessionIdPostWithBodyWithResponse

func (c *ClientWithResponses) SubmitFeedbackInteractiveFeedbackSessionIdPostWithBodyWithResponse(ctx context.Context, sessionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitFeedbackInteractiveFeedbackSessionIdPostResponse, error)

SubmitFeedbackInteractiveFeedbackSessionIdPostWithBodyWithResponse request with arbitrary body returning *SubmitFeedbackInteractiveFeedbackSessionIdPostResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// StartInteractivePostWithBodyWithResponse request with any body
	StartInteractivePostWithBodyWithResponse(ctx context.Context, params *StartInteractivePostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*StartInteractivePostResponse, error)

	StartInteractivePostWithResponse(ctx context.Context, params *StartInteractivePostParams, body StartInteractivePostJSONRequestBody, reqEditors ...RequestEditorFn) (*StartInteractivePostResponse, error)

	// SubmitFeedbackInteractiveFeedbackSessionIdPostWithBodyWithResponse request with any body
	SubmitFeedbackInteractiveFeedbackSessionIdPostWithBodyWithResponse(ctx context.Context, sessionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitFeedbackInteractiveFeedbackSessionIdPostResponse, error)

	SubmitFeedbackInteractiveFeedbackSessionIdPostWithResponse(ctx context.Context, sessionId string, body SubmitFeedbackInteractiveFeedbackSessionIdPostJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitFeedbackInteractiveFeedbackSessionIdPostResponse, error)

	// IterateInteractiveSessionIdPostWithBodyWithResponse request with any body
	IterateInteractiveSessionIdPostWithBodyWithResponse(ctx context.Context, sessionId string, params *IterateInteractiveSessionIdPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IterateInteractiveSessionIdPostResponse, error)

	IterateInteractiveSessionIdPostWithResponse(ctx context.Context, sessionId string, params *IterateInteractiveSessionIdPostParams, body IterateInteractiveSessionIdPostJSONRequestBody, reqEditors ...RequestEditorFn) (*IterateInteractiveSessionIdPostResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Countries

type Countries string

Countries defines model for Countries.

const (
	CA Countries = "CA"
	CN Countries = "CN"
	DE Countries = "DE"
	ES Countries = "ES"
	FR Countries = "FR"
	GB Countries = "GB"
	HK Countries = "HK"
	IE Countries = "IE"
	IT Countries = "IT"
	NL Countries = "NL"
	UK Countries = "UK"
	US Countries = "US"
)

Defines values for Countries.

type CustomErrorResponse

type CustomErrorResponse struct {
	Response ErrorObjList `json:"response"`
}

CustomErrorResponse defines model for CustomErrorResponse.

type ErrorObj

type ErrorObj struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

ErrorObj defines model for ErrorObj.

type ErrorObjList

type ErrorObjList struct {
	Errors []ErrorObj `json:"errors"`
}

ErrorObjList defines model for ErrorObjList.

type Feedback

type Feedback struct {
	// Feedback An optional field for user input to describe the reason for their sentiment.
	Feedback *string `json:"feedback,omitempty"`

	// Id The id field represents the unique identifier of the specific question for which the user is submitting feedback. This identifier ensures that the feedback is accurately associated with the correct question within the session.
	Id string `json:"id"`

	// Sentiment The "sentiment" field is a boolean that indicates the user's sentiment towards the specific question. A value of true represents a positive sentiment, while a value of false represents negative sentiment.
	Sentiment bool `json:"sentiment"`
}

Feedback defines model for Feedback.

type History

type History struct {
	// Assumed Identifies whether the API selected an answer to the corresponding question without having to explicitly ask it to the user. The value true means that the answer was assumed by the API, while false means that the answer was selected by the user.
	Assumed bool `json:"assumed"`

	// Id The "id" field in the response structure represents the unique identifier of the question that was answered.
	// This identifier helps track which specific question the user's response corresponds to, ensuring the accuracy and continuity of the interactive session. It is used to maintain the sequence of interactions and to provide context for subsequent questions and answers.
	Id string `json:"id"`

	// Selected The "selected" field represents the index of the chosen option from the multiple-choice answers provided for a specific question.
	// This is a 0-based index, meaning the first option is represented by 0, the second by 1, and so on.
	// This field ensures that the system accurately records the user's choice and continues the interactive session based on the selected answer.
	Selected int `json:"selected"`
}

History defines model for History.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InteractiveResponse

type InteractiveResponse struct {
	// ActualHts The Harmonized Tariff Schedule (HTS) code representing the currently provided "newProductDescription"
	ActualHts *string `json:"actualHts,omitempty"`

	// Confidence A value between 0.00 and 1.00 representing the APIs likeliness for a suggestedHts to be the final HTS code. A value of 1.00 can also be interpreted as 100% confidence.
	Confidence *float32 `json:"confidence,omitempty"`

	// NewProductDescription An enhanced description generated for the product after processing product details.
	NewProductDescription string `json:"newProductDescription"`

	// NoMoreQuestions This field will be marked as true when the API doesn't have any more questions to ask the user. In this case, the questions list will be empty and the most complete "actualHts" is provided.
	NoMoreQuestions *bool       `json:"noMoreQuestions,omitempty"`
	Questions       *[]Question `json:"questions,omitempty"`

	// Session An object representing the user's session, a series of questions and selected answers.
	Session Session `json:"session"`

	// SuggestedHts The API's prediction for what the final Harmonized Tariff Schedule (HTS) code might be based on the current point of the session.
	SuggestedHts *string `json:"suggestedHts,omitempty"`
}

InteractiveResponse defines model for InteractiveResponse.

type IterateInteractiveSessionIdPostJSONRequestBody

type IterateInteractiveSessionIdPostJSONRequestBody = IterateRequest

IterateInteractiveSessionIdPostJSONRequestBody defines body for IterateInteractiveSessionIdPost for application/json ContentType.

type IterateInteractiveSessionIdPostParams

type IterateInteractiveSessionIdPostParams struct {
	// TransId A 128 bit GUID.
	TransId        string `json:"transId"`
	TransactionSrc string `json:"transactionSrc"`
}

IterateInteractiveSessionIdPostParams defines parameters for IterateInteractiveSessionIdPost.

type IterateInteractiveSessionIdPostResponse

type IterateInteractiveSessionIdPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *InteractiveResponse
	JSON400      *CustomErrorResponse
	JSON401      *CustomErrorResponse
	JSON415      *CustomErrorResponse
	JSON422      *CustomErrorResponse
	JSON500      *CustomErrorResponse
}

func ParseIterateInteractiveSessionIdPostResponse

func ParseIterateInteractiveSessionIdPostResponse(rsp *http.Response) (*IterateInteractiveSessionIdPostResponse, error)

ParseIterateInteractiveSessionIdPostResponse parses an HTTP response from a IterateInteractiveSessionIdPostWithResponse call

func (IterateInteractiveSessionIdPostResponse) Status

Status returns HTTPResponse.Status

func (IterateInteractiveSessionIdPostResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type IterateRequest

type IterateRequest struct {
	Questions []Answer `json:"questions"`
}

IterateRequest defines model for IterateRequest.

type Languages

type Languages string

Languages The language code following the ISO 639-1 standard.

const (
	EN Languages = "EN"
)

Defines values for Languages.

type Question

type Question struct {
	// Assumed Identifies whether the API selected an answer to the corresponding question without having to explicitly ask it to the user.
	Assumed *bool `json:"assumed,omitempty"`

	// Id The unique identifier of a question.
	Id string `json:"id"`

	// Options A list representing the most common possible answers to a question.
	Options []string `json:"options"`

	// Other An extended list of "options". When a large list of potential options are generated by the API, uncommon options will be categorized into the "other" field.
	// For all intensive purposes, selecting an option from the other list should be treated as an indexable list as a continuation of options. For example, if "options" is a list of 5 items, selecting the first value from "other" would be index 5.
	Other *[]string `json:"other,omitempty"`

	// Question A question asked by the API to help clarify and improve product description.
	Question string `json:"question"`

	// Selected The "selected" field represents the index of the chosen option from the multiple-choice answers provided for a specific question.
	// This is a 0-based index, meaning the first option is represented by 0, the second by 1, and so on.
	// This field ensures that the system accurately records the user's choice and continues the interactive session based on the selected answer.
	Selected *int          `json:"selected,omitempty"`
	Type     *QuestionType `json:"type,omitempty"`
}

Question defines model for Question.

type QuestionType

type QuestionType string

QuestionType defines model for QuestionType.

const (
	MultipleChoice QuestionType = "multiple_choice"
)

Defines values for QuestionType.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Session

type Session struct {
	HistoryDesc *[]History `json:"historyDesc,omitempty"`

	// Id A unique identifier for representing the session belonging a user.
	Id string `json:"id"`
}

Session An object representing the user's session, a series of questions and selected answers.

type StartInteractivePostJSONRequestBody

type StartInteractivePostJSONRequestBody = StartRequest

StartInteractivePostJSONRequestBody defines body for StartInteractivePost for application/json ContentType.

type StartInteractivePostParams

type StartInteractivePostParams struct {
	// TransId A 128 bit GUID.
	TransId string `json:"transId"`

	// TransactionSrc The consuming application or user name.
	TransactionSrc string `json:"transactionSrc"`
}

StartInteractivePostParams defines parameters for StartInteractivePost.

type StartInteractivePostResponse

type StartInteractivePostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *InteractiveResponse
	JSON400      *CustomErrorResponse
	JSON401      *CustomErrorResponse
	JSON415      *CustomErrorResponse
	JSON422      *CustomErrorResponse
	JSON500      *CustomErrorResponse
}

func ParseStartInteractivePostResponse

func ParseStartInteractivePostResponse(rsp *http.Response) (*StartInteractivePostResponse, error)

ParseStartInteractivePostResponse parses an HTTP response from a StartInteractivePostWithResponse call

func (StartInteractivePostResponse) Status

Status returns HTTPResponse.Status

func (StartInteractivePostResponse) StatusCode

func (r StartInteractivePostResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type StartRequest

type StartRequest struct {
	// CommodityCountryOfOrigin The two-letter ISO 3166-1 alpha-2 country code representing the country of origin of the commodity.
	CommodityCountryOfOrigin *string `json:"commodityCountryOfOrigin,omitempty"`

	// CommodityCurrencyCode The three-letter currency code representing the currency in which the commodity value is expressed, according to the ISO 4217 standard.
	CommodityCurrencyCode *string `json:"commodityCurrencyCode,omitempty"`

	// CommodityDescription A brief description of the commodity, detailing its type and key characteristics.
	CommodityDescription string `json:"commodityDescription"`

	// CommodityHtsCode The commodityHtsCode is an optional field that allows the user to submit their known HTS classification. This will be used as a starting point for the interactive description guidance process.
	CommodityHtsCode *string `json:"commodityHtsCode,omitempty"`

	// CommodityQuantity The quantity of the commodity.
	CommodityQuantity *string `json:"commodityQuantity,omitempty"`

	// CommodityUnitOfMeasure The unit of measure used for the commodity quantity.
	CommodityUnitOfMeasure *string `json:"commodityUnitOfMeasure,omitempty"`

	// CommodityValue The declared value of the commodity for customs and trade purposes.
	CommodityValue *string `json:"commodityValue,omitempty"`

	// ExportCountryCode The two-letter ISO 3166-1 alpha-2 country code representing the export country.
	ExportCountryCode *string   `json:"exportCountryCode,omitempty"`
	ImportCountryCode Countries `json:"importCountryCode"`

	// Locale The language the user uses to submit their initial product description. If the actual language used differs from this field, the application will throw an error as a "7015".
	Locale *Languages `json:"locale,omitempty"`

	// ShipperAccountNumber The account number representing the company or individual responsible for shipping the commodity.
	ShipperAccountNumber *string `json:"shipperAccountNumber,omitempty"`

	// ShipperName The name of the company or individual responsible for shipping the commodity.
	ShipperName *string `json:"shipperName,omitempty"`
}

StartRequest defines model for StartRequest.

type SubmitFeedbackInteractiveFeedbackSessionIdPostJSONRequestBody

type SubmitFeedbackInteractiveFeedbackSessionIdPostJSONRequestBody = Feedback

SubmitFeedbackInteractiveFeedbackSessionIdPostJSONRequestBody defines body for SubmitFeedbackInteractiveFeedbackSessionIdPost for application/json ContentType.

type SubmitFeedbackInteractiveFeedbackSessionIdPostResponse

type SubmitFeedbackInteractiveFeedbackSessionIdPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *CustomErrorResponse
	JSON401      *CustomErrorResponse
	JSON415      *CustomErrorResponse
	JSON422      *CustomErrorResponse
	JSON500      *CustomErrorResponse
}

func ParseSubmitFeedbackInteractiveFeedbackSessionIdPostResponse

func ParseSubmitFeedbackInteractiveFeedbackSessionIdPostResponse(rsp *http.Response) (*SubmitFeedbackInteractiveFeedbackSessionIdPostResponse, error)

ParseSubmitFeedbackInteractiveFeedbackSessionIdPostResponse parses an HTTP response from a SubmitFeedbackInteractiveFeedbackSessionIdPostWithResponse call

func (SubmitFeedbackInteractiveFeedbackSessionIdPostResponse) Status

Status returns HTTPResponse.Status

func (SubmitFeedbackInteractiveFeedbackSessionIdPostResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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