src.dualinventive.com/go/users-service/rest/client/users/users_client.go

89 lines
2.4 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
)
// New creates a new users API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
}
/*
Client for users API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
/*
GetUserByID Returns a User by the given userID
*/
func (a *Client) GetUserByID(params *GetUserByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserByIDOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetUserByIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetUserByID",
Method: "GET",
PathPattern: "/users/{userID}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &GetUserByIDReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetUserByIDOK), nil
}
/*
ListUsers Returns a list of users
*/
func (a *Client) ListUsers(params *ListUsersParams, authInfo runtime.ClientAuthInfoWriter) (*ListUsersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListUsersParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "ListUsers",
Method: "GET",
PathPattern: "/users",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &ListUsersReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*ListUsersOK), nil
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}