1
0
mirror of https://github.com/Luzifer/mondash.git synced 2024-09-20 09:22:58 +00:00
mondash/vendor/github.com/aws/aws-sdk-go/service/machinelearning/customizations.go

34 lines
649 B
Go
Raw Normal View History

package machinelearning
import (
"net/url"
"github.com/aws/aws-sdk-go/aws/request"
)
func init() {
initRequest = func(r *request.Request) {
switch r.Operation.Name {
case opPredict:
r.Handlers.Build.PushBack(updatePredictEndpoint)
}
}
}
// updatePredictEndpoint rewrites the request endpoint to use the
// "PredictEndpoint" parameter of the Predict operation.
func updatePredictEndpoint(r *request.Request) {
if !r.ParamsFilled() {
return
}
r.ClientInfo.Endpoint = *r.Params.(*PredictInput).PredictEndpoint
uri, err := url.Parse(r.ClientInfo.Endpoint)
if err != nil {
r.Error = err
return
}
r.HTTPRequest.URL = uri
}