mirror of https://github.com/vernonkeenan/lib
parent
6c7aeec0d4
commit
d24559cfdd
|
@ -0,0 +1,157 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
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 (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewPutUsersSessionsParams creates a new PutUsersSessionsParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewPutUsersSessionsParams() *PutUsersSessionsParams {
|
||||||
|
return &PutUsersSessionsParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsParamsWithTimeout creates a new PutUsersSessionsParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewPutUsersSessionsParamsWithTimeout(timeout time.Duration) *PutUsersSessionsParams {
|
||||||
|
return &PutUsersSessionsParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsParamsWithContext creates a new PutUsersSessionsParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewPutUsersSessionsParamsWithContext(ctx context.Context) *PutUsersSessionsParams {
|
||||||
|
return &PutUsersSessionsParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsParamsWithHTTPClient creates a new PutUsersSessionsParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewPutUsersSessionsParamsWithHTTPClient(client *http.Client) *PutUsersSessionsParams {
|
||||||
|
return &PutUsersSessionsParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessionsParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the put users sessions operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type PutUsersSessionsParams struct {
|
||||||
|
|
||||||
|
/* UserRequest.
|
||||||
|
|
||||||
|
A single new user record
|
||||||
|
*/
|
||||||
|
UserRequest *sfgate_models.UserRequest
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the put users sessions params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *PutUsersSessionsParams) WithDefaults() *PutUsersSessionsParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the put users sessions params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *PutUsersSessionsParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) WithTimeout(timeout time.Duration) *PutUsersSessionsParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) WithContext(ctx context.Context) *PutUsersSessionsParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) WithHTTPClient(client *http.Client) *PutUsersSessionsParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithUserRequest adds the userRequest to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) WithUserRequest(userRequest *sfgate_models.UserRequest) *PutUsersSessionsParams {
|
||||||
|
o.SetUserRequest(userRequest)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetUserRequest adds the userRequest to the put users sessions params
|
||||||
|
func (o *PutUsersSessionsParams) SetUserRequest(userRequest *sfgate_models.UserRequest) {
|
||||||
|
o.UserRequest = userRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *PutUsersSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
if o.UserRequest != nil {
|
||||||
|
if err := r.SetBodyParam(o.UserRequest); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,522 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
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 (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PutUsersSessionsReader is a Reader for the PutUsersSessions structure.
|
||||||
|
type PutUsersSessionsReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *PutUsersSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewPutUsersSessionsOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewPutUsersSessionsUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewPutUsersSessionsForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewPutUsersSessionsNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewPutUsersSessionsUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewPutUsersSessionsInternalServerError()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsOK creates a PutUsersSessionsOK with default headers values
|
||||||
|
func NewPutUsersSessionsOK() *PutUsersSessionsOK {
|
||||||
|
return &PutUsersSessionsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessionsOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
Response with User objects
|
||||||
|
*/
|
||||||
|
type PutUsersSessionsOK struct {
|
||||||
|
Payload *sfgate_models.UserResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put users sessions o k response has a 2xx status code
|
||||||
|
func (o *PutUsersSessionsOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put users sessions o k response has a 3xx status code
|
||||||
|
func (o *PutUsersSessionsOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put users sessions o k response has a 4xx status code
|
||||||
|
func (o *PutUsersSessionsOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put users sessions o k response has a 5xx status code
|
||||||
|
func (o *PutUsersSessionsOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put users sessions o k response a status code equal to that given
|
||||||
|
func (o *PutUsersSessionsOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put users sessions o k response
|
||||||
|
func (o *PutUsersSessionsOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsOK) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsOK %+v", 200, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsOK) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsOK %+v", 200, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsOK) GetPayload() *sfgate_models.UserResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(sfgate_models.UserResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsUnauthorized creates a PutUsersSessionsUnauthorized with default headers values
|
||||||
|
func NewPutUsersSessionsUnauthorized() *PutUsersSessionsUnauthorized {
|
||||||
|
return &PutUsersSessionsUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessionsUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
|
||||||
|
Access unauthorized, invalid API-KEY was used
|
||||||
|
*/
|
||||||
|
type PutUsersSessionsUnauthorized struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *sfgate_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put users sessions unauthorized response has a 2xx status code
|
||||||
|
func (o *PutUsersSessionsUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put users sessions unauthorized response has a 3xx status code
|
||||||
|
func (o *PutUsersSessionsUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put users sessions unauthorized response has a 4xx status code
|
||||||
|
func (o *PutUsersSessionsUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put users sessions unauthorized response has a 5xx status code
|
||||||
|
func (o *PutUsersSessionsUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put users sessions unauthorized response a status code equal to that given
|
||||||
|
func (o *PutUsersSessionsUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put users sessions unauthorized response
|
||||||
|
func (o *PutUsersSessionsUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnauthorized) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnauthorized) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnauthorized %+v", 401, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnauthorized) GetPayload() *sfgate_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header Access-Control-Allow-Origin
|
||||||
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||||
|
|
||||||
|
if hdrAccessControlAllowOrigin != "" {
|
||||||
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||||
|
}
|
||||||
|
|
||||||
|
o.Payload = new(sfgate_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsForbidden creates a PutUsersSessionsForbidden with default headers values
|
||||||
|
func NewPutUsersSessionsForbidden() *PutUsersSessionsForbidden {
|
||||||
|
return &PutUsersSessionsForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessionsForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
Access forbidden, account lacks access
|
||||||
|
*/
|
||||||
|
type PutUsersSessionsForbidden struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *sfgate_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put users sessions forbidden response has a 2xx status code
|
||||||
|
func (o *PutUsersSessionsForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put users sessions forbidden response has a 3xx status code
|
||||||
|
func (o *PutUsersSessionsForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put users sessions forbidden response has a 4xx status code
|
||||||
|
func (o *PutUsersSessionsForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put users sessions forbidden response has a 5xx status code
|
||||||
|
func (o *PutUsersSessionsForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put users sessions forbidden response a status code equal to that given
|
||||||
|
func (o *PutUsersSessionsForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put users sessions forbidden response
|
||||||
|
func (o *PutUsersSessionsForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsForbidden %+v", 403, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsForbidden %+v", 403, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsForbidden) GetPayload() *sfgate_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header Access-Control-Allow-Origin
|
||||||
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||||
|
|
||||||
|
if hdrAccessControlAllowOrigin != "" {
|
||||||
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||||
|
}
|
||||||
|
|
||||||
|
o.Payload = new(sfgate_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsNotFound creates a PutUsersSessionsNotFound with default headers values
|
||||||
|
func NewPutUsersSessionsNotFound() *PutUsersSessionsNotFound {
|
||||||
|
return &PutUsersSessionsNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessionsNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
Resource was not found
|
||||||
|
*/
|
||||||
|
type PutUsersSessionsNotFound struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *sfgate_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put users sessions not found response has a 2xx status code
|
||||||
|
func (o *PutUsersSessionsNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put users sessions not found response has a 3xx status code
|
||||||
|
func (o *PutUsersSessionsNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put users sessions not found response has a 4xx status code
|
||||||
|
func (o *PutUsersSessionsNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put users sessions not found response has a 5xx status code
|
||||||
|
func (o *PutUsersSessionsNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put users sessions not found response a status code equal to that given
|
||||||
|
func (o *PutUsersSessionsNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put users sessions not found response
|
||||||
|
func (o *PutUsersSessionsNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsNotFound %+v", 404, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsNotFound %+v", 404, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsNotFound) GetPayload() *sfgate_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header Access-Control-Allow-Origin
|
||||||
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||||
|
|
||||||
|
if hdrAccessControlAllowOrigin != "" {
|
||||||
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||||
|
}
|
||||||
|
|
||||||
|
o.Payload = new(sfgate_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsUnprocessableEntity creates a PutUsersSessionsUnprocessableEntity with default headers values
|
||||||
|
func NewPutUsersSessionsUnprocessableEntity() *PutUsersSessionsUnprocessableEntity {
|
||||||
|
return &PutUsersSessionsUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessionsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
|
||||||
|
Unprocessable Entity, likely a bad parameter
|
||||||
|
*/
|
||||||
|
type PutUsersSessionsUnprocessableEntity struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *sfgate_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put users sessions unprocessable entity response has a 2xx status code
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put users sessions unprocessable entity response has a 3xx status code
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put users sessions unprocessable entity response has a 4xx status code
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put users sessions unprocessable entity response has a 5xx status code
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put users sessions unprocessable entity response a status code equal to that given
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put users sessions unprocessable entity response
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnprocessableEntity %+v", 422, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnprocessableEntity %+v", 422, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header Access-Control-Allow-Origin
|
||||||
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||||
|
|
||||||
|
if hdrAccessControlAllowOrigin != "" {
|
||||||
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||||
|
}
|
||||||
|
|
||||||
|
o.Payload = new(sfgate_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutUsersSessionsInternalServerError creates a PutUsersSessionsInternalServerError with default headers values
|
||||||
|
func NewPutUsersSessionsInternalServerError() *PutUsersSessionsInternalServerError {
|
||||||
|
return &PutUsersSessionsInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessionsInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
|
||||||
|
Server Internal Error
|
||||||
|
*/
|
||||||
|
type PutUsersSessionsInternalServerError struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *sfgate_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put users sessions internal server error response has a 2xx status code
|
||||||
|
func (o *PutUsersSessionsInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put users sessions internal server error response has a 3xx status code
|
||||||
|
func (o *PutUsersSessionsInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put users sessions internal server error response has a 4xx status code
|
||||||
|
func (o *PutUsersSessionsInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put users sessions internal server error response has a 5xx status code
|
||||||
|
func (o *PutUsersSessionsInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put users sessions internal server error response a status code equal to that given
|
||||||
|
func (o *PutUsersSessionsInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put users sessions internal server error response
|
||||||
|
func (o *PutUsersSessionsInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsInternalServerError) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsInternalServerError %+v", 500, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsInternalServerError) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsInternalServerError %+v", 500, o.Payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsInternalServerError) GetPayload() *sfgate_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutUsersSessionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header Access-Control-Allow-Origin
|
||||||
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||||
|
|
||||||
|
if hdrAccessControlAllowOrigin != "" {
|
||||||
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||||
|
}
|
||||||
|
|
||||||
|
o.Payload = new(sfgate_models.Error)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -40,6 +40,8 @@ type ClientService interface {
|
||||||
|
|
||||||
PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersOK, error)
|
PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersOK, error)
|
||||||
|
|
||||||
|
PutUsersSessions(params *PutUsersSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersSessionsOK, error)
|
||||||
|
|
||||||
SetTransport(transport runtime.ClientTransport)
|
SetTransport(transport runtime.ClientTransport)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +89,7 @@ func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInf
|
||||||
/*
|
/*
|
||||||
PostUsers creates new salesforce user
|
PostUsers creates new salesforce user
|
||||||
|
|
||||||
Create user recorda in Salesforce
|
Create user records in Salesforce
|
||||||
*/
|
*/
|
||||||
func (a *Client) PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOK, error) {
|
func (a *Client) PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOK, error) {
|
||||||
// TODO: Validate the params before sending
|
// TODO: Validate the params before sending
|
||||||
|
@ -126,9 +128,9 @@ func (a *Client) PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthI
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
PutUsers creates new salesforce user
|
PutUsers updates existing user records in salesforce
|
||||||
|
|
||||||
Update existing user recorda in Salesforce
|
Update existing user records in Salesforce
|
||||||
*/
|
*/
|
||||||
func (a *Client) PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersOK, error) {
|
func (a *Client) PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersOK, error) {
|
||||||
// TODO: Validate the params before sending
|
// TODO: Validate the params before sending
|
||||||
|
@ -166,6 +168,47 @@ func (a *Client) PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInf
|
||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutUsersSessions updates user records session data in salesforce
|
||||||
|
|
||||||
|
Update user records session data in Salesforce
|
||||||
|
*/
|
||||||
|
func (a *Client) PutUsersSessions(params *PutUsersSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersSessionsOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewPutUsersSessionsParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "putUsersSessions",
|
||||||
|
Method: "PUT",
|
||||||
|
PathPattern: "/users/sessions",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &PutUsersSessionsReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*PutUsersSessionsOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for putUsersSessions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
// SetTransport changes the transport on the client
|
// SetTransport changes the transport on the client
|
||||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||||
a.transport = transport
|
a.transport = transport
|
||||||
|
|
|
@ -1380,7 +1380,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Users
|
- Users
|
||||||
post:
|
post:
|
||||||
description: Create user recorda in Salesforce
|
description: Create user records in Salesforce
|
||||||
operationId: postUsers
|
operationId: postUsers
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/newUserRequest"
|
- $ref: "#/parameters/newUserRequest"
|
||||||
|
@ -1403,7 +1403,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Users
|
- Users
|
||||||
put:
|
put:
|
||||||
description: Update existing user recorda in Salesforce
|
description: Update existing user records in Salesforce
|
||||||
operationId: putUsers
|
operationId: putUsers
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/newUserRequest"
|
- $ref: "#/parameters/newUserRequest"
|
||||||
|
@ -1422,7 +1422,31 @@ paths:
|
||||||
$ref: "#/responses/ServerError"
|
$ref: "#/responses/ServerError"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Create new Salesforce User
|
summary: Update existing user records in Salesforce
|
||||||
|
tags:
|
||||||
|
- Users
|
||||||
|
/users/sessions:
|
||||||
|
put:
|
||||||
|
description: Update user records session data in Salesforce
|
||||||
|
operationId: putUsersSessions
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/parameters/newUserRequest"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
$ref: "#/responses/UserResponse"
|
||||||
|
"401":
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
"403":
|
||||||
|
$ref: "#/responses/AccessForbidden"
|
||||||
|
"404":
|
||||||
|
$ref: "#/responses/NotFound"
|
||||||
|
"422":
|
||||||
|
$ref: "#/responses/UnprocessableEntity"
|
||||||
|
"500":
|
||||||
|
$ref: "#/responses/ServerError"
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
summary: Update user records session data in Salesforce
|
||||||
tags:
|
tags:
|
||||||
- Users
|
- Users
|
||||||
definitions:
|
definitions:
|
||||||
|
|
|
@ -1380,7 +1380,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Users
|
- Users
|
||||||
post:
|
post:
|
||||||
description: Create user recorda in Salesforce
|
description: Create user records in Salesforce
|
||||||
operationId: postUsers
|
operationId: postUsers
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/newUserRequest"
|
- $ref: "#/parameters/newUserRequest"
|
||||||
|
@ -1403,7 +1403,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Users
|
- Users
|
||||||
put:
|
put:
|
||||||
description: Update existing user recorda in Salesforce
|
description: Update existing user records in Salesforce
|
||||||
operationId: putUsers
|
operationId: putUsers
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/newUserRequest"
|
- $ref: "#/parameters/newUserRequest"
|
||||||
|
@ -1422,7 +1422,31 @@ paths:
|
||||||
$ref: "#/responses/ServerError"
|
$ref: "#/responses/ServerError"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Create new Salesforce User
|
summary: Update existing user records in Salesforce
|
||||||
|
tags:
|
||||||
|
- Users
|
||||||
|
/users/sessions:
|
||||||
|
put:
|
||||||
|
description: Update user records session data in Salesforce
|
||||||
|
operationId: putUsersSessions
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/parameters/newUserRequest"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
$ref: "#/responses/UserResponse"
|
||||||
|
"401":
|
||||||
|
$ref: "#/responses/Unauthorized"
|
||||||
|
"403":
|
||||||
|
$ref: "#/responses/AccessForbidden"
|
||||||
|
"404":
|
||||||
|
$ref: "#/responses/NotFound"
|
||||||
|
"422":
|
||||||
|
$ref: "#/responses/UnprocessableEntity"
|
||||||
|
"500":
|
||||||
|
$ref: "#/responses/ServerError"
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
summary: Update user records session data in Salesforce
|
||||||
tags:
|
tags:
|
||||||
- Users
|
- Users
|
||||||
definitions:
|
definitions:
|
||||||
|
|
Loading…
Reference in New Issue